234 lines
5.5 KiB
Nix
234 lines
5.5 KiB
Nix
{ config, pkgs, ... }:
|
|
|
|
{
|
|
# Imports
|
|
imports = [
|
|
./hardware-configuration.nix
|
|
./modules/wifi-dongle.nix
|
|
./modules/disable-hibernation.nix
|
|
./modules/dns-over-https.nix
|
|
./modules/nvidia.nix
|
|
./modules/network-manager.nix
|
|
./modules/esync.nix
|
|
./modules/ryzenadj.nix
|
|
./modules/appimages.nix
|
|
];
|
|
|
|
# Bootloader.
|
|
boot.loader.systemd-boot.enable = true;
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
|
|
|
# Current lts kernel
|
|
boot.kernelPackages = pkgs.linuxPackages;
|
|
|
|
# load amdgpu and nouveau at boot
|
|
boot.initrd.kernelModules = [ "amdgpu" ];
|
|
|
|
# Enable gsp
|
|
# boot.kernelParams = [
|
|
# "nouveau.config=NvGspRM=1"
|
|
# "nouveau.debug=info,VBIOS=info,gsp=debug"
|
|
# ];
|
|
|
|
# Set the hostname
|
|
networking.hostName = "nixos";
|
|
|
|
# Enable flakes
|
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
|
|
|
# Allow unfree packages
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
# Set your time zone.
|
|
time.timeZone = "Europe/Zagreb";
|
|
|
|
# Select internationalisation properties.
|
|
i18n.defaultLocale = "en_US.UTF-8";
|
|
|
|
i18n.extraLocaleSettings = {
|
|
LC_ADDRESS = "hr_HR.UTF-8";
|
|
LC_IDENTIFICATION = "hr_HR.UTF-8";
|
|
LC_MEASUREMENT = "hr_HR.UTF-8";
|
|
LC_MONETARY = "hr_HR.UTF-8";
|
|
LC_NAME = "hr_HR.UTF-8";
|
|
LC_NUMERIC = "hr_HR.UTF-8";
|
|
LC_PAPER = "hr_HR.UTF-8";
|
|
LC_TELEPHONE = "hr_HR.UTF-8";
|
|
LC_TIME = "hr_HR.UTF-8";
|
|
};
|
|
|
|
# Enable the X11 windowing system.
|
|
services.xserver.enable = true;
|
|
|
|
# Configure keymap in X11
|
|
services.xserver.xkb = {
|
|
layout = "us";
|
|
variant = "";
|
|
options = "caps:escape";
|
|
};
|
|
|
|
# Enable touchpad support
|
|
services.xserver.libinput.enable = true;
|
|
|
|
# Enable sddm with catppuccin theme and fix virtual keyboard bug
|
|
services.xserver.displayManager.sddm = {
|
|
enable = true;
|
|
wayland.enable = true;
|
|
theme = "catppuccin-frappe";
|
|
# Fix keyboard showing up unnecesarilly
|
|
settings = { General = { InputMethod = ""; }; };
|
|
};
|
|
|
|
# Setup plasma with excluding a couple unnecesarry packages
|
|
services.desktopManager.plasma6.enable = true;
|
|
environment.plasma6.excludePackages = with pkgs.libsForQt5; [
|
|
plasma-browser-integration
|
|
konsole
|
|
oxygen
|
|
];
|
|
|
|
# Enable CUPS to print documents.
|
|
services.printing.enable = true;
|
|
|
|
# Enable gvfs
|
|
services.gvfs.enable = true;
|
|
|
|
# Enable sound with pipewire.
|
|
sound.enable = true;
|
|
hardware.pulseaudio.enable = false;
|
|
security.rtkit.enable = true;
|
|
services.pipewire = {
|
|
enable = true;
|
|
alsa.enable = true;
|
|
alsa.support32Bit = true;
|
|
pulse.enable = true;
|
|
};
|
|
|
|
# Enable 32bit support for pulseaudio
|
|
hardware.pulseaudio.support32Bit = true;
|
|
|
|
# Enable OpenGL
|
|
hardware.opengl = {
|
|
enable = true;
|
|
driSupport = true;
|
|
driSupport32Bit = true;
|
|
};
|
|
|
|
# Enable bluetooth
|
|
hardware.bluetooth.enable = true;
|
|
|
|
# Open Tablet Driver setup
|
|
hardware.opentabletdriver.enable = true;
|
|
|
|
# Load nvidia driver for Xorg and Wayland
|
|
services.xserver.videoDrivers = [ "amdgpu" ];
|
|
|
|
# Steam settings
|
|
programs.steam = {
|
|
enable = true;
|
|
remotePlay.openFirewall = true;
|
|
dedicatedServer.openFirewall = true;
|
|
gamescopeSession.enable = true;
|
|
};
|
|
|
|
# List packages installed in system profile.
|
|
environment.systemPackages = with pkgs; [
|
|
neovim
|
|
usbutils
|
|
pciutils
|
|
lshw
|
|
vulkan-tools
|
|
restic
|
|
rsync
|
|
git
|
|
jq
|
|
wireguard-tools
|
|
unzip
|
|
gamemode
|
|
ipafont
|
|
ryzenadj
|
|
wineWowPackages.staging
|
|
lutris
|
|
cryptsetup
|
|
xfsprogs
|
|
(catppuccin-kde.override { winDecStyles = [ "classic" "modern" ]; })
|
|
catppuccin-sddm-corners
|
|
(callPackage ./modules/catppuccin-sddm.nix { inherit pkgs; })
|
|
];
|
|
|
|
# firewall settings
|
|
networking.firewall = {
|
|
enable = true;
|
|
# allow specific tcp ports
|
|
allowedTCPPorts = [ 2234 22000 ];
|
|
# allow specific udp ports
|
|
allowedUDPPorts = [ 22000 21027 ];
|
|
# if packets are still dropped, they will show up in dmesg
|
|
logReversePathDrops = true;
|
|
# wireguard trips rpfilter up
|
|
extraCommands = ''
|
|
ip46tables -t mangle -I nixos-fw-rpfilter -p udp -m udp --sport 51820 -j RETURN
|
|
ip46tables -t mangle -I nixos-fw-rpfilter -p udp -m udp --dport 51820 -j RETURN
|
|
'';
|
|
extraStopCommands = ''
|
|
ip46tables -t mangle -D nixos-fw-rpfilter -p udp -m udp --sport 51820 -j RETURN || true
|
|
ip46tables -t mangle -D nixos-fw-rpfilter -p udp -m udp --dport 51820 -j RETURN || true
|
|
'';
|
|
};
|
|
|
|
# Enable fstrim
|
|
services.fstrim.enable = true;
|
|
|
|
# Enable ratbagd for mice configuration
|
|
services.ratbagd.enable = true;
|
|
|
|
# Enable firmware updater
|
|
services.fwupd.enable = true;
|
|
|
|
# Setup syncthing
|
|
services = {
|
|
syncthing = {
|
|
enable = true;
|
|
user = "crony";
|
|
dataDir = "/home/crony/.local/sync";
|
|
configDir = "/home/crony/.config/syncthing";
|
|
};
|
|
};
|
|
|
|
# Setting up zsh
|
|
programs.zsh.enable = true;
|
|
|
|
# For the completion plugin
|
|
environment.pathsToLink = [ "/share/zsh" ];
|
|
|
|
# Defining my user
|
|
users.users.crony = {
|
|
isNormalUser = true;
|
|
description = "Crony";
|
|
extraGroups =
|
|
[ "networkmanager" "wheel" "video" "input" "audio" "libvirtd" ];
|
|
shell = pkgs.zsh;
|
|
};
|
|
|
|
# Add ~/.local/bin to path
|
|
environment.localBinInPath = true;
|
|
|
|
# Automatic cleanup and optimization
|
|
nix.optimise.automatic = true;
|
|
nix.gc = {
|
|
automatic = true;
|
|
dates = "weekly";
|
|
options = "--delete-older-than 15d";
|
|
};
|
|
|
|
# Enable virt manager
|
|
virtualisation.libvirtd.enable = true;
|
|
programs.virt-manager.enable = true;
|
|
|
|
# Enable zram swap device
|
|
zramSwap.enable = true;
|
|
|
|
# DO NOT CHANGE
|
|
system.stateVersion = "23.11";
|
|
}
|