mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-06 01:38:06 +00:00
Proper nix.extraConfig support. Must usptream that.
This commit is contained in:
parent
4319f5a3cc
commit
6d390e7292
1 changed files with 17 additions and 3 deletions
20
general.nix
20
general.nix
|
|
@ -2,6 +2,18 @@
|
||||||
with lib;
|
with lib;
|
||||||
let
|
let
|
||||||
cfg = config.aviallon.general;
|
cfg = config.aviallon.general;
|
||||||
|
nixConfigValue = value:
|
||||||
|
if value == true then "true"
|
||||||
|
else if value == false then "false"
|
||||||
|
else if isList value then (toString value)
|
||||||
|
else generators.mkValueStringDefault { } value;
|
||||||
|
|
||||||
|
nixConfig = settings: (generators.toKeyValue {
|
||||||
|
listsAsDuplicateKeys = false;
|
||||||
|
mkKeyValue = generators.mkKeyValueDefault {
|
||||||
|
mkValueString = nixConfigValue;
|
||||||
|
} " = ";
|
||||||
|
} settings);
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.aviallon.general = {
|
options.aviallon.general = {
|
||||||
|
|
@ -84,9 +96,11 @@ in
|
||||||
];
|
];
|
||||||
nix.distributedBuilds = mkDefault false;
|
nix.distributedBuilds = mkDefault false;
|
||||||
|
|
||||||
nix.extraOptions = ''
|
nix.package = (if (builtins.compareVersions pkgs.nix.version "2.4" >= 0) then pkgs.nix else pkgs.nix_2_4);
|
||||||
builders-use-substitutes = true
|
nix.extraOptions = nixConfig {
|
||||||
'';
|
builders-use-substitutes = true;
|
||||||
|
experimental-features = [ "nix-command" "flakes" ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue