diff options
Diffstat (limited to '')
-rw-r--r-- | hosts/common/core/default.nix | 21 | ||||
-rw-r--r-- | hosts/common/core/locale.nix | 5 | ||||
-rw-r--r-- | hosts/common/core/nix.nix | 30 | ||||
-rw-r--r-- | hosts/common/core/shells.nix | 8 | ||||
-rw-r--r-- | hosts/common/core/zsh.nix | 6 |
5 files changed, 70 insertions, 0 deletions
diff --git a/hosts/common/core/default.nix b/hosts/common/core/default.nix new file mode 100644 index 0000000..8d19a9f --- /dev/null +++ b/hosts/common/core/default.nix @@ -0,0 +1,21 @@ +{ inputs, outputs, ... }: { + imports = [ + inputs.home-manager.nixosModules.home-manager + ./locale.nix + ./nix.nix + ./shells.nix + ./zsh.nix + ] ++ (builtins.attrValues outputs.nixosModules); + + home-manager.extraSpecialArgs = { inherit inputs outputs; }; + + nixpkgs = { + # you can add global overlays here + overlays = builtins.attrValues outputs.overlays; + config = { + allowUnfree = true; + }; + }; + + hardware.enableRedistributableFirmware = true; +} diff --git a/hosts/common/core/locale.nix b/hosts/common/core/locale.nix new file mode 100644 index 0000000..914312e --- /dev/null +++ b/hosts/common/core/locale.nix @@ -0,0 +1,5 @@ +{ lib, ... }: +{ + i18n.defaultLocale = lib.mkDefault "en_US.UTF-8"; + time.timeZone = lib.mkDefault "America/Los_Angeles"; +} diff --git a/hosts/common/core/nix.nix b/hosts/common/core/nix.nix new file mode 100644 index 0000000..587bac6 --- /dev/null +++ b/hosts/common/core/nix.nix @@ -0,0 +1,30 @@ +{ inputs, lib, ... }: +{ + nix = { + settings = { + trusted-users = [ "root" "@wheel" ]; + + auto-optimise-store = lib.mkDefault true; + experimental-features = [ "nix-command" "flakes" "repl-flake" ]; + warn-dirty = false; + #flake-registry = ""; # Disable global flake registry This is a hold-over setting from Misterio77. Not sure significance but likely to do with nix.registry entry below. + }; + + # Add each flake input as a registry to make nix3 commands consistent with your flake + #registry = lib.mapAttrs (_: value: { flake = value; }) inputs; + + # Add nixpkgs input to NIX_PATH + # This lets nix2 commands still use <nixpkgs> + #nixPath = [ "nixpkgs=${inputs.nixpkgs.outPath}" ]; + + # Garbage Collection + gc = { + automatic = true; + dates = "weekly"; + randomizedDelaySec = "14m"; + # Keep the last 2 generations + options = "--delete-older-than +2"; + }; + + }; +} diff --git a/hosts/common/core/shells.nix b/hosts/common/core/shells.nix new file mode 100644 index 0000000..0469b8c --- /dev/null +++ b/hosts/common/core/shells.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: +{ + environment.systemPackages = builtins.attrValues { + inherit (pkgs) + bash + zsh; + }; +} diff --git a/hosts/common/core/zsh.nix b/hosts/common/core/zsh.nix new file mode 100644 index 0000000..ba73c00 --- /dev/null +++ b/hosts/common/core/zsh.nix @@ -0,0 +1,6 @@ +{ + programs.zsh = { + enable = true; + enableCompletion = true; + }; +} |