summary refs log tree commit diff stats
path: root/flake
diff options
context:
space:
mode:
authorSilas Schöffel <sils@sils.li>2024-05-18 09:34:21 +0200
committerSilas Schöffel <sils@sils.li>2024-05-18 09:34:21 +0200
commitf5133421aa24e653bd1f87ce69b60a36e3cdd742 (patch)
treed1d3c389591877dfea9d52e71661e728d7aa5e16 /flake
parentflake: switch to flake-parts (diff)
downloadnix-config-f5133421aa24e653bd1f87ce69b60a36e3cdd742.tar.gz
nix-config-f5133421aa24e653bd1f87ce69b60a36e3cdd742.zip
flake: factor outputs in separate file
Diffstat (limited to '')
-rw-r--r--flake.nix71
-rw-r--r--flake/default.nix54
-rw-r--r--flake/nixosConfigurations/default.nix9
3 files changed, 56 insertions, 78 deletions
diff --git a/flake.nix b/flake.nix
index 62c2b67..ffc240b 100644
--- a/flake.nix
+++ b/flake.nix
@@ -189,75 +189,6 @@
   } @ inputs:
     flake-parts.lib.mkFlake {inherit inputs;} {
       systems = import systems;
-      perSystem = {
-        config,
-        system,
-        ...
-      }: let
-        pkgs = import nixpkgs {
-          inherit system;
-          overlays = [nixvim.overlays.default];
-        };
-        nixVimConfig =
-          (import ./hm/nixvim/config.nix pkgs)
-          // {
-            colorschemes.gruvbox.enable = true;
-            plugins.airline.settings.theme = "minimalist";
-          };
-        nvim = nixvim.legacyPackages."${system}".makeNixvim nixVimConfig;
-        hooks = self.checks.${system}.pre-commit;
-      in {
-        devShells.default = pkgs.mkShell {
-          inherit (hooks) shellHook;
-          buildInputs = hooks.enabledPackages;
-          packages = with pkgs; [
-            nil
-            statix
-            alejandra
-            sops
-            ragenix.packages."${system}".default
-          ];
-        };
-
-        formatter = pkgs.alejandra;
-
-        packages = {
-          inherit nvim;
-          default = nvim;
-        };
-        checks = {
-          nvim = nixvim.lib.${system}.check.mkTestDerivationFromNvim {
-            inherit nvim;
-            name = "My NixVim Configuration";
-          };
-          pre-commit = git-hooks.lib.${system}.run {
-            src = ./.;
-            hooks = {
-              alejandra.enable = true;
-            };
-          };
-        };
-      };
-      flake = {
-        nixosConfigurations = import ./flake/nixosConfigurations {
-          inherit
-            self
-            base16-tokyo-night-scheme
-            nixpkgs
-            nixpkgs-pinned
-            home-manager
-            prismlauncher
-            lanzaboote
-            nixvim
-            impermanence
-            wl-togglescreens
-            stylix
-            sops-nix
-            agenix
-            ragenix
-            arkenfox-user-js
-            ;
-        };
-      };
+      imports = [./flake];
     };
 }
diff --git a/flake/default.nix b/flake/default.nix
new file mode 100644
index 0000000..443999e
--- /dev/null
+++ b/flake/default.nix
@@ -0,0 +1,54 @@
+{inputs, ...}: {
+  perSystem = {
+    config,
+    system,
+    ...
+  }: let
+    pkgs = import inputs.nixpkgs {
+      inherit system;
+      overlays = [inputs.nixvim.overlays.default];
+    };
+    nixVimConfig =
+      (import ../hm/nixvim/config.nix pkgs)
+      // {
+        colorschemes.gruvbox.enable = true;
+        plugins.airline.settings.theme = "minimalist";
+      };
+    nvim = inputs.nixvim.legacyPackages."${system}".makeNixvim nixVimConfig;
+    hooks = inputs.self.checks.${system}.pre-commit;
+  in {
+    devShells.default = pkgs.mkShell {
+      inherit (hooks) shellHook;
+      buildInputs = hooks.enabledPackages;
+      packages = with pkgs; [
+        nil
+        statix
+        alejandra
+        sops
+        inputs.ragenix.packages."${system}".default
+      ];
+    };
+
+    formatter = pkgs.alejandra;
+
+    packages = {
+      inherit nvim;
+      default = nvim;
+    };
+    checks = {
+      nvim = inputs.nixvim.lib.${system}.check.mkTestDerivationFromNvim {
+        inherit nvim;
+        name = "My NixVim Configuration";
+      };
+      pre-commit = inputs.git-hooks.lib.${system}.run {
+        src = ./.;
+        hooks = {
+          alejandra.enable = true;
+        };
+      };
+    };
+  };
+  flake = {
+    nixosConfigurations = import ./nixosConfigurations inputs;
+  };
+}
diff --git a/flake/nixosConfigurations/default.nix b/flake/nixosConfigurations/default.nix
index 3d97e63..ca3c035 100644
--- a/flake/nixosConfigurations/default.nix
+++ b/flake/nixosConfigurations/default.nix
@@ -1,19 +1,12 @@
 {
-  self,
-  base16-tokyo-night-scheme,
   nixpkgs,
-  nixpkgs-pinned,
   home-manager,
-  prismlauncher,
   lanzaboote,
-  nixvim,
   impermanence,
-  wl-togglescreens,
   stylix,
   sops-nix,
   agenix,
-  ragenix,
-  arkenfox-user-js,
+  ...
 } @ attrs: let
   defaultModules = [
     impermanence.nixosModules.impermanence