about summary refs log tree commit diff stats
path: root/flake/default.nix
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-11-23 10:29:58 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-11-23 10:29:58 +0100
commit9be782798f5a853d28d3822716c8b74d518338c2 (patch)
tree5dfcfa9ef7b885bfda136bcb2c7388d3c46d4890 /flake/default.nix
parenttests({tests,modules}): Couple via a co-import (diff)
downloadnixos-config-9be782798f5a853d28d3822716c8b74d518338c2.tar.gz
nixos-config-9be782798f5a853d28d3822716c8b74d518338c2.zip
tests(flake): Hook up to the flake's check and package attributes
Diffstat (limited to 'flake/default.nix')
-rw-r--r--flake/default.nix36
1 files changed, 25 insertions, 11 deletions
diff --git a/flake/default.nix b/flake/default.nix
index f158478b..222b18ac 100644
--- a/flake/default.nix
+++ b/flake/default.nix
@@ -3,6 +3,7 @@
   self,
   pkgs,
   pkgsStable,
+  nixLib,
   myPkgs,
   system,
   sysLib,
@@ -38,12 +39,10 @@
       nixpkgs_as_input
       nixpkgs_open_prs
       # my things
-      
       shell_library
       sysLib
       templates
       # modules
-      
       home-manager
       nixVim
       nixos-generators
@@ -55,22 +54,37 @@
       lanzaboote
       nix-index-database
       # bins
-      
       river_init_lesser
       # external
-      
       user_js
       ;
   };
+
+  tests = import ../tests {
+    inherit pkgs nixpkgs_as_input myPkgs;
+    inherit (pkgs) lib;
+    extraModules = {
+      termfilechooser = "${nixpkgs_open_prs.nixpkgs-tfc}/nixos/modules/config/xdg/portals/termfilechooser.nix";
+
+      agenix = agenix.nixosModules.default;
+      disko = disko.nixosModules.default;
+      serverphone = serverphone.nixosModules.default;
+      inherit (home-manager.nixosModules) home-manager;
+      inherit (impermanence.nixosModules) impermanence;
+      inherit (lanzaboote.nixosModules) lanzaboote;
+    };
+  };
 in {
   inherit nixosConfigurations;
-  checks."${system}" = {
-    inherit
-      (self.packages."${system}")
-      nvim
-      ;
-    formatting = treefmtEval.config.build.check self;
-  };
+  checks."${system}" =
+    nixLib.maybeMerge {
+      inherit
+        (self.packages."${system}")
+        nvim
+        ;
+      formatting = treefmtEval.config.build.check self;
+    }
+    tests "flake checks";
 
   # legacyPackages."${system}" = pkgs;