diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-11-23 10:29:58 +0100 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-11-23 10:29:58 +0100 |
commit | 9be782798f5a853d28d3822716c8b74d518338c2 (patch) | |
tree | 5dfcfa9ef7b885bfda136bcb2c7388d3c46d4890 /flake | |
parent | tests({tests,modules}): Couple via a co-import (diff) | |
download | nixos-config-9be782798f5a853d28d3822716c8b74d518338c2.tar.gz nixos-config-9be782798f5a853d28d3822716c8b74d518338c2.zip |
tests(flake): Hook up to the flake's check and package attributes
Diffstat (limited to 'flake')
-rw-r--r-- | flake/default.nix | 36 | ||||
-rw-r--r-- | flake/packages/default.nix | 3 |
2 files changed, 28 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; diff --git a/flake/packages/default.nix b/flake/packages/default.nix index 5b07b6f3..a8fc2d64 100644 --- a/flake/packages/default.nix +++ b/flake/packages/default.nix @@ -13,6 +13,8 @@ inherit (pkgs) lib; output = import ../../bootstrap {inherit pkgs sysLib;}; + run_test_description = pkgs.callPackage ../../tests/infrastructure/run.nix {}; + nvim = builtins.mapAttrs ( name: value: let @@ -88,6 +90,7 @@ in # format = "iso"; # }; nvim = nvim.tiamat; + inherit run_test_description; } // output // output_neovim |