tests: Add a test for nix-darwin modules (#909)

This commit is contained in:
traxys 2024-01-06 18:03:44 +01:00 committed by GitHub
parent 245930d735
commit 2167c1930c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 51 additions and 0 deletions

View file

@ -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
flake.lock generated
View file

@ -95,6 +95,26 @@
"type": "github"
}
},
"nix-darwin": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1704277720,
"narHash": "sha256-meAKNgmh3goankLGWqqpw73pm9IvXjEENJloF0coskE=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "0dd382b70c351f528561f71a0a7df82c9d2be9a4",
"type": "github"
},
"original": {
"owner": "lnl7",
"repo": "nix-darwin",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1704194953,
@ -141,6 +161,7 @@
"inputs": {
"flake-parts": "flake-parts",
"home-manager": "home-manager",
"nix-darwin": "nix-darwin",
"nixpkgs": "nixpkgs",
"pre-commit-hooks": "pre-commit-hooks"
}

View file

@ -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";

17
tests/modules/darwin.nix Normal file
View file

@ -0,0 +1,17 @@
{
nixvim,
system,
nix-darwin,
}:
nix-darwin.lib.darwinSystem {
modules = [
{
nixpkgs.hostPlatform = system;
programs.nixvim = {
enable = true;
};
}
nixvim.nixDarwinModules.nixvim
];
}