From 47d6b21930a651faf1fd9f217423281c5332dc9f Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sat, 30 Dec 2023 11:25:54 +0100 Subject: [PATCH] flake.nix: Add caveats --- flake.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 6fc0d4f87932..580f572ff32c 100644 --- a/flake.nix +++ b/flake.nix @@ -34,6 +34,8 @@ checks.x86_64-linux = { tarball = jobs.tarball; # Test that ensures that the nixosSystem function can accept a lib argument + # Note: prefer not to extend or modify `lib`, especially if you want to share reusable modules + # alternatives include: `import` a file, or put a custom library in an option or in `_module.args.` nixosSystemAcceptsLib = (self.lib.nixosSystem { lib = self.lib.extend (final: prev: { ifThisFunctionIsMissingTheTestFails = final.id; @@ -45,7 +47,8 @@ nixpkgs.hostPlatform = "x86_64-linux"; boot.loader.grub.enable = false; fileSystems."/".device = "nodev"; - system.stateVersion = lib.versions.majorMinor lib.version; + # See https://search.nixos.org/options?show=system.stateVersion&query=stateversion + system.stateVersion = lib.versions.majorMinor lib.version; # DON'T do this in real configs! }) ]; }).config.system.build.toplevel;