flake.nix: make pure

This commit is contained in:
Tristan Ross 2024-06-06 21:18:15 -07:00
parent 013e398b0f
commit 8233812d54
No known key found for this signature in database
GPG Key ID: B09C422035669AF8

View File

@ -5,14 +5,15 @@
outputs = { self }: outputs = { self }:
let let
jobs = import ./pkgs/top-level/release.nix {
nixpkgs = self;
};
libVersionInfoOverlay = import ./lib/flake-version-info.nix self; libVersionInfoOverlay = import ./lib/flake-version-info.nix self;
lib = (import ./lib).extend libVersionInfoOverlay; lib = (import ./lib).extend libVersionInfoOverlay;
forAllSystems = lib.genAttrs lib.systems.flakeExposed; forAllSystems = lib.genAttrs lib.systems.flakeExposed;
jobs = forAllSystems (system: import ./pkgs/top-level/release.nix {
nixpkgs = self;
inherit system;
});
in in
{ {
lib = lib.extend (final: prev: { lib = lib.extend (final: prev: {
@ -44,11 +45,12 @@
}); });
checks.x86_64-linux = { checks.x86_64-linux = {
tarball = jobs.tarball; tarball = jobs.x86_64-linux.tarball;
# Test that ensures that the nixosSystem function can accept a lib argument # 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 # 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.<libname>` # alternatives include: `import` a file, or put a custom library in an option or in `_module.args.<libname>`
nixosSystemAcceptsLib = (self.lib.nixosSystem { nixosSystemAcceptsLib = (self.lib.nixosSystem {
pkgs = self.legacyPackages.x86_64-linux;
lib = self.lib.extend (final: prev: { lib = self.lib.extend (final: prev: {
ifThisFunctionIsMissingTheTestFails = final.id; ifThisFunctionIsMissingTheTestFails = final.id;
}); });
@ -67,7 +69,7 @@
}; };
htmlDocs = { htmlDocs = {
nixpkgsManual = jobs.manual; nixpkgsManual = jobs.x86_64-linux.manual;
nixosManual = (import ./nixos/release-small.nix { nixosManual = (import ./nixos/release-small.nix {
nixpkgs = self; nixpkgs = self;
}).nixos.manual.x86_64-linux; }).nixos.manual.x86_64-linux;