Skip to content

Commit

Permalink
tests: Add a test for the home-manager module (#901)
Browse files Browse the repository at this point in the history
  • Loading branch information
traxys authored Jan 6, 2024
1 parent 5574515 commit 96cdbc8
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 0 deletions.
12 changes: 12 additions & 0 deletions flake-modules/tests.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
inputs,
self,
...
}: {
perSystem = {
pkgs,
config,
Expand Down Expand Up @@ -27,6 +31,14 @@
inherit pkgs;
inherit (pkgs) lib;
};

home-manager =
(import ../tests/modules/hm.nix {
inherit pkgs;
inherit (inputs) home-manager;
nixvim = self;
})
.activationPackage;
};
};
}
21 changes: 21 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};

flake-parts = {
url = "github:hercules-ci/flake-parts";
Expand Down
2 changes: 2 additions & 0 deletions statix.toml
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
ignore = ["plugins/lsp/language-servers/rust-analyzer-config.nix"]
# Frequent in nix module configurations
disabled = ["repeated_keys"]
24 changes: 24 additions & 0 deletions tests/modules/hm.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
nixvim,
pkgs,
home-manager,
}:
home-manager.lib.homeManagerConfiguration {
inherit pkgs;

modules = [
{
home.username = "nixvim";
home.homeDirectory = "/invalid/dir";

home.stateVersion = "23.05";

programs.nixvim = {
enable = true;
};

programs.home-manager.enable = true;
}
nixvim.homeManagerModules.nixvim
];
}

0 comments on commit 96cdbc8

Please sign in to comment.