1{ inputs, lib, ... }: {
2 nix = {
3 # Add all flake inputs to the system flake registry. There are probably better ways to do this.
4 # Particularly to consider https://github.com/NixOS/nixpkgs/pull/388090 (thank isabels config for pointing that out)
5 # but thats an issue for future me.
6 registry = let
7 # rename self to cyclamen
8 inputs' = lib.filterAttrs (
9 name: value:
10 if name == "self"
11 then false
12 else true
13 ) (inputs // {cyclamen = inputs.self;});
14 in (
15 lib.mapAttrs (name: value: {
16 to = {
17 type = "path";
18 path = value;
19 };
20 }) inputs'
21 );
22
23 # Dont need or want that.
24 channel.enable = false;
25
26 gc = {
27 automatic = true;
28 options = "--delete-older-than 14d";
29 };
30
31 settings = {
32 allowed-users = [ "@wheel" ];
33 trusted-users = [ "@wheel" ];
34
35 experimental-features = [
36 # Enable flakes
37 "nix-command" "flakes"
38 ];
39
40 # Disable the global flake registry
41 flake-registry = "";
42
43 # Use as many jobs are there are CPU cores available (speed up builds)
44 max-jobs = "auto";
45
46 # Use $XDG_STATE_HOME/nix instead of ~/.nix-profile and co
47 use-xdg-base-directories = true;
48 };
49 };
50}