From de86697d7df999b0d8cb35898d3e1e8fc72e8f55 Mon Sep 17 00:00:00 2001 From: Alison Jenkins <1176328+alisonjenkins@users.noreply.github.com> Date: Thu, 16 Jan 2025 23:37:07 +0000 Subject: [PATCH] Add initial base module --- hosts/ali-desktop/configuration.nix | 56 +------------------------- modules/base/default.nix | 61 +++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 55 deletions(-) create mode 100644 modules/base/default.nix diff --git a/hosts/ali-desktop/configuration.nix b/hosts/ali-desktop/configuration.nix index 74db7ee..825edfa 100644 --- a/hosts/ali-desktop/configuration.nix +++ b/hosts/ali-desktop/configuration.nix @@ -7,15 +7,12 @@ }: { imports = [ # inputs.nix-gaming.nixosModules.pipewireLowLatency + (import ../../modules/base { }) (import ../../modules/locale { }) ../../app-profiles/desktop ./hardware-configuration.nix ]; - console.keyMap = "us"; - hardware.pulseaudio.enable = false; - time.timeZone = "Europe/London"; - boot = { consoleLogLevel = 0; initrd.verbose = false; @@ -117,13 +114,6 @@ }; }; - chaotic = { - mesa-git = { - enable = false; - # method = "GBM_BACKENDS_PATH"; - }; - }; - environment = { pathsToLink = [ "/share/zsh" ]; @@ -357,20 +347,7 @@ }; }; - security = { - rtkit.enable = true; - - sudo = { - enable = true; - wheelNeedsPassword = true; - }; - }; - services = { - fstrim.enable = true; - irqbalance.enable = true; - resolved.enable = true; - # beesd = { # filesystems = { # persistence = { @@ -397,33 +374,6 @@ }; }; - earlyoom = { - enable = true; - enableNotifications = true; - }; - - openssh = { - enable = true; - - hostKeys = [ - { - bits = 4096; - path = "/etc/ssh/ssh_host_rsa_key"; - type = "rsa"; - } - { - path = "/etc/ssh/ssh_host_ed25519_key"; - type = "ed25519"; - } - ]; - - settings = { - PasswordAuthentication = false; - KbdInteractiveAuthentication = false; - PermitRootLogin = "no"; - }; - }; - pipewire = { enable = true; alsa.enable = true; @@ -655,8 +605,4 @@ enable = true; xdgOpenUsePortal = true; }; - - zramSwap = { - enable = true; - }; } diff --git a/modules/base/default.nix b/modules/base/default.nix new file mode 100644 index 0000000..9b73548 --- /dev/null +++ b/modules/base/default.nix @@ -0,0 +1,61 @@ +{ consoleKeyMap ? "us" +, timezone ? "Europe/London" +, enableMesaGit ? false +, +}: { + console.keyMap = consoleKeyMap; + hardware.pulseaudio.enable = false; + time.timeZone = timezone; + + chaotic = { + mesa-git = { + enable = enableMesaGit; + }; + }; + + security = { + rtkit.enable = true; + + sudo = { + enable = true; + wheelNeedsPassword = true; + }; + }; + + services = { + fstrim.enable = true; + irqbalance.enable = true; + resolved.enable = true; + + earlyoom = { + enable = true; + enableNotifications = true; + }; + + openssh = { + enable = true; + + hostKeys = [ + { + bits = 4096; + path = "/etc/ssh/ssh_host_rsa_key"; + type = "rsa"; + } + { + path = "/etc/ssh/ssh_host_ed25519_key"; + type = "ed25519"; + } + ]; + + settings = { + PasswordAuthentication = false; + KbdInteractiveAuthentication = false; + PermitRootLogin = "no"; + }; + }; + }; + + zramSwap = { + enable = true; + }; +}