From dbb3ec38952a8fa92dfe53e211d23e3d03b52deb Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Sun, 7 Jul 2024 19:17:35 -0400 Subject: [PATCH] move nixos/base to baseModules --- baseModules/default.nix | 121 ++++++++++++++++++ baseModules/nixpkgs.nix | 46 +++++++ flake.nix | 11 +- hosts/common.nix | 121 ++++++++++++++++++ hosts/fallarbor/default.nix | 6 +- hosts/lavaridge/default.nix | 3 +- hosts/mandarin/default.nix | 21 ++- hosts/mandarin/hardware.nix | 22 ---- hosts/mauville/default.nix | 20 ++- hosts/mauville/hardware.nix | 18 --- hosts/petalburg/default.nix | 4 +- hosts/rustboro/default.nix | 2 +- nixosModules/apps/virt-manager/default.nix | 7 +- nixosModules/base/default.nix | 78 ----------- nixosModules/base/networking/default.nix | 101 --------------- .../base/networking/sambaAutoMount.nix | 54 -------- nixosModules/base/nix/default.nix | 49 ------- nixosModules/base/nixpkgs/default.nix | 48 ------- nixosModules/default.nix | 1 - nixosModules/desktop/hyprland/default.nix | 13 ++ nixosModules/options.nix | 13 -- 21 files changed, 342 insertions(+), 417 deletions(-) create mode 100644 baseModules/default.nix create mode 100644 baseModules/nixpkgs.nix create mode 100644 hosts/common.nix delete mode 100644 hosts/mandarin/hardware.nix delete mode 100644 hosts/mauville/hardware.nix delete mode 100644 nixosModules/base/default.nix delete mode 100644 nixosModules/base/networking/default.nix delete mode 100644 nixosModules/base/networking/sambaAutoMount.nix delete mode 100644 nixosModules/base/nix/default.nix delete mode 100644 nixosModules/base/nixpkgs/default.nix diff --git a/baseModules/default.nix b/baseModules/default.nix new file mode 100644 index 00000000..801c36be --- /dev/null +++ b/baseModules/default.nix @@ -0,0 +1,121 @@ +inputs: { + config, + lib, + pkgs, + ... +}: { + imports = [./nixpkgs.nix]; + + console.useXkbConfig = true; + + environment.systemPackages = with pkgs; [ + inputs.agenix.packages.${pkgs.system}.default + inxi + ]; + + i18n = { + defaultLocale = lib.mkDefault "en_US.UTF-8"; + extraLocaleSettings = { + LC_ADDRESS = config.i18n.defaultLocale; + LC_IDENTIFICATION = config.i18n.defaultLocale; + LC_MEASUREMENT = config.i18n.defaultLocale; + LC_MONETARY = config.i18n.defaultLocale; + LC_NAME = config.i18n.defaultLocale; + LC_NUMERIC = config.i18n.defaultLocale; + LC_PAPER = config.i18n.defaultLocale; + LC_TELEPHONE = config.i18n.defaultLocale; + LC_TIME = config.i18n.defaultLocale; + }; + }; + + hardware.keyboard.qmk.enable = true; + + programs = { + gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; + + nh.enable = true; + }; + + nix = { + gc = { + automatic = true; + dates = "daily"; + options = "--delete-older-than 3d"; + persistent = true; + randomizedDelaySec = "60min"; + }; + + # Run GC when there is less than 100MiB left. + extraOptions = '' + min-free = ${toString (100 * 1024 * 1024)} + max-free = ${toString (1024 * 1024 * 1024)} + ''; + + optimise.automatic = true; + + settings = { + auto-optimise-store = false; + experimental-features = ["nix-command" "flakes"]; + }; + }; + + security = { + polkit.enable = true; + rtkit.enable = true; + }; + + services = { + avahi = { + enable = true; + nssmdns4 = true; + openFirewall = true; + publish = { + enable = true; + addresses = true; + userServices = true; + workstation = true; + }; + }; + + logind.extraConfig = '' + # Don't shutdown when power button is short-pressed + HandlePowerKey=suspend + HandlePowerKeyLongPress=poweroff + ''; + + openssh = { + enable = true; + openFirewall = true; + settings.PasswordAuthentication = false; + }; + + printing.enable = true; + + system-config-printer.enable = true; + }; + + sound.enable = true; + + system.autoUpgrade = { + allowReboot = true; + dates = "04:00"; + randomizedDelaySec = "20min"; + enable = true; + flake = "github:alyraffauf/nixcfg"; + operation = "boot"; + rebootWindow = { + lower = "02:00"; + upper = "05:00"; + }; + }; + + time.timeZone = "America/New_York"; + + zramSwap = { + enable = lib.mkDefault true; + memoryPercent = lib.mkDefault 50; + }; +} diff --git a/baseModules/nixpkgs.nix b/baseModules/nixpkgs.nix new file mode 100644 index 00000000..3578cadb --- /dev/null +++ b/baseModules/nixpkgs.nix @@ -0,0 +1,46 @@ +{ + config, + inputs, + lib, + pkgs, + ... +}: { + nixpkgs = let + unstable = import inputs.nixpkgsUnstable { + system = pkgs.system; + config.allowUnfree = true; # Allow unfree packages + }; + in { + config.allowUnfree = true; # Allow unfree packages + + # Overlays over default packages. + overlays = [ + inputs.nur.overlay + (final: prev: { + alyraffauf-wallpapers = inputs.wallpapers.packages.${pkgs.system}.default; + brave = prev.brave.override {commandLineArgs = "--gtk-version=4 --enable-wayland-ime";}; + google-chrome = prev.google-chrome.override {commandLineArgs = "--gtk-version=4 --enable-wayland-ime";}; + hyprland = inputs.hyprland.packages.${pkgs.system}.hyprland; + nerdfonts = prev.nerdfonts.override {fonts = ["Noto"];}; + + obsidian = prev.obsidian.overrideAttrs (old: { + installPhase = + builtins.replaceStrings ["--ozone-platform=wayland"] + ["--ozone-platform=wayland --enable-wayland-ime"] + old.installPhase; + }); + + vscodium = prev.vscodium.override {commandLineArgs = "--enable-wayland-ime";}; + + webcord = prev.webcord.overrideAttrs (old: { + installPhase = + builtins.replaceStrings ["--ozone-platform-hint=auto"] + ["--ozone-platform-hint=auto --enable-wayland-ime"] + old.installPhase; + }); + + xdg-desktop-portal-hyprland = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland; + }) + ]; + }; +} diff --git a/flake.nix b/flake.nix index 23be6171..7f055e26 100644 --- a/flake.nix +++ b/flake.nix @@ -75,11 +75,11 @@ homeManagerModules.default = import ./homeManagerModules inputs self; - nixosModules.nixos = - import ./nixosModules inputs; - - nixosModules.users = - import ./userModules inputs; + nixosModules = { + base = import ./baseModules inputs; + nixos = import ./nixosModules inputs; + users = import ./userModules inputs; + }; nixosConfigurations = inputs.nixpkgs.lib.genAttrs [ @@ -102,6 +102,7 @@ inputs.nixvim.nixosModules.nixvim inputs.nur.nixosModules.nur inputs.raffauflabs.nixosModules.raffauflabs + self.nixosModules.base self.nixosModules.nixos self.nixosModules.users diff --git a/hosts/common.nix b/hosts/common.nix new file mode 100644 index 00000000..e63127b9 --- /dev/null +++ b/hosts/common.nix @@ -0,0 +1,121 @@ +{ + config, + lib, + pkgs, + ... +}: { + age.secrets.wifi.file = ../secrets/wifi.age; + environment.variables.FLAKE = "github:alyraffauf/nixcfg"; + + fileSystems = lib.attrsets.optionalAttrs (config.networking.hostName != "mauville") { + "/mnt/Archive" = { + device = "//mauville/Archive"; + fsType = "cifs"; + options = [ + "gid=100" + "guest" + "nofail" + "uid=${toString config.users.users.aly.uid}" + "x-systemd.after=network.target" + "x-systemd.after=tailscaled.service" + "x-systemd.automount" + "x-systemd.device-timeout=5s" + "x-systemd.idle-timeout=60" + "x-systemd.mount-timeout=5s" + ]; + }; + + "/mnt/Media" = { + device = "//mauville/Media"; + fsType = "cifs"; + options = [ + "gid=100" + "guest" + "nofail" + "uid=${toString config.users.users.aly.uid}" + "x-systemd.after=network.target" + "x-systemd.after=tailscaled.service" + "x-systemd.automount" + "x-systemd.device-timeout=5s" + "x-systemd.idle-timeout=60" + "x-systemd.mount-timeout=5s" + ]; + }; + }; + + home-manager.sharedModules = [ + { + gtk.gtk3.bookmarks = lib.optionals (config.networking.hostName != "mauville") [ + "file:///mnt/Media" + "file:///mnt/Archive" + ]; + } + ]; + + nix.settings.trusted-users = ["aly"]; + + networking.networkmanager = { + enable = true; + + ensureProfiles = { + environmentFiles = [config.age.secrets.wifi.path]; + + profiles = let + mkOpenWiFi = ssid: { + connection = { + id = "${ssid}"; + type = "wifi"; + }; + + ipv4.method = "auto"; + + ipv6 = { + addr-gen-mode = "default"; + method = "auto"; + }; + + wifi = { + mode = "infrastructure"; + ssid = "${ssid}"; + }; + }; + + mkWPA2WiFi = ssid: psk: ( + (mkOpenWiFi ssid) + // { + wifi-security = { + auth-alg = "open"; + key-mgmt = "wpa-psk"; + psk = "${psk}"; + }; + } + ); + + mkEAPWiFi = ssid: identity: pass: auth: ( + (mkOpenWiFi ssid) + // { + "802-1x" = { + eap = "peap;"; + identity = "${identity}"; + password = "${pass}"; + phase2-auth = "${auth}"; + }; + + wifi-security = { + auth-alg = "open"; + key-mgmt = "wpa-eap"; + }; + } + ); + in { + "Dustin's A54" = mkWPA2WiFi "Dustin's A54" "$DustinsA54PSK"; + "FCS-WiFi2" = mkEAPWiFi "FCS-WiFi2" "$FCSIdentity" "$FCSPassword" "mschapv2"; + "javapatron" = mkOpenWiFi "javapatron"; + "Stargate-Discovery" = mkWPA2WiFi "Stargate-Discovery" "$StargateDiscoveryPSK"; + "Taproom Public WiFi" = mkOpenWiFi "Taproom Public WiFi"; + "wallace" = mkWPA2WiFi "wallace" "$wallacePSK"; + "WeWorkWiFi" = mkEAPWiFi "WeWorkWiFi" "$WeWorkWiFiIdentity" "$WeWorkWiFiPassword" "mschapv2"; + }; + }; + }; +} diff --git a/hosts/fallarbor/default.nix b/hosts/fallarbor/default.nix index 4c2e649f..1c858ccb 100644 --- a/hosts/fallarbor/default.nix +++ b/hosts/fallarbor/default.nix @@ -7,6 +7,7 @@ ... }: { imports = [ + ../common.nix ./disko.nix ./home.nix inputs.nixhw.nixosModules.framework-13-intel-11th @@ -26,11 +27,6 @@ steam.enable = true; }; - base = { - enable = true; - sambaAutoMount = false; - }; - desktop = { greetd.enable = true; hyprland.enable = true; diff --git a/hosts/lavaridge/default.nix b/hosts/lavaridge/default.nix index 29ddf71d..0ab91320 100644 --- a/hosts/lavaridge/default.nix +++ b/hosts/lavaridge/default.nix @@ -8,6 +8,7 @@ ... }: { imports = [ + ../common.nix ./disko.nix ./home.nix inputs.nixhw.nixosModules.framework-13-amd-7000 @@ -30,8 +31,6 @@ virt-manager.enable = true; }; - base.enable = true; - desktop = { greetd = { enable = true; diff --git a/hosts/mandarin/default.nix b/hosts/mandarin/default.nix index 227e3850..d604be5a 100644 --- a/hosts/mandarin/default.nix +++ b/hosts/mandarin/default.nix @@ -4,20 +4,29 @@ inputs, lib, pkgs, - self, ... }: { imports = [ + ../common.nix ./disko.nix - ./hardware.nix ./home.nix + inputs.nixhw.nixosModules.common-amd-cpu + inputs.nixhw.nixosModules.common-amd-gpu + inputs.nixhw.nixosModules.common-bluetooth + inputs.nixhw.nixosModules.common-ssd ]; - boot.loader = { - efi.canTouchEfiVariables = true; - systemd-boot.enable = true; + boot = { + initrd.availableKernelModules = ["nvme" "sd_mod" "usb_storage" "usbhid" "xhci_pci"]; + kernelPackages = pkgs.linuxPackages_latest; + + loader = { + efi.canTouchEfiVariables = true; + systemd-boot.enable = true; + }; }; + hardware.enableAllFirmware = true; networking.hostName = "mandarin"; services.ollama = { @@ -35,8 +44,6 @@ virt-manager.enable = true; }; - base.enable = true; - desktop = { greetd = { enable = true; diff --git a/hosts/mandarin/hardware.nix b/hosts/mandarin/hardware.nix deleted file mode 100644 index ad4ae339..00000000 --- a/hosts/mandarin/hardware.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ - config, - inputs, - lib, - pkgs, - ... -}: { - imports = [ - inputs.nixhw.nixosModules.common-amd-cpu - inputs.nixhw.nixosModules.common-amd-gpu - inputs.nixhw.nixosModules.common-bluetooth - inputs.nixhw.nixosModules.common-ssd - ]; - - boot = { - initrd.availableKernelModules = ["nvme" "sd_mod" "usb_storage" "usbhid" "xhci_pci"]; - - kernelPackages = pkgs.linuxPackages_latest; - }; - - hardware.enableAllFirmware = true; -} diff --git a/hosts/mauville/default.nix b/hosts/mauville/default.nix index a74ad237..275f6331 100644 --- a/hosts/mauville/default.nix +++ b/hosts/mauville/default.nix @@ -1,6 +1,7 @@ # Custom desktop with AMD Ryzen 5 2600, 16GB RAM, AMD Rx 6700, and 1TB SSD + 2TB HDD. { config, + inputs, lib, pkgs, ... @@ -10,9 +11,13 @@ mediaDirectory = "/mnt/Media"; in { imports = [ + ../common.nix ./filesystems.nix - ./hardware.nix ./home.nix + inputs.nixhw.nixosModules.common-amd-cpu + inputs.nixhw.nixosModules.common-amd-gpu + inputs.nixhw.nixosModules.common-bluetooth + inputs.nixhw.nixosModules.common-ssd ]; age.secrets = { @@ -39,11 +44,16 @@ in { }; }; - boot.loader = { - efi.canTouchEfiVariables = true; - systemd-boot.enable = true; + boot = { + initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "sd_mod"]; + + loader = { + efi.canTouchEfiVariables = true; + systemd-boot.enable = true; + }; }; + hardware.enableAllFirmware = true; networking.hostName = "mauville"; services = { @@ -94,8 +104,6 @@ in { virt-manager.enable = true; }; - base.enable = true; - desktop = { greetd = { enable = true; diff --git a/hosts/mauville/hardware.nix b/hosts/mauville/hardware.nix deleted file mode 100644 index 199bf566..00000000 --- a/hosts/mauville/hardware.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ - config, - inputs, - lib, - pkgs, - ... -}: { - imports = [ - inputs.nixhw.nixosModules.common-amd-cpu - inputs.nixhw.nixosModules.common-amd-gpu - inputs.nixhw.nixosModules.common-bluetooth - inputs.nixhw.nixosModules.common-ssd - ]; - - boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "sd_mod"]; - - hardware.enableAllFirmware = true; -} diff --git a/hosts/petalburg/default.nix b/hosts/petalburg/default.nix index 2140613f..6a12724b 100644 --- a/hosts/petalburg/default.nix +++ b/hosts/petalburg/default.nix @@ -4,10 +4,10 @@ inputs, lib, pkgs, - self, ... }: { imports = [ + ../common.nix ./disko.nix ./home.nix inputs.nixhw.nixosModules.lenovo-yoga-9i-intel-13th @@ -29,8 +29,6 @@ steam.enable = true; }; - base.enable = true; - desktop = { greetd = { enable = true; diff --git a/hosts/rustboro/default.nix b/hosts/rustboro/default.nix index c58842e8..c1444427 100644 --- a/hosts/rustboro/default.nix +++ b/hosts/rustboro/default.nix @@ -8,6 +8,7 @@ ... }: { imports = [ + ../common.nix ./disko.nix ./home.nix inputs.nixhw.nixosModules.thinkpad-t440p @@ -26,7 +27,6 @@ ar = { apps.firefox.enable = true; - base.enable = true; desktop = { greetd = { diff --git a/nixosModules/apps/virt-manager/default.nix b/nixosModules/apps/virt-manager/default.nix index f02b1318..8fe60ed0 100644 --- a/nixosModules/apps/virt-manager/default.nix +++ b/nixosModules/apps/virt-manager/default.nix @@ -1,12 +1,11 @@ { - pkgs, - lib, config, + lib, + pkgs, ... }: { config = lib.mkIf config.ar.apps.virt-manager.enable { programs.virt-manager.enable = true; - - virtualisation = {libvirtd.enable = true;}; + virtualisation.libvirtd.enable = true; }; } diff --git a/nixosModules/base/default.nix b/nixosModules/base/default.nix deleted file mode 100644 index 172b7cae..00000000 --- a/nixosModules/base/default.nix +++ /dev/null @@ -1,78 +0,0 @@ -{ - config, - inputs, - lib, - pkgs, - ... -}: { - imports = [ - ./networking - ./nix - ./nixpkgs - ]; - - config = lib.mkIf config.ar.base.enable { - - console.useXkbConfig = true; - - environment.systemPackages = with pkgs; [ - inputs.agenix.packages.${pkgs.system}.default - inxi - ]; - - i18n = { - defaultLocale = lib.mkDefault "en_US.UTF-8"; - extraLocaleSettings = { - LC_ADDRESS = config.i18n.defaultLocale; - LC_IDENTIFICATION = config.i18n.defaultLocale; - LC_MEASUREMENT = config.i18n.defaultLocale; - LC_MONETARY = config.i18n.defaultLocale; - LC_NAME = config.i18n.defaultLocale; - LC_NUMERIC = config.i18n.defaultLocale; - LC_PAPER = config.i18n.defaultLocale; - LC_TELEPHONE = config.i18n.defaultLocale; - LC_TIME = config.i18n.defaultLocale; - }; - }; - - hardware.keyboard.qmk.enable = true; - - programs.gnupg.agent = { - enable = true; - enableSSHSupport = true; - }; - - security = { - polkit.enable = true; - rtkit.enable = true; - }; - - services.logind.extraConfig = '' - # Don't shutdown when power button is short-pressed - HandlePowerKey=suspend - HandlePowerKeyLongPress=poweroff - ''; - - sound.enable = true; - - system.autoUpgrade = { - allowReboot = true; - dates = "04:00"; - randomizedDelaySec = "20min"; - enable = true; - flake = "github:alyraffauf/nixcfg"; - operation = "boot"; - rebootWindow = { - lower = "02:00"; - upper = "05:00"; - }; - }; - - time.timeZone = "America/New_York"; - - zramSwap = { - enable = lib.mkDefault true; - memoryPercent = lib.mkDefault 50; - }; - }; -} diff --git a/nixosModules/base/networking/default.nix b/nixosModules/base/networking/default.nix deleted file mode 100644 index a9aab2cc..00000000 --- a/nixosModules/base/networking/default.nix +++ /dev/null @@ -1,101 +0,0 @@ -{ - config, - inputs, - lib, - pkgs, - ... -}: { - imports = [./sambaAutoMount.nix]; - config = lib.mkIf config.ar.base.enable { - age.secrets.wifi.file = ../../../secrets/wifi.age; - - networking.networkmanager = { - enable = true; - - ensureProfiles = { - environmentFiles = [config.age.secrets.wifi.path]; - - profiles = let - mkOpenWiFi = ssid: { - connection = { - id = "${ssid}"; - type = "wifi"; - }; - - ipv4.method = "auto"; - - ipv6 = { - addr-gen-mode = "default"; - method = "auto"; - }; - - wifi = { - mode = "infrastructure"; - ssid = "${ssid}"; - }; - }; - - mkWPA2WiFi = ssid: psk: ( - (mkOpenWiFi ssid) - // { - wifi-security = { - auth-alg = "open"; - key-mgmt = "wpa-psk"; - psk = "${psk}"; - }; - } - ); - - mkEAPWiFi = ssid: identity: pass: auth: ( - (mkOpenWiFi ssid) - // { - "802-1x" = { - eap = "peap;"; - identity = "${identity}"; - password = "${pass}"; - phase2-auth = "${auth}"; - }; - - wifi-security = { - auth-alg = "open"; - key-mgmt = "wpa-eap"; - }; - } - ); - in { - "Dustin's A54" = mkWPA2WiFi "Dustin's A54" "$DustinsA54PSK"; - "FCS-WiFi2" = mkEAPWiFi "FCS-WiFi2" "$FCSIdentity" "$FCSPassword" "mschapv2"; - "javapatron" = mkOpenWiFi "javapatron"; - "Stargate-Discovery" = mkWPA2WiFi "Stargate-Discovery" "$StargateDiscoveryPSK"; - "Taproom Public WiFi" = mkOpenWiFi "Taproom Public WiFi"; - "wallace" = mkWPA2WiFi "wallace" "$wallacePSK"; - "WeWorkWiFi" = mkEAPWiFi "WeWorkWiFi" "$WeWorkWiFiIdentity" "$WeWorkWiFiPassword" "mschapv2"; - }; - }; - }; - - services = { - avahi = { - enable = true; - nssmdns4 = true; - openFirewall = true; - publish = { - enable = true; - addresses = true; - userServices = true; - workstation = true; - }; - }; - - openssh = { - enable = true; - openFirewall = true; - settings.PasswordAuthentication = false; - }; - - printing.enable = true; - - system-config-printer.enable = true; - }; - }; -} diff --git a/nixosModules/base/networking/sambaAutoMount.nix b/nixosModules/base/networking/sambaAutoMount.nix deleted file mode 100644 index b8fb5fd4..00000000 --- a/nixosModules/base/networking/sambaAutoMount.nix +++ /dev/null @@ -1,54 +0,0 @@ -{ - config, - inputs, - lib, - pkgs, - ... -}: { - config = lib.mkIf config.ar.base.sambaAutoMount { - fileSystems = { - "/mnt/Archive" = { - device = "//mauville/Archive"; - fsType = "cifs"; - options = [ - "gid=100" - "guest" - "nofail" - "uid=${toString config.users.users.aly.uid}" - "x-systemd.after=network.target" - "x-systemd.after=tailscaled.service" - "x-systemd.automount" - "x-systemd.device-timeout=5s" - "x-systemd.idle-timeout=60" - "x-systemd.mount-timeout=5s" - ]; - }; - - "/mnt/Media" = { - device = "//mauville/Media"; - fsType = "cifs"; - options = [ - "gid=100" - "guest" - "nofail" - "uid=${toString config.users.users.aly.uid}" - "x-systemd.after=network.target" - "x-systemd.after=tailscaled.service" - "x-systemd.automount" - "x-systemd.device-timeout=5s" - "x-systemd.idle-timeout=60" - "x-systemd.mount-timeout=5s" - ]; - }; - }; - - home-manager.sharedModules = [ - { - gtk.gtk3.bookmarks = [ - "file:///mnt/Media" - "file:///mnt/Archive" - ]; - } - ]; - }; -} diff --git a/nixosModules/base/nix/default.nix b/nixosModules/base/nix/default.nix deleted file mode 100644 index 48ca952f..00000000 --- a/nixosModules/base/nix/default.nix +++ /dev/null @@ -1,49 +0,0 @@ -{ - config, - inputs, - lib, - pkgs, - ... -}: { - config = lib.mkIf config.ar.base.enable { - environment.variables = { - FLAKE = "github:alyraffauf/nixcfg"; - }; - - programs.nh.enable = true; - - nix = { - gc = { - automatic = true; - dates = "daily"; - options = "--delete-older-than 3d"; - persistent = true; - randomizedDelaySec = "60min"; - }; - - # Run GC when there is less than 100MiB left. - extraOptions = '' - min-free = ${toString (100 * 1024 * 1024)} - max-free = ${toString (1024 * 1024 * 1024)} - ''; - - optimise.automatic = true; - - settings = { - auto-optimise-store = false; - experimental-features = ["nix-command" "flakes"]; - - substituters = [ - "https://hyprland.cachix.org" - "https://cache.nixos.org/" - ]; - - trusted-public-keys = [ - "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" - ]; - - trusted-users = ["aly"]; - }; - }; - }; -} diff --git a/nixosModules/base/nixpkgs/default.nix b/nixosModules/base/nixpkgs/default.nix deleted file mode 100644 index 1edf11ac..00000000 --- a/nixosModules/base/nixpkgs/default.nix +++ /dev/null @@ -1,48 +0,0 @@ -{ - config, - inputs, - lib, - pkgs, - ... -}: { - config = lib.mkIf config.ar.base.enable { - nixpkgs = let - unstable = import inputs.nixpkgsUnstable { - system = pkgs.system; - config.allowUnfree = true; # Allow unfree packages - }; - in { - config.allowUnfree = true; # Allow unfree packages - - # Overlays over default packages. - overlays = [ - inputs.nur.overlay - (final: prev: { - alyraffauf-wallpapers = inputs.wallpapers.packages.${pkgs.system}.default; - brave = prev.brave.override {commandLineArgs = "--gtk-version=4 --enable-wayland-ime";}; - google-chrome = prev.google-chrome.override {commandLineArgs = "--gtk-version=4 --enable-wayland-ime";}; - hyprland = inputs.hyprland.packages.${pkgs.system}.hyprland; - nerdfonts = prev.nerdfonts.override {fonts = ["Noto"];}; - - obsidian = prev.obsidian.overrideAttrs (old: { - installPhase = - builtins.replaceStrings ["--ozone-platform=wayland"] - ["--ozone-platform=wayland --enable-wayland-ime"] - old.installPhase; - }); - - vscodium = prev.vscodium.override {commandLineArgs = "--enable-wayland-ime";}; - - webcord = prev.webcord.overrideAttrs (old: { - installPhase = - builtins.replaceStrings ["--ozone-platform-hint=auto"] - ["--ozone-platform-hint=auto --enable-wayland-ime"] - old.installPhase; - }); - - xdg-desktop-portal-hyprland = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland; - }) - ]; - }; - }; -} diff --git a/nixosModules/default.nix b/nixosModules/default.nix index 4829d8b5..5fe465a8 100644 --- a/nixosModules/default.nix +++ b/nixosModules/default.nix @@ -6,7 +6,6 @@ inputs: { }: { imports = [ ./apps - ./base ./desktop ./options.nix ./services diff --git a/nixosModules/desktop/hyprland/default.nix b/nixosModules/desktop/hyprland/default.nix index 11a22efe..dd21f367 100644 --- a/nixosModules/desktop/hyprland/default.nix +++ b/nixosModules/desktop/hyprland/default.nix @@ -5,6 +5,19 @@ ... }: { config = lib.mkIf config.ar.desktop.hyprland.enable { + nix.settings = { + auto-optimise-store = false; + + substituters = [ + "https://hyprland.cachix.org" + "https://cache.nixos.org/" + ]; + + trusted-public-keys = [ + "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" + ]; + }; + programs = { hyprland = { enable = true; diff --git a/nixosModules/options.nix b/nixosModules/options.nix index 3392c41c..35aff3a3 100644 --- a/nixosModules/options.nix +++ b/nixosModules/options.nix @@ -75,18 +75,5 @@ tailscale.enable = lib.mkEnableOption "Tailscale WireGuard VPN."; }; - - base = { - enable = - lib.mkEnableOption "Basic system configuration and sane defaults."; - - sambaAutoMount = lib.mkOption { - description = "Automounting of mauville Samba Shares."; - default = - config.ar.services.tailscale.enable - && !(config.networking.hostName == "mauville"); - type = lib.types.bool; - }; - }; }; }