From aaede7032368dc0305a9685bea70738ceb24a5f8 Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Sat, 10 Aug 2024 16:18:37 -0500 Subject: [PATCH] abstractions ftw --- lib/generators.nix | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/lib/generators.nix b/lib/generators.nix index f22cef0..259348a 100644 --- a/lib/generators.nix +++ b/lib/generators.nix @@ -21,9 +21,10 @@ let hostPath = host: ../. + "/hosts/${host}"; # all nix files not including pkgs.nix # hostFiles = host: filter isNixFile (listFilesRecursive (hostPath host)); - hostFiles = host: host |> hostPath |> listFilesRecursive |> filter isNixFile; + commonSpecialArgs = {inherit self inputs lib enabled;}; + mkIso = nixosSystem { system = "x86_64-linux"; modules = [ @@ -32,14 +33,7 @@ let self.nixosModules.essentials self.nixosModules.iso ]; - specialArgs = { - inherit - inputs - lib - self - enabled - ; - }; + specialArgs = commonSpecialArgs; }; mkSystem = @@ -53,14 +47,10 @@ let inputs.hyprland.nixosModules.default ] ++ (hostFiles hostName); - specialArgs = { + specialArgs = commonSpecialArgs // { inherit - inputs - lib - self mkDefaultOizysModule mkOizysModule - enabled enableAttrs hostName flake