summaryrefslogtreecommitdiff
path: root/modules/nix-helper.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/nix-helper.nix')
-rw-r--r--modules/nix-helper.nix40
1 files changed, 40 insertions, 0 deletions
diff --git a/modules/nix-helper.nix b/modules/nix-helper.nix
new file mode 100644
index 0000000..5e5e133
--- /dev/null
+++ b/modules/nix-helper.nix
@@ -0,0 +1,40 @@
+{
+ config,
+ lib,
+ pkgs,
+ username,
+ ...
+}:
+let
+ cfg = config.os.srv.nix-helper;
+in
+{
+ options.os.srv.nix-helper.enable = lib.mkEnableOption "enables nix-helper";
+ config = lib.mkIf cfg.enable {
+ nix.settings = {
+ trusted-users = [
+ "root"
+ "${username}"
+ ];
+ experimental-features = [
+ "nix-command"
+ "flakes"
+ ];
+ };
+
+ programs.nh = {
+ enable = true;
+ flake = "/etc/nixos";
+ clean.extraArgs = "--keep 5";
+ };
+
+ environment.sessionVariables = {
+ NH_OS_FLAKE = "/etc/nixos";
+ };
+
+ environment.systemPackages = with pkgs; [
+ nix-output-monitor
+ nvd
+ ];
+ };
+}