diff --git a/flake-modules/tests.nix b/flake-modules/tests.nix index 1069efd1..6827cd63 100644 --- a/flake-modules/tests.nix +++ b/flake-modules/tests.nix @@ -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; }; }; } diff --git a/flake.lock b/flake.lock index f1bb2e71..2d72850d 100644 --- a/flake.lock +++ b/flake.lock @@ -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" } diff --git a/flake.nix b/flake.nix index 4cd4cafa..94d00112 100644 --- a/flake.nix +++ b/flake.nix @@ -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"; diff --git a/tests/modules/darwin.nix b/tests/modules/darwin.nix new file mode 100644 index 00000000..ddbd40d1 --- /dev/null +++ b/tests/modules/darwin.nix @@ -0,0 +1,17 @@ +{ + nixvim, + system, + nix-darwin, +}: +nix-darwin.lib.darwinSystem { + modules = [ + { + nixpkgs.hostPlatform = system; + + programs.nixvim = { + enable = true; + }; + } + nixvim.nixDarwinModules.nixvim + ]; +}