blob: 29b817fb8bdfdaf5d625feaa7ae219047e6a37e6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
{
config,
lib,
pkgs,
inputs,
...
}: let
cfg = config.base.nixSettings;
enable = config.base.enable && cfg.enable;
in {
options.base.nixSettings = {
enable = lib.mkEnableOption "nix settings" // {default = true;};
};
config = lib.mkIf enable {
nix = {
registry.n.flake = lib.mkDefault inputs.nixpkgs;
nixPath = [
"nixpkgs=/etc/nix/inputs/nixpkgs"
];
settings = {
auto-optimise-store = pkgs.stdenv.isLinux;
experimental-features = ["nix-command" "flakes" "auto-allocate-uids" "repl-flake"];
trusted-substituters = ["https://cache.garnix.io"];
trusted-public-keys = ["cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="];
nix-path = config.nix.nixPath;
};
gc = {
automatic = lib.mkDefault true;
options = lib.mkDefault "--delete-older-than 7d";
};
};
nixpkgs = {
config.allowUnfree = lib.mkDefault true;
};
};
}
|