mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-05 17:27:50 +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;
|
||||
let
|
||||
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
|
||||
{
|
||||
options.aviallon.general = {
|
||||
|
|
@ -84,9 +96,11 @@ in
|
|||
];
|
||||
nix.distributedBuilds = mkDefault false;
|
||||
|
||||
nix.extraOptions = ''
|
||||
builders-use-substitutes = true
|
||||
'';
|
||||
nix.package = (if (builtins.compareVersions pkgs.nix.version "2.4" >= 0) then pkgs.nix else pkgs.nix_2_4);
|
||||
nix.extraOptions = nixConfig {
|
||||
builders-use-substitutes = true;
|
||||
experimental-features = [ "nix-command" "flakes" ];
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue