flake.nix: use lib.extend

This preserves the nixosSystem function if another flake uses lib.extend
itself.
This commit is contained in:
Fabian Möller 2020-07-23 17:36:45 +02:00
parent 2d6ab6e2f1
commit 74430a81ff
No known key found for this signature in database
GPG Key ID: 70B29D65DD8A7E31

View File

@ -18,17 +18,17 @@
in in
{ {
lib = lib // { lib = lib.extend (final: prev: {
nixosSystem = { modules, ... } @ args: nixosSystem = { modules, ... } @ args:
import ./nixos/lib/eval-config.nix (args // { import ./nixos/lib/eval-config.nix (args // {
modules = modules ++ modules = modules ++
[ { system.nixos.versionSuffix = [ { system.nixos.versionSuffix =
".${lib.substring 0 8 (self.lastModifiedDate or self.lastModified)}.${self.shortRev or "dirty"}"; ".${final.substring 0 8 (self.lastModifiedDate or self.lastModified)}.${self.shortRev or "dirty"}";
system.nixos.revision = lib.mkIf (self ? rev) self.rev; system.nixos.revision = final.mkIf (self ? rev) self.rev;
} }
]; ];
}); });
}; });
checks.x86_64-linux.tarball = jobs.tarball; checks.x86_64-linux.tarball = jobs.tarball;