Skip to content

Commit

Permalink
tests: Add a test for nix-darwin modules (nix-community#909)
Browse files Browse the repository at this point in the history
  • Loading branch information
traxys authored Jan 6, 2024
1 parent 245930d commit 2167c19
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 0 deletions.
9 changes: 9 additions & 0 deletions flake-modules/tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@
.system
.build
.toplevel;
}
// pkgs.lib.optionalAttrs pkgs.stdenv.isDarwin {
darwin-module =
(import ../tests/modules/darwin.nix {
inherit system;
inherit (inputs) nix-darwin;
nixvim = self;
})
.system;
};
};
}
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 @@ -7,6 +7,10 @@
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-darwin = {
url = "github:lnl7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};

flake-parts = {
url = "github:hercules-ci/flake-parts";
Expand Down
17 changes: 17 additions & 0 deletions tests/modules/darwin.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
nixvim,
system,
nix-darwin,
}:
nix-darwin.lib.darwinSystem {
modules = [
{
nixpkgs.hostPlatform = system;

programs.nixvim = {
enable = true;
};
}
nixvim.nixDarwinModules.nixvim
];
}

0 comments on commit 2167c19

Please sign in to comment.