3
0
Fork 0
forked from mirrors/nixpkgs

nixosSystem: Automatically set version suffix from flake

E.g.

  $ nixos-version
  19.03.20190913.af5eb77 (Koi)
This commit is contained in:
Eelco Dolstra 2019-09-13 18:26:38 +02:00
parent 22cc7ab78c
commit b91803bf13

View file

@ -9,10 +9,19 @@
jobs = import ./pkgs/top-level/release.nix {
nixpkgs = self;
};
lib = import ./lib;
in
{
lib = (import ./lib) // {
nixosSystem = import ./nixos/lib/eval-config.nix;
lib = lib // {
nixosSystem = { modules, ... } @ args:
import ./nixos/lib/eval-config.nix (args // {
modules = modules ++
[ { system.nixos.versionSuffix =
".${lib.substring 0 8 self.lastModified}.${self.shortRev}";
system.nixos.revision = self.rev;
}
];
});
};
checks.tarball = jobs.tarball;