summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Stachurski <j.stachurski@student.utwente.nl>2025-11-25 15:59:26 +0100
committerJakub Stachurski <j.stachurski@student.utwente.nl>2025-11-25 15:59:26 +0100
commitb1de513c34dde6711e09ec993f25ce63a5509469 (patch)
tree6236d40027445af61b25f8f1d1ece81d53a1c5a9
parentce021eefaf1f337ed8ac406dea70947033bd70c1 (diff)
Add nh
-rw-r--r--home-modules/default.nix1
-rw-r--r--modules/default.nix10
-rw-r--r--modules/nh.nix24
3 files changed, 35 insertions, 0 deletions
diff --git a/home-modules/default.nix b/home-modules/default.nix
index dec54f1..8b84948 100644
--- a/home-modules/default.nix
+++ b/home-modules/default.nix
@@ -16,5 +16,6 @@
age.keyFile = "/home/${config.home.username}/.config/sops/age/keys.txt";
defaultSopsFile = ../secrets/secrets.yaml;
};
+
}
diff --git a/modules/default.nix b/modules/default.nix
index f51dc9d..3640cf4 100644
--- a/modules/default.nix
+++ b/modules/default.nix
@@ -2,6 +2,7 @@
pkgs,
lib,
config,
+ inputs,
...
}:
{
@@ -12,6 +13,14 @@
./btrfs.nix
./vpn.nix
./remote-builder.nix
+ ./nh.nix
+ ];
+
+ nixpkgs.overlays = [
+ (import ../overlays/stable_overrides.nix {
+ nixpkgs-stable = inputs.nixpkgs-stable;
+ inherit pkgs;
+ })
];
nix.settings.experimental-features = [
@@ -28,6 +37,7 @@
};
time.timeZone = "Europe/Amsterdam"; # Set timezone
+
sops.defaultSopsFile = ./secrets/secrets.yaml;
sops.age.sshKeyPaths = [ "/etc/ssh_host_ed25519_key" ];
sops.age.keyFile = "/var/lib/sops-nix/key.txt";
diff --git a/modules/nh.nix b/modules/nh.nix
new file mode 100644
index 0000000..832fbeb
--- /dev/null
+++ b/modules/nh.nix
@@ -0,0 +1,24 @@
+{pkgs, lib, config, ... }: let
+ conf = config.addons.nh;
+in {
+ options.addons.nh = {
+ enable = lib.mkOption {
+ default = true;
+ description = "Enable nix cli helper";
+ };
+
+ flake_path = lib.mkOption {
+ default = "/home/wilkuu/nix-config/";
+ description = "Flake location for nh to use";
+ };
+ };
+
+ config = {
+ programs.nh = {
+ enable = conf.enable;
+ clean.enable = true;
+ clean.extraArgs = "--keep-since 4d --keep 3";
+ flake = conf.flake_path; # sets NH_OS_FLAKE variable for you
+ };
+ };
+}