From dd434b351f6933cd138a847057e09bf06fb154ba Mon Sep 17 00:00:00 2001 From: Anthony Rodriguez Date: Tue, 27 Aug 2024 13:01:09 +0200 Subject: [PATCH] add nix-helper --- flake.lock | 4 ++-- flake.nix | 2 +- modules/system.nix | 16 ++++++++++------ 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/flake.lock b/flake.lock index 66e407b..877e362 100644 --- a/flake.lock +++ b/flake.lock @@ -494,11 +494,11 @@ "locked": { "lastModified": 1, "narHash": "sha256-tqJYXR0mlrRwAOCqQDl2rdJWntnpWYVhMGyvaqvgUJE=", - "path": "./shells", + "path": "shells", "type": "path" }, "original": { - "path": "./shells", + "path": "shells", "type": "path" } }, diff --git a/flake.nix b/flake.nix index 2c7027b..925ae62 100644 --- a/flake.nix +++ b/flake.nix @@ -15,7 +15,7 @@ inputs.nixpkgs.follows = "nixpkgs"; }; shells = { - url = "path:./shells"; + url = "path:shells"; inputs.nixpkgs.follows = "nixpkgs"; }; stylix = { diff --git a/modules/system.nix b/modules/system.nix index 45397eb..10cc524 100644 --- a/modules/system.nix +++ b/modules/system.nix @@ -1,4 +1,4 @@ -{ pkgs, hostname, lib, ... }: { +{ pkgs, hostname, username, lib, ... }: { networking.hostName = hostname; boot = { loader = { @@ -118,11 +118,15 @@ services.udev.packages = [ pkgs.sane-airscan pkgs.utsushi ]; services.udisks2.enable = true; - # do garbage collection weekly to keep disk usage low - nix.gc = { - automatic = lib.mkDefault true; - dates = lib.mkDefault "weekly"; - options = lib.mkDefault "--delete-older-than 7d"; + + programs.nh = { + enable = true; + clean.enable = true; + clean.extraArgs = "--keep-since 4d --keep 3"; + }; + + environment.sessionVariables = { + FLAKE = "/home/${username}/.dotfiles"; }; # Enable all packages