diff --git a/flake/dev/devshell.nix b/flake/dev/devshell.nix index a56669f07a..e7158a9501 100644 --- a/flake/dev/devshell.nix +++ b/flake/dev/devshell.nix @@ -1,7 +1,7 @@ { lib, inputs, ... }: { imports = [ - inputs.devshell.flakeModule + (inputs.devshell + "/flake-module.nix") ]; perSystem = diff --git a/flake/dev/flake.lock b/flake/dev/flake.lock index 9345631417..924e589ec5 100644 --- a/flake/dev/flake.lock +++ b/flake/dev/flake.lock @@ -17,11 +17,7 @@ } }, "devshell": { - "inputs": { - "nixpkgs": [ - "dev-nixpkgs" - ] - }, + "flake": false, "locked": { "lastModified": 1768818222, "narHash": "sha256-460jc0+CZfyaO8+w8JNtlClB2n4ui1RbHfPTLkpwhU8=", @@ -37,6 +33,7 @@ } }, "flake-compat": { + "flake": false, "locked": { "lastModified": 1767039857, "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=", @@ -70,15 +67,7 @@ } }, "git-hooks": { - "inputs": { - "flake-compat": [ - "flake-compat" - ], - "gitignore": "gitignore", - "nixpkgs": [ - "dev-nixpkgs" - ] - }, + "flake": false, "locked": { "lastModified": 1778507602, "narHash": "sha256-kTwur1wV+01SdqskVMSo6JMEpg71ps3HpbFY2GsflKs=", @@ -93,33 +82,8 @@ "type": "github" } }, - "gitignore": { - "inputs": { - "nixpkgs": [ - "git-hooks", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1709087332, - "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", - "owner": "hercules-ci", - "repo": "gitignore.nix", - "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "gitignore.nix", - "type": "github" - } - }, "home-manager": { - "inputs": { - "nixpkgs": [ - "dev-nixpkgs" - ] - }, + "flake": false, "locked": { "lastModified": 1778850834, "narHash": "sha256-JB+iK+5p0m3Jx9Zi9vQO2d3BR07dbW3UqpgOhUXix3s=", @@ -161,11 +125,7 @@ } }, "nix-darwin": { - "inputs": { - "nixpkgs": [ - "dev-nixpkgs" - ] - }, + "flake": false, "locked": { "lastModified": 1777780666, "narHash": "sha256-8wURyQMdDkGUarSTKOGdCuFfYiwa3HbzwscUfn3STDE=", @@ -231,11 +191,7 @@ } }, "treefmt-nix": { - "inputs": { - "nixpkgs": [ - "dev-nixpkgs" - ] - }, + "flake": false, "locked": { "lastModified": 1775636079, "narHash": "sha256-pc20NRoMdiar8oPQceQT47UUZMBTiMdUuWrYu2obUP0=", diff --git a/flake/dev/flake.nix b/flake/dev/flake.nix index a1767420a3..b61398c6eb 100644 --- a/flake/dev/flake.nix +++ b/flake/dev/flake.nix @@ -1,6 +1,8 @@ { description = "Private inputs for development purposes. These are used by the top level flake in the `dev` partition, but do not appear in consumers' lock files."; + # Avoid `flake = true` when we do not need to evaluate flake outputs or fetch flake inputs. + # e.g. when we only import loose files. inputs = { # NOTE: Use a different name to the root flake's inputs.nixpkgs to avoid shadowing it. # NOTE: The only reason we specify a nixpkgs input at all here, is so the other inputs can follow it. @@ -8,28 +10,30 @@ dev-nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; # flake-compat is used by the root `default.nix` to allow non-flake users to import nixvim - flake-compat.url = "github:NixOS/flake-compat"; + flake-compat = { + url = "github:NixOS/flake-compat"; + flake = false; + }; # keep-sorted start block=yes newline_separated=yes devshell = { url = "github:numtide/devshell"; - inputs.nixpkgs.follows = "dev-nixpkgs"; + flake = false; }; git-hooks = { url = "github:cachix/git-hooks.nix"; - inputs.nixpkgs.follows = "dev-nixpkgs"; - inputs.flake-compat.follows = "flake-compat"; + flake = false; }; home-manager = { url = "github:nix-community/home-manager"; - inputs.nixpkgs.follows = "dev-nixpkgs"; + flake = false; }; nix-darwin = { url = "github:lnl7/nix-darwin"; - inputs.nixpkgs.follows = "dev-nixpkgs"; + flake = false; }; nuschtosSearch = { @@ -40,7 +44,7 @@ treefmt-nix = { url = "github:numtide/treefmt-nix"; - inputs.nixpkgs.follows = "dev-nixpkgs"; + flake = false; }; # keep-sorted end diff --git a/flake/dev/fmt.nix b/flake/dev/fmt.nix index 07bad8333b..cf192c0345 100644 --- a/flake/dev/fmt.nix +++ b/flake/dev/fmt.nix @@ -1,7 +1,7 @@ { inputs, ... }: { imports = [ - inputs.treefmt-nix.flakeModule + (inputs.treefmt-nix + "/flake-module.nix") ]; perSystem = diff --git a/flake/dev/git-hooks.nix b/flake/dev/git-hooks.nix index 7dd4c0b037..a50acb1328 100644 --- a/flake/dev/git-hooks.nix +++ b/flake/dev/git-hooks.nix @@ -1,7 +1,7 @@ { inputs, ... }: { imports = [ - inputs.git-hooks.flakeModule + (inputs.git-hooks + "/flake-module.nix") ]; perSystem = diff --git a/tests/platforms/darwin.nix b/tests/platforms/darwin.nix index dc66f308e8..672bc12b4a 100644 --- a/tests/platforms/darwin.nix +++ b/tests/platforms/darwin.nix @@ -1,18 +1,30 @@ { self, system, + lib, }: -self.inputs.nix-darwin.lib.darwinSystem { +let + darwinSystem = import (self.inputs.nix-darwin + "/eval-config.nix"); +in +darwinSystem { + inherit lib; + modules = [ - { - nixpkgs.hostPlatform = system; + ( + { config, ... }: + { + nixpkgs = { + source = self.inputs.nixpkgs; + hostPlatform = system; + }; - programs.nixvim = { - enable = true; - }; + programs.nixvim = { + enable = true; + }; - system.stateVersion = 5; - } + system.stateVersion = config.system.maxStateVersion; + } + ) self.nixDarwinModules.nixvim ]; } diff --git a/tests/platforms/hm-extra-files-byte-compiling.nix b/tests/platforms/hm-extra-files-byte-compiling.nix index 7caa4931ca..6e19a764d5 100644 --- a/tests/platforms/hm-extra-files-byte-compiling.nix +++ b/tests/platforms/hm-extra-files-byte-compiling.nix @@ -1,11 +1,11 @@ { self, pkgs, + lib, }: let - inherit (self.inputs.home-manager.lib) - homeManagerConfiguration - ; + hmLib = import (self.inputs.home-manager + "/lib") { inherit lib; }; + inherit (hmLib) homeManagerConfiguration; config = { home = { diff --git a/tests/platforms/hm-submodule-merge.nix b/tests/platforms/hm-submodule-merge.nix index e6c2d71588..fb46b215d0 100644 --- a/tests/platforms/hm-submodule-merge.nix +++ b/tests/platforms/hm-submodule-merge.nix @@ -1,6 +1,7 @@ { self, pkgs, + lib, }: # This test covers a user-reported regression where nixvim's submodule-option (programs.nixvim) # cannot correctly merge options declared from the parent scope. @@ -9,9 +10,8 @@ # # To be clear, this is an upstream module system bug, this test validates our workaround. let - inherit (self.inputs.home-manager.lib) - homeManagerConfiguration - ; + hmLib = import (self.inputs.home-manager + "/lib") { inherit lib; }; + inherit (hmLib) homeManagerConfiguration; # This test module declares a nixvim option from a Home Manager module # The module system will attempt an option-type merge on the `programs.nixvim` option, diff --git a/tests/platforms/hm.nix b/tests/platforms/hm.nix index 6e54ccf9b1..1e3bc7193b 100644 --- a/tests/platforms/hm.nix +++ b/tests/platforms/hm.nix @@ -1,8 +1,12 @@ { self, pkgs, + lib, }: -self.inputs.home-manager.lib.homeManagerConfiguration { +let + hmLib = import (self.inputs.home-manager + "/lib") { inherit lib; }; +in +hmLib.homeManagerConfiguration { inherit pkgs; modules = [