aboutsummaryrefslogtreecommitdiff
path: root/modules/teh-nix/nix.nix
diff options
context:
space:
mode:
authorDylan <boss@tehbox.org>2026-10-17 21:53:43 +1300
committerDylan <boss@tehbox.org>2026-10-17 21:53:43 +1300
commit280e1bbe5e733128a451260685cc8ecd10a042a3 (patch)
tree78bab82353bbfa00f9a781015e246c274a5c983b /modules/teh-nix/nix.nix
parentbcfc69e424802276cc52fb6e00fb4a42e9c37816 (diff)
downloadnixos-configuration-280e1bbe5e733128a451260685cc8ecd10a042a3.tar.gz
nixos-configuration-280e1bbe5e733128a451260685cc8ecd10a042a3.zip
feat: Dendritic pattern
This re-write was done with the help of claude, and still needs a decent amount of changes before it properly follows the dendritic pattern
Diffstat (limited to 'modules/teh-nix/nix.nix')
-rw-r--r--modules/teh-nix/nix.nix45
1 files changed, 45 insertions, 0 deletions
diff --git a/modules/teh-nix/nix.nix b/modules/teh-nix/nix.nix
new file mode 100644
index 0000000..d0b6cb3
--- /dev/null
+++ b/modules/teh-nix/nix.nix
@@ -0,0 +1,45 @@
+{ inputs, ... }:
+{
+ flake.modules.nixos.teh-nix =
+ { config, lib, ... }:
+ {
+ options.teh-nix.nix = with lib; {
+ enable = mkEnableOption "Use the TehNix nix settings";
+ };
+
+ config = lib.mkIf config.teh-nix.nix.enable {
+ nix.nixPath = [ "/etc/nix/path" ];
+ nix.registry.nixpkgs.flake = inputs.nixpkgs;
+ environment.etc."nix/path/nixpkgs".source = inputs.nixpkgs;
+
+ nix = {
+ settings = {
+ experimental-features = [ "nix-command" "flakes" ];
+ auto-optimise-store = true;
+
+ trusted-users = [ "boss" ];
+
+ substituters = [
+ "https://cache.nixos.org"
+ ];
+
+ # trusted-public-keys = [
+ # "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
+ # ];
+ };
+ optimise.automatic = true;
+ };
+
+ # nh's cleaner replaces nix.gc (the nh module asserts they aren't both on)
+ programs.nh = {
+ enable = true;
+ clean = {
+ enable = true;
+ dates = "weekly";
+ # --no-direnv keeps nix-direnv's gcroots so dev shells survive
+ extraArgs = "--keep-since 7d --keep 5 --no-direnv";
+ };
+ };
+ };
+ };
+}