diff --git a/system/darwinix/default.nix b/system/darwinix/default.nix index f18ac5d9..bfb96335 100644 --- a/system/darwinix/default.nix +++ b/system/darwinix/default.nix @@ -10,28 +10,7 @@ hostname, ... }: { - nix = { - enable = true; - - package = pkgs.nixVersions.stable; - extraOptions = '' - experimental-features = nix-command flakes pipe-operators - ''; - - settings.trusted-users = ["root" "${username}"]; - - gc.automatic = false; - gc.options = "--delete-older-than 5d"; - settings.auto-optimise-store = true; - optimise.automatic = true; - - registry = lib.mapAttrs' (n: v: lib.nameValuePair n {flake = v;}) inputs; - - nixPath = [ - "nixpkgs=${inputs.nixpkgs.outPath}" - "home-manager=${inputs.home-manager.outPath}" - ]; - }; + nix = mylib.nixos.mkCommonNixSettings username; networking = { hostName = "${hostname}"; diff --git a/system/default.nix b/system/default.nix index e74a129f..c8a19534 100644 --- a/system/default.nix +++ b/system/default.nix @@ -104,31 +104,7 @@ with mylib.networking; { }; # Enable flakes - nix = { - package = pkgs.nixVersions.stable; - extraOptions = '' - experimental-features = nix-command flakes pipe-operators - ''; - - settings.trusted-users = ["root" "${username}"]; - - # Auto garbage-collect and optimize store - gc.automatic = false; # Done by nh.clean.enable; - gc.options = "--delete-older-than 5d"; - settings.auto-optimise-store = true; - optimise.automatic = true; - - # This will add your inputs as registries, making operations with them (such - # as nix shell nixpkgs#name) consistent with your flake inputs. - # (Registry contains flakes) - registry = lib.mapAttrs' (n: v: lib.nameValuePair n {flake = v;}) inputs; - - # Set NIX_PATH to find nixpgks - nixPath = [ - "nixpkgs=${inputs.nixpkgs.outPath}" - "home-manager=${inputs.home-manager.outPath}" - ]; - }; + nix = mylib.nixos.mkCommonNixSettings username; # Bootloader/Kernel stuff boot = {