diff --git a/devices/tunyon/default.nix b/devices/tunyon/default.nix index efef41c..23ee138 100644 --- a/devices/tunyon/default.nix +++ b/devices/tunyon/default.nix @@ -1,4 +1,6 @@ -{ lib, config, pkgs, ... }: { +{ lib, config, pkgs, ... }: let + inherit (lib) mkDefault; +in { imports = [ ./disks.nix ./options.nix @@ -16,39 +18,16 @@ initrd = { availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" ]; luks.devices.root.device = "/dev/disk/by-uuid/${config.disks.crypt}"; - postDeviceCommands = lib.mkAfter '' - mkdir /btrfs_tmp - mount /dev/disk/by-uuid/${config.disks.root} /btrfs_tmp - if [[ -e /btrfs_tmp/root ]]; then - mkdir -p /btrfs_tmp/old_roots - timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S") - mv /btrfs_tmp/root "/btrfs_tmp/old_roots/$timestamp" - fi - - delete_subvolume_recursively() { - IFS=$'\n' - for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do - delete_subvolume_recursively "/btrfs_tmp/$i" - done - btrfs subvolume delete "$1" - } - - for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +30); do - delete_subvolume_recursively "$i" - done - - btrfs subvolume create /btrfs_tmp/root - umount /btrfs_tmp - ''; }; - kernelModules = [ "kvm-amd" ]; kernelPackages = pkgs.linuxPackages_zen; loader = { systemd-boot = { - enable = true; + enable = mkDefault true; + editor = false; }; + timeout = 1; efi.canTouchEfiVariables = true; }; }; @@ -84,7 +63,6 @@ swapDevices = [ { device = "/swap/swapfile"; } ]; services = { - upower.enable = true; fwupd.enable = true; power-profiles-daemon.enable = true; }; diff --git a/modules/default.nix b/modules/default.nix index b6b2316..70c746a 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,4 +1,7 @@ -{ inputs, pkgs, lib, config, ... }: { +{ inputs, pkgs, lib, config, ... }: +let + inherit (lib) mkDefault; +in { imports = [ ./containers ./games @@ -32,7 +35,7 @@ documentation.nixos.enable = false; networking = { - useDHCP = lib.mkDefault true; + useDHCP = mkDefault true; wireless.iwd.enable = true; extraHosts = '' @@ -62,9 +65,11 @@ }; }; - services.xserver = { - enable = true; - displayManager.gdm.enable = true; + services = { + xserver = { + enable = true; + displayManager.gdm.enable = true; + }; }; users.users.${config.username}= { diff --git a/modules/games/default.nix b/modules/games/default.nix index aaa4b39..6ed89fb 100644 --- a/modules/games/default.nix +++ b/modules/games/default.nix @@ -2,7 +2,7 @@ inherit (lib) mkIf mkMerge; in mkIf config.withGames (mkMerge [ (mkIf config.withImpermanence { - users.${config.username}= { + environment.persistence."/persist".users.${config.username}= { directories = [ "Games" ".steam" diff --git a/modules/niri/default.nix b/modules/niri/default.nix index a32f131..40ba86d 100644 --- a/modules/niri/default.nix +++ b/modules/niri/default.nix @@ -44,12 +44,6 @@ borderRadius = 8; icons = false; }; - - programs.swaylock = { - enable = true; - package = pkgs.swaylock-effects; - settings = import ./swaylock.conf.nix { lib = lib; config = config; }; - }; }; }; } diff --git a/modules/niri/niri.conf.nix b/modules/niri/niri.conf.nix index 2bb5a26..a540b69 100644 --- a/modules/niri/niri.conf.nix +++ b/modules/niri/niri.conf.nix @@ -146,7 +146,6 @@ "Mod+Shift+Ctrl+S".action.screenshot-window = []; "Print".action.screenshot-screen = []; - "Mod+Shift+L".action.spawn = "swaylock"; "Mod+Shift+Q".action.quit = []; }; } diff --git a/modules/niri/swaylock.conf.nix b/modules/niri/swaylock.conf.nix deleted file mode 100644 index 7d2ed94..0000000 --- a/modules/niri/swaylock.conf.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ lib, config, ... }: { - ignore-empty-password = true; - screenshots = true; - clock = true; - submit-on-touch = true; - indicator = true; - indicator-caps-lock = true; - indicator-radius = 100; - indicator-thickness = 4; - inside-color = lib.strings.concatStrings [ config.theme.overlay "aa" ]; - inside-clear-color = lib.strings.concatStrings [ config.theme.subtle "aa" ]; - inside-caps-lock-color = lib.strings.concatStrings [ config.theme.rose "aa" ]; - inside-ver-color = lib.strings.concatStrings [ config.theme.foam "aa" ]; - inside-wrong-color = lib.strings.concatStrings [ config.theme.love "aa" ]; - line-uses-inside = true; - ring-color = config.theme.surface; - ring-clear-color = config.theme.muted; - ring-caps-lock-color = config.theme.gold; - ring-ver-color = config.theme.pine; - ring-wrong-color = config.theme.love; - seperator-color = config.theme.base; - key-hl-color = config.theme.iris; - bs-hl-color = config.theme.love; - caps-lock-key-hl-color = config.theme.iris; - caps-lock-bs-hl-color = config.theme.love; - text-color = config.theme.text; - text-clear-color = config.theme.text; - text-caps-lock-color = config.theme.text; - text-ver-color = config.theme.text; - text-wrong-color = config.theme.text; - effect-blur = "30x10"; -} diff --git a/outputs.nix b/outputs.nix index 44eedac..f1efeb4 100644 --- a/outputs.nix +++ b/outputs.nix @@ -1,4 +1,14 @@ -{ nixpkgs, lix, home-manager, niri, impermanence, ... }@inputs: { +{ nixpkgs, lix, home-manager, niri, impermanence, ... }@inputs: let + modules = [ + ./modules + ./options.nix + ./colors.nix + niri.nixosModules.niri + home-manager.nixosModules.home-manager + lix.nixosModules.default + impermanence.nixosModules.impermanence + ]; +in { nixosConfigurations = { # AMD Ryzen 5600X # Nvidia GeForce GTX 1060 (6GB) @@ -10,13 +20,7 @@ }; modules = [ ./devices/ellaca - ./modules - ./options.nix - ./colors.nix - niri.nixosModules.niri - home-manager.nixosModules.home-manager - lix.nixosModules.default - ]; + ] ++ modules; }; # Zotac ZBOX-CI327NANO @@ -30,13 +34,7 @@ }; modules = [ ./devices/pleniscenta - ./modules - ./options.nix - ./colors.nix - niri.nixosModules.niri - home-manager.nixosModules.home-manager - lix.nixosModules.default - ]; + ] ++ modules; }; # Lenovo Thinkpad T540p @@ -49,13 +47,7 @@ }; modules = [ ./devices/inkvine - ./modules - ./options.nix - ./colors.nix - niri.nixosModules.niri - home-manager.nixosModules.home-manager - lix.nixosModules.default - ]; + ] ++ modules; }; # Framework Laptop 13 @@ -69,14 +61,7 @@ }; modules = [ ./devices/tunyon - ./modules - ./options.nix - ./colors.nix - niri.nixosModules.niri - home-manager.nixosModules.home-manager - lix.nixosModules.default - impermanence.nixosModules.impermanence - ]; + ] ++ modules; }; }; }