summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorsils <sils@sils.li>2023-11-23 20:29:05 +0100
committersils <sils@sils.li>2023-11-23 20:29:53 +0100
commita492b1f46197cbe5352f807a3e414b800a06213a (patch)
tree9355ca91d34f8516c760e01ba47e7d35b5a21845
parentfeat(treewide): make configured neovim available as package (diff)
downloadnix-config-a492b1f46197cbe5352f807a3e414b800a06213a.tar.gz
nix-config-a492b1f46197cbe5352f807a3e414b800a06213a.zip
feat(flake): refactor and add checks output
Diffstat (limited to '')
-rw-r--r--flake.nix89
-rw-r--r--flake/nixosConfigurations/default.nix53
2 files changed, 94 insertions, 48 deletions
diff --git a/flake.nix b/flake.nix
index 5236972..21f7cfc 100644
--- a/flake.nix
+++ b/flake.nix
@@ -143,53 +143,16 @@
     agenix,
     ragenix,
     ...
-  } @ attrs: let
-    utils = flake-utils.lib;
-    system = "x86_64-linux";
-    pkgs = import nixpkgs {
-      inherit system;
-      overlays = [nixvim.overlays.default];
-    };
-    sysLib = shell_library.lib.${system};
-    nixVimConfig = import ./users/sils/nixvim/config.nix;
-    defaultModules = [
-      impermanence.nixosModules.impermanence
-      lanzaboote.nixosModules.lanzaboote
-      home-manager.nixosModules.home-manager
-      sops-nix.nixosModules.sops
-      agenix.nixosModules.default
-      {
-        home-manager = {
-          useGlobalPkgs = true;
-          useUserPackages = true;
-          users.sils = import ./users/sils;
-          extraSpecialArgs = attrs;
-        };
-      }
-    ];
-  in
-    {
-      nixosConfigurations = {
-        thinklappi = nixpkgs.lib.nixosSystem {
-          inherit system;
-          specialArgs = attrs;
-          modules =
-            [
-              ./hosts/thinklappi
-            ]
-            ++ defaultModules;
-        };
-        thinklappi-bootstrap = nixpkgs.lib.nixosSystem {
-          inherit system;
-          specialArgs = attrs;
-          modules = [
-            ./hosts/thinklappi-bootstrap
-            lanzaboote.nixosModules.lanzaboote
-          ];
-        };
+  } @ attrs:
+    flake-utils.lib.eachDefaultSystem (system: let
+      pkgs = import nixpkgs {
+        inherit system;
+        overlays = [nixvim.overlays.default];
       };
-    }
-    // utils.eachDefaultSystem (system: {
+      sysLib = shell_library.lib.${system};
+      nixVimConfig = import ./users/sils/nixvim/config.nix;
+      nvim = nixvim.legacyPackages."${system}".makeNixvim nixVimConfig;
+    in {
       devShells.default = pkgs.mkShell {
         packages = with pkgs; [
           nil
@@ -203,7 +166,37 @@
       formatter = pkgs.alejandra;
 
       packages = {
-        nvim = nixvim.legacyPackages."${system}".makeNixvim nixVimConfig;
+        inherit nvim;
       };
-    });
+      checks = {
+        nvim = nixvim.lib.${system}.check.mkTestDerivationFromNvim {
+          inherit nvim;
+          name = "My NixVim Configuration";
+        };
+      };
+    })
+    // {
+      nixosConfigurations = import ./flake/nixosConfigurations {
+        inherit
+          self
+          nixpkgs
+          home-manager
+          shell_library
+          river_init_lesser
+          yambar_cpu
+          yambar_memory
+          #grades,
+          
+          prismlauncher
+          lanzaboote
+          nixvim
+          impermanence
+          wl-togglescreens
+          sops-nix
+          flake-utils
+          agenix
+          ragenix
+          ;
+      };
+    };
 }
diff --git a/flake/nixosConfigurations/default.nix b/flake/nixosConfigurations/default.nix
new file mode 100644
index 0000000..6814665
--- /dev/null
+++ b/flake/nixosConfigurations/default.nix
@@ -0,0 +1,53 @@
+{
+  self,
+  nixpkgs,
+  home-manager,
+  shell_library,
+  river_init_lesser,
+  yambar_cpu,
+  yambar_memory,
+  #grades,
+  prismlauncher,
+  lanzaboote,
+  nixvim,
+  impermanence,
+  wl-togglescreens,
+  sops-nix,
+  flake-utils,
+  agenix,
+  ragenix,
+} @ attrs: let
+  defaultModules = [
+    impermanence.nixosModules.impermanence
+    lanzaboote.nixosModules.lanzaboote
+    home-manager.nixosModules.home-manager
+    sops-nix.nixosModules.sops
+    agenix.nixosModules.default
+    {
+      home-manager = {
+        useGlobalPkgs = true;
+        useUserPackages = true;
+        users.sils = import ../../users/sils;
+        extraSpecialArgs = attrs;
+      };
+    }
+  ];
+in {
+  thinklappi = nixpkgs.lib.nixosSystem {
+    system = "x86_64-linux";
+    specialArgs = attrs;
+    modules =
+      [
+        ../../hosts/thinklappi
+      ]
+      ++ defaultModules;
+  };
+  thinklappi-bootstrap = nixpkgs.lib.nixosSystem {
+    system = "x86_64-linux";
+    specialArgs = attrs;
+    modules = [
+      ../../hosts/thinklappi-bootstrap
+      lanzaboote.nixosModules.lanzaboote
+    ];
+  };
+}