system-manager-wakasu
  1{
  2  hostname,
  3  ...
  4}:
  5{
  6  imports = [
  7    (./. + "/${hostname}/system.nix")
  8
  9    # ./common/base
 10  ];
 11
 12  nixpkgs = {
 13    # Note: Overlays cause infinite recursion in system-manager
 14    # Disabling for now - packages will come from standard nixpkgs
 15    # overlays = [
 16    #   # Our own flake exports (from overlays and pkgs dir)
 17    #   outputs.overlays.additions
 18    #   outputs.overlays.modifications
 19    #   outputs.overlays.unstable-packages
 20    #
 21    #   # And from other flakes
 22    #   inputs.emacs-overlay.overlay
 23    #   inputs.chapeau-rouge.overlays.openshift
 24    #   inputs.chick-group.overlays.default
 25    #   inputs.agenix.overlays.default
 26    #
 27    #   # Migrate to "modifications"
 28    #   (_: prev: {
 29    #     inherit (inputs.buildkit-tekton.packages.${prev.system}) tkn-local;
 30    #     inherit (inputs.dagger.packages.${prev.system}) dagger;
 31    #   })
 32    # ];
 33    config = {
 34      allowUnfree = true;
 35    };
 36  };
 37  nix = {
 38    # This will add each flake input as a registry
 39    # To make nix3 commands consistent with your flake
 40    # Note: These options are not available in system-manager
 41    # registry = lib.mkForce (lib.mapAttrs (_: value: { flake = value; }) inputs);
 42
 43    # This will additionally add your inputs to the system's legacy channels
 44    # Making legacy nix commands consistent as well, awesome!
 45    # nixPath = lib.mkForce (
 46    #   lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry
 47    # );
 48
 49    # Note: These options are not available in system-manager
 50    # optimise = {
 51    #   automatic = true;
 52    #   dates = [
 53    #     "01:10"
 54    #     "12:10"
 55    #   ];
 56    # };
 57
 58    settings = {
 59      auto-optimise-store = true;
 60      experimental-features = [
 61        "nix-command"
 62        "flakes"
 63      ];
 64      sandbox = true;
 65      allowed-users = [
 66        "@wheel"
 67      ];
 68      trusted-users = [
 69        "root"
 70        "@wheel"
 71      ];
 72      # See https://nixos.org/manual/nix/stable/command-ref/conf-file#conf-use-xdg-base-directories
 73      use-xdg-base-directories = true;
 74
 75      # Add some "caches" (substituters)
 76      substituters = [
 77        "https://cache.nixos.org/"
 78        "https://r-ryantm.cachix.org"
 79        "https://shortbrain.cachix.org"
 80        "https://vdemeester.cachix.org"
 81        "https://chapeau-rouge.cachix.org"
 82      ];
 83      trusted-public-keys = [
 84        "r-ryantm.cachix.org-1:gkUbLkouDAyvBdpBX0JOdIiD2/DP1ldF3Z3Y6Gqcc4c="
 85        "shortbrain.cachix.org-1:dqXcXzM0yXs3eo9ChmMfmob93eemwNyhTx7wCR4IjeQ="
 86        "mic92.cachix.org-1:gi8IhgiT3CYZnJsaW7fxznzTkMUOn1RY4GmXdT/nXYQ="
 87        "chapeau-rouge.cachix.org-1:r34IG766Ez4Eeanr7Zx+egzXLE2Zgvc+XRspYZPDAn8="
 88        "vdemeester.cachix.org-1:eZWNOrLR9A9szeMahn9ENaoT9DB3WgOos8va+d2CU44="
 89      ];
 90    };
 91
 92    extraOptions = ''
 93      connect-timeout = 20
 94      build-cores = 0
 95      keep-outputs = true
 96      keep-derivations = true
 97      builders-use-substitutes = true
 98    '';
 99
100    # On laptops at least, make the daemon and builders low priority
101    # to have a responding system while building
102    # Note: These options are not available in system-manager
103    # daemonIOSchedClass = "idle";
104    # daemonCPUSchedPolicy = "idle";
105  };
106}