Skip to content

Commit 85cf706

Browse files
committed
nix.nix: inherit from upstream nix.nix
1 parent 5828992 commit 85cf706

File tree

1 file changed

+5
-40
lines changed

1 file changed

+5
-40
lines changed

modules/environment/nix.nix

Lines changed: 5 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# (Copyright (c) 2003-2022 Eelco Dolstra and the Nixpkgs/NixOS contributors,
88
# licensed under MIT License as well)
99

10-
{ config, lib, pkgs, ... }:
10+
{ config, lib, pkgs, nixpkgs, ... }:
1111

1212
with lib;
1313

@@ -20,8 +20,8 @@ in
2020
{
2121
# Backward-compatibility with the NixOS options.
2222
imports = [
23-
(renameNixOpt "binaryCaches" "substituters")
24-
(renameNixOpt "binaryCachePublicKeys" "trustedPublicKeys")
23+
# Use options and config from upstream nix.nix
24+
"${nixpkgs}/nixos/modules/config/nix.nix"
2525
];
2626

2727
###### interface
@@ -51,32 +51,6 @@ in
5151
'';
5252
};
5353

54-
## From nix.nix
55-
56-
substituters = mkOption {
57-
type = types.listOf types.str;
58-
default = [ ];
59-
description = ''
60-
A list of URLs of substituters. The official NixOS and Nix-on-Droid
61-
substituters are added by default.
62-
'';
63-
};
64-
65-
trustedPublicKeys = mkOption {
66-
type = types.listOf types.str;
67-
default = [ ];
68-
description = ''
69-
A list of public keys. When paths are copied from another Nix store (such as a
70-
binary cache), they must be signed with one of these keys. The official NixOS
71-
and Nix-on-Droid public keys are added by default.
72-
'';
73-
};
74-
75-
extraOptions = mkOption {
76-
type = types.lines;
77-
default = "";
78-
description = "Extra config to be appended to <filename>/etc/nix/nix.conf</filename>.";
79-
};
8054
};
8155

8256
};
@@ -85,22 +59,13 @@ in
8559
###### implementation
8660

8761
config = {
88-
environment.etc = {
89-
"nix/nix.conf".text = ''
90-
sandbox = false
91-
substituters = ${concatStringsSep " " cfg.substituters}
92-
trusted-public-keys = ${concatStringsSep " " cfg.trustedPublicKeys}
93-
${cfg.extraOptions}
94-
'';
95-
};
96-
9762
nix = {
9863
enable = true;
99-
substituters = [
64+
settings.substituters = [
10065
"https://cache.nixos.org"
10166
"https://nix-on-droid.cachix.org"
10267
];
103-
trustedPublicKeys = [
68+
settings.trustedPublicKeys = [
10469
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
10570
"nix-on-droid.cachix.org-1:56snoMJTXmDRC1Ei24CmKoUqvHJ9XCp+nidK7qkMQrU="
10671
];

0 commit comments

Comments
 (0)