diff --git a/home-manager/home.nix b/home-manager/home.nix index c2dd3b1..050b3e2 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -50,7 +50,11 @@ lazygit # Amazing git tui lm_sensors # Sensor monitoring tool (nerdfonts.override { fonts = [ "CascadiaCode" ]; }) # Best font - + (retroarch.override { + cores = with libretro; [ + snes9x + ]; + }) # # You can also create simple shell scripts directly inside your # # configuration. For example, this adds a command 'my-hello' to your diff --git a/nixos/configuration.nix b/nixos/configuration.nix index fc9d802..851dc6c 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -5,18 +5,16 @@ imports = [ ./hardware-configuration.nix + ./modules/wifi-dongle.nix + ./modules/disable-hibernation.nix + ./modules/dns-over-https.nix + ./modules/nvidia.nix ]; # Bootloader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; - # Modules - boot.blacklistedKernelModules = [ "rtl8xxxu" "iwlwifi"]; - boot.extraModulePackages = with config.boot.kernelPackages; [ - rtl8192eu - ]; - # Set the hostname networking.hostName = "nixos"; @@ -26,63 +24,16 @@ # Allow unfree packages nixpkgs.config.allowUnfree = true; - # Disable hibernation, sleep and other friends - systemd.targets = { - sleep = { - enable = false; - unitConfig.DefaultDependencies = "no"; - }; - suspend = { - enable = false; - unitConfig.DefaultDependencies = "no"; - }; - hibernate = { - enable = false; - unitConfig.DefaultDependencies = "no"; - }; - "hybrid-sleep" = { - enable = false; - unitConfig.DefaultDependencies = "no"; - }; - }; - # Enable networking networking.networkmanager.enable = true; - # Set your time zone. - time.timeZone = "Europe/Zagreb"; - # Set iwd as wifi backend networking.wireless.iwd.enable = true; networking.networkmanager.wifi.backend = "iwd"; networking.networkmanager.wifi.powersave = false; - ### --- Enabling DNS Over HTTPS --- ### - - # make network manager not set a default dns - networking.networkmanager.dns = "none"; - - # set dns to local nameservers - networking.nameservers = [ "127.0.0.1" "::1" ]; - - # Dnscrypt for dns over https - services.dnscrypt-proxy2 = { - enable = true; - settings = { - ipv6_servers = true; - require_dnssec = true; - sources.public-resolvers = { - urls = [ - "https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/public-resolvers.md" - "https://download.dnscrypt.info/resolvers-list/v3/public-resolvers.md" - ]; - cache_file = "/var/lib/dnscrypt-proxy2/public-resolvers.md"; - minisign_key = "RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3"; - }; - # use mullvad dns server - server_names = [ "mullvad-base-doh" ]; - }; - }; + # Set your time zone. + time.timeZone = "Europe/Zagreb"; # Select internationalisation properties. i18n.defaultLocale = "en_US.UTF-8"; @@ -112,7 +63,7 @@ # Enable touchpad support services.xserver.libinput.enable = true; - # Enable the KDE Plasma Desktop Environment. + # Enable sddm with catppuccin theme and fix virtual keyboard bug services.xserver.displayManager.sddm = { enable = true; theme = "catppuccin-sddm-corners"; @@ -123,6 +74,8 @@ }; }; }; + + # Setup plasma with excluding a couple unnecesarry packages services.xserver.desktopManager.plasma5.enable = true; environment.plasma5.excludePackages = with pkgs.libsForQt5; [ plasma-browser-integration @@ -131,7 +84,7 @@ ]; # Enable CUPS to print documents. - services.printing.enable = false; + services.printing.enable = true; # Enable gvfs services.gvfs.enable = true; @@ -154,34 +107,6 @@ driSupport32Bit = true; }; - # Nvidia settings - hardware.nvidia = { - - # Modesetting is required. - modesetting.enable = true; - - # Nvidia power management. Experimental, and can cause sleep/suspend to fail. - powerManagement.enable = true; - - # Nvidia fine grainder power management, super experimental. - powerManagement.finegrained = false; - - open = false; - - # Enable the Nvidia settings menu, - nvidiaSettings = true; - - # Optionally, you may need to select the appropriate driver version for your specific GPU. - package = config.boot.kernelPackages.nvidiaPackages.stable; - }; - - # Nvidia prime settings - hardware.nvidia.prime = { - reverseSync.enable = true; - intelBusId = "PCI:5:0:0"; - nvidiaBusId = "PCI:1:0:0"; - }; - # Enable bluetooth hardware.bluetooth.enable = true; @@ -263,13 +188,6 @@ isNormalUser = true; description = "Crony"; extraGroups = [ "networkmanager" "wheel" ]; - packages = with pkgs; [ - (retroarch.override { - cores = with libretro; [ - snes9x - ]; - }) - ]; shell = pkgs.zsh; }; diff --git a/nixos/modules/disable-hibernation.nix b/nixos/modules/disable-hibernation.nix new file mode 100644 index 0000000..07e1595 --- /dev/null +++ b/nixos/modules/disable-hibernation.nix @@ -0,0 +1,22 @@ +{ ... }: +{ + # Disable hibernation, sleep and other friends + systemd.targets = { + sleep = { + enable = false; + unitConfig.DefaultDependencies = "no"; + }; + suspend = { + enable = false; + unitConfig.DefaultDependencies = "no"; + }; + hibernate = { + enable = false; + unitConfig.DefaultDependencies = "no"; + }; + "hybrid-sleep" = { + enable = false; + unitConfig.DefaultDependencies = "no"; + }; + }; +} diff --git a/nixos/modules/dns-over-https.nix b/nixos/modules/dns-over-https.nix new file mode 100644 index 0000000..11553fa --- /dev/null +++ b/nixos/modules/dns-over-https.nix @@ -0,0 +1,29 @@ +{ ... }: +{ + ### --- Enabling DNS Over HTTPS --- ### + + # make network manager not set a default dns + networking.networkmanager.dns = "none"; + + # set dns to local nameservers + networking.nameservers = [ "127.0.0.1" "::1" ]; + + # Dnscrypt for dns over https + services.dnscrypt-proxy2 = { + enable = true; + settings = { + ipv6_servers = true; + require_dnssec = true; + sources.public-resolvers = { + urls = [ + "https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/public-resolvers.md" + "https://download.dnscrypt.info/resolvers-list/v3/public-resolvers.md" + ]; + cache_file = "/var/lib/dnscrypt-proxy2/public-resolvers.md"; + minisign_key = "RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3"; + }; + # use mullvad dns server + server_names = [ "mullvad-base-doh" ]; + }; + }; +} diff --git a/nixos/modules/nvidia.nix b/nixos/modules/nvidia.nix new file mode 100644 index 0000000..c4d36b9 --- /dev/null +++ b/nixos/modules/nvidia.nix @@ -0,0 +1,31 @@ +{ config, ... }: +{ + # Nvidia settings + hardware.nvidia = { + + # Modesetting is required. + modesetting.enable = true; + + # Nvidia power management. Experimental, and can cause sleep/suspend to fail. + powerManagement.enable = true; + + # Nvidia fine grainder power management, super experimental. + powerManagement.finegrained = false; + + # Open kernel drivers + open = false; + + # Enable the Nvidia settings menu, + nvidiaSettings = true; + + # Optionally, you may need to select the appropriate driver version for your specific GPU. + package = config.boot.kernelPackages.nvidiaPackages.stable; + }; + + # Nvidia optimus prime settings + hardware.nvidia.prime = { + reverseSync.enable = true; + intelBusId = "PCI:5:0:0"; + nvidiaBusId = "PCI:1:0:0"; + }; +} diff --git a/nixos/modules/wifi-dongle.nix b/nixos/modules/wifi-dongle.nix new file mode 100644 index 0000000..1f71f7c --- /dev/null +++ b/nixos/modules/wifi-dongle.nix @@ -0,0 +1,8 @@ +{ config, ... }: +{ + # Setup correct modules for tplink wifi dongle and disable builtin wifi card. + boot.blacklistedKernelModules = [ "rtl8xxxu" "iwlwifi" ]; + boot.extraModulePackages = with config.boot.kernelPackages; [ + rtl8192eu + ]; +}