diff options
| author | Daiderd Jordan <daiderd@gmail.com> | 2020-10-18 12:57:15 +0200 |
|---|---|---|
| committer | Daiderd Jordan <daiderd@gmail.com> | 2020-10-21 18:30:56 +0200 |
| commit | 4a31cba84c50e01c3281053b5f2bcaa2a942f796 (patch) | |
| tree | ea4f6ba9d1980dcec7cb4e63c4c872f95b2e8b1e /modules/system | |
| parent | c4bc63d2b9c92cda312e72a6b9131d43c4201d02 (diff) | |
add flake versions
Diffstat (limited to 'modules/system')
| -rw-r--r-- | modules/system/version.nix | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/modules/system/version.nix b/modules/system/version.nix index 46291d6..7b9236d 100644 --- a/modules/system/version.nix +++ b/modules/system/version.nix @@ -59,6 +59,12 @@ in description = "The full darwin version (e.g. <literal>darwin4.master</literal>)."; }; + system.darwinVersionSuffix = mkOption { + internal = true; + type = types.str; + description = "The short darwin version suffix (e.g. <literal>.2abdb5a</literal>)."; + }; + system.darwinRevision = mkOption { internal = true; type = types.str; @@ -78,6 +84,12 @@ in description = "The full nixpkgs version (e.g. <literal>16.03.1160.f2d4ee1</literal>)."; }; + system.nixpkgsVersionSuffix = mkOption { + internal = true; + type = types.str; + description = "The short nixpkgs version suffix (e.g. <literal>.1160.f2d4ee1</literal>)."; + }; + system.nixpkgsRevision = mkOption { internal = true; type = types.str; @@ -89,12 +101,14 @@ in # These defaults are set here rather than up there so that # changing them would not rebuild the manual - system.darwinLabel = "${cfg.nixpkgsVersion}+${cfg.darwinVersion}"; - system.darwinVersion = "darwin" + toString cfg.stateVersion + "." + darwin.shortRev; + system.darwinLabel = mkDefault "${cfg.nixpkgsVersion}+${cfg.darwinVersion}"; + system.darwinVersion = mkDefault "darwin${toString cfg.stateVersion}${cfg.darwinVersionSuffix}"; + system.darwinVersionSuffix = mkDefault ".${darwin.shortRev}"; system.darwinRevision = mkIf (darwin ? rev) (mkDefault darwin.rev); - system.nixpkgsVersion = mkDefault (cfg.nixpkgsRelease + nixpkgsSuffix); + system.nixpkgsVersion = mkDefault "${cfg.nixpkgsRelease}${cfg.nixpkgsVersionSuffix}"; system.nixpkgsRelease = mkDefault (fileContents releaseFile); + system.nixpkgsVersionSuffix = mkDefault nixpkgsSuffix; system.nixpkgsRevision = mkIf (nixpkgs ? rev) (mkDefault nixpkgs.rev); assertions = [ { assertion = cfg.stateVersion <= defaultStateVersion; message = "system.stateVersion = ${toString cfg.stateVersion}; is not a valid value"; } ]; |
