1
0
Fork 0
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:
Daiderd Jordan 2018-03-29 21:19:37 +02:00
parent acdcebb508
commit 22e832628f
No known key found for this signature in database
GPG key ID: D02435D05B810C96

View file

@ -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 ];