diff --git a/configuration/common/nix.nix b/configuration/common/nix.nix index 67977ec..cabb17a 100644 --- a/configuration/common/nix.nix +++ b/configuration/common/nix.nix @@ -65,4 +65,7 @@ documentation.doc.enable = false; + environment.systemPackages = with pkgs; [ + nix-remove-result-links + ]; } diff --git a/flake.nix b/flake.nix index c20ec46..b1dd8e2 100644 --- a/flake.nix +++ b/flake.nix @@ -114,6 +114,7 @@ inherit (pkgs) chromium-incognito iot-data + nix-remove-result-links nixfiles-add-secret nixfiles-auto-install nixfiles-generate-backup-secrets diff --git a/pkgs/nix-remove-result-links/default.nix b/pkgs/nix-remove-result-links/default.nix new file mode 100644 index 0000000..9fd9c30 --- /dev/null +++ b/pkgs/nix-remove-result-links/default.nix @@ -0,0 +1,9 @@ +{ pkgs, ... }: + +pkgs.writeShellApplication { + name = "nix-remove-result-links"; + text = '' + #!/usr/bin/env bash + find "''${1:-.}" -depth -type l -name "result*" -lname "/nix/store/*" -print -delete + ''; +} diff --git a/pkgs/overlay.nix b/pkgs/overlay.nix index 59705f6..530c957 100644 --- a/pkgs/overlay.nix +++ b/pkgs/overlay.nix @@ -1,6 +1,7 @@ final: prev: { chromium-incognito = final.callPackage ./chromium-incognito {}; iot-data = final.python3.pkgs.callPackage ./iot-data {}; + nix-remove-result-links = final.callPackage ./nix-remove-result-links {}; nixfiles-add-secret = final.callPackage ./nixfiles/nixfiles-add-secret.nix {}; nixfiles-auto-install = final.callPackage ./nixfiles/nixfiles-auto-install.nix {}; nixfiles-generate-backup-secrets = final.callPackage ./nixfiles/nixfiles-generate-backup-secrets.nix {};