mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-13 12:19:09 +00:00
nix: add version option
This can be used to declare the system version of nix when a profile is used instead of a package.
This commit is contained in:
parent
acdcebb508
commit
22e832628f
1 changed files with 10 additions and 1 deletions
|
@ -5,7 +5,7 @@ with lib;
|
|||
let
|
||||
cfg = config.nix;
|
||||
|
||||
isNix20 = versionAtLeast (cfg.package.version or "<unknown>") "1.12pre";
|
||||
isNix20 = versionAtLeast (cfg.version or "<unknown>") "1.12pre";
|
||||
|
||||
nixConf =
|
||||
let
|
||||
|
@ -64,6 +64,13 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
nix.version = mkOption {
|
||||
type = types.str;
|
||||
default = "<unknown>";
|
||||
example = "1.11.6";
|
||||
description = "The version of nix. Used to determine what settings to configure in nix.conf";
|
||||
};
|
||||
|
||||
nix.useDaemon = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
|
@ -338,6 +345,8 @@ in
|
|||
nix.package = mkIf (config.system.stateVersion < 3)
|
||||
"/nix/var/nix/profiles/default";
|
||||
|
||||
nix.version = mkIf (isDerivation cfg.package) cfg.package.version or "<unknown>";
|
||||
|
||||
environment.systemPackages = mkIf (isDerivation cfg.package)
|
||||
[ cfg.package ];
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue