From 198a36f3d47004492270d2a2551e66b0f5c0d060 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 6 May 2024 16:43:05 +0300 Subject: [PATCH] flake/tests: add missing imports --- flake.lock | 21 +++++++++++++++++++++ flake.nix | 6 ++++++ flake/tests/checks/homeManagerModule.nix | 15 +++++++++------ flake/tests/checks/nixosModule.nix | 6 ++++-- flake/tests/default.nix | 5 ++++- flake/tests/profiles/minimal.nix | 4 ---- 6 files changed, 44 insertions(+), 13 deletions(-) diff --git a/flake.lock b/flake.lock index f590525..d0ab7e3 100644 --- a/flake.lock +++ b/flake.lock @@ -84,6 +84,26 @@ "type": "github" } }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1714981474, + "narHash": "sha256-b3/U21CJjCjJKmA9WqUbZGZgCvospO3ArOUTgJugkOY=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "6ebe7be2e67be7b9b54d61ce5704f6fb466c536f", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, "naersk": { "inputs": { "nixpkgs": [ @@ -1804,6 +1824,7 @@ "inputs": { "flake-parts": "flake-parts", "flake-utils": "flake-utils", + "home-manager": "home-manager", "nil": "nil", "nixpkgs": "nixpkgs", "nmd": "nmd", diff --git a/flake.nix b/flake.nix index a0281a3..a0e2989 100644 --- a/flake.nix +++ b/flake.nix @@ -89,6 +89,12 @@ flake = false; }; + # Primarily used for testing nvf. + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + # TODO: get zig from the zig overlay instead of nixpkgs zig.url = "github:mitchellh/zig-overlay"; diff --git a/flake/tests/checks/homeManagerModule.nix b/flake/tests/checks/homeManagerModule.nix index 55a08b5..f6a29f9 100644 --- a/flake/tests/checks/homeManagerModule.nix +++ b/flake/tests/checks/homeManagerModule.nix @@ -13,13 +13,16 @@ nixosTest { ../profiles/minimal.nix ]; - home-manager = { - sharedModules = [ - homeManagerModules.nvf - ]; + config = { + home-manager = { + sharedModules = [ + homeManagerModules.nvf + ]; - users.test = { - programs.nvf.enable = true; + users.test = { + home.stateVersion = "24.05"; + programs.nvf.enable = true; + }; }; }; }; diff --git a/flake/tests/checks/nixosModule.nix b/flake/tests/checks/nixosModule.nix index 437d70c..961c991 100644 --- a/flake/tests/checks/nixosModule.nix +++ b/flake/tests/checks/nixosModule.nix @@ -4,7 +4,7 @@ ... }: nixosTest { - name = "home-manager-test"; + name = "nixos-test"; nodes.machine = { imports = [ @@ -12,7 +12,9 @@ nixosTest { ../profiles/minimal.nix ]; - programs.nvf.enable = true; + config = { + programs.nvf.enable = true; + }; }; testScript = ""; diff --git a/flake/tests/default.nix b/flake/tests/default.nix index 9fd8ca1..4db2ffa 100644 --- a/flake/tests/default.nix +++ b/flake/tests/default.nix @@ -26,6 +26,9 @@ }; # expose checks as packages to be built - packages.test = self'.checks.home-manager-test.driverInteractive; + packages = { + test-home-manager-module = self'.checks.homeManagerModule.driverInteractive; + test-nixos-module = self'.checks.nixosModule.driverInteractive; + }; }; } diff --git a/flake/tests/profiles/minimal.nix b/flake/tests/profiles/minimal.nix index 357cafb..a26e844 100644 --- a/flake/tests/profiles/minimal.nix +++ b/flake/tests/profiles/minimal.nix @@ -10,8 +10,4 @@ isNormalUser = true; password = ""; }; - - home-manager.sharedModules = [ - {home.stateVersion = "24.05";} - ]; }