|
7 | 7 | # (Copyright (c) 2003-2022 Eelco Dolstra and the Nixpkgs/NixOS contributors, |
8 | 8 | # licensed under MIT License as well) |
9 | 9 |
|
10 | | -{ config, lib, pkgs, ... }: |
| 10 | +{ config, lib, pkgs, nixpkgs, ... }: |
11 | 11 |
|
12 | 12 | with lib; |
13 | 13 |
|
|
20 | 20 | { |
21 | 21 | # Backward-compatibility with the NixOS options. |
22 | 22 | 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" |
25 | 25 | ]; |
26 | 26 |
|
27 | 27 | ###### interface |
|
51 | 51 | ''; |
52 | 52 | }; |
53 | 53 |
|
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 | | - }; |
80 | 54 | }; |
81 | 55 |
|
82 | 56 | }; |
|
85 | 59 | ###### implementation |
86 | 60 |
|
87 | 61 | 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 | | - |
97 | 62 | nix = { |
98 | 63 | enable = true; |
99 | | - substituters = [ |
| 64 | + settings.substituters = [ |
100 | 65 | "https://cache.nixos.org" |
101 | 66 | "https://nix-on-droid.cachix.org" |
102 | 67 | ]; |
103 | | - trustedPublicKeys = [ |
| 68 | + settings.trustedPublicKeys = [ |
104 | 69 | "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" |
105 | 70 | "nix-on-droid.cachix.org-1:56snoMJTXmDRC1Ei24CmKoUqvHJ9XCp+nidK7qkMQrU=" |
106 | 71 | ]; |
|
0 commit comments