From 519191cd9f31d1fe1c205535ddc4efe5f2e63793 Mon Sep 17 00:00:00 2001 From: seth Date: Sat, 7 Oct 2023 10:10:55 -0400 Subject: treewide!: remove flake-parts while i love flake parts, i want to keep dependencies for this project as small as possible --- pkgs/nixgc/default.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 pkgs/nixgc/default.nix (limited to 'pkgs/nixgc/default.nix') diff --git a/pkgs/nixgc/default.nix b/pkgs/nixgc/default.nix new file mode 100644 index 0000000..d13614a --- /dev/null +++ b/pkgs/nixgc/default.nix @@ -0,0 +1,22 @@ +# this is a shell script that uses the new nix cli to emulate +# nix-collect-garbage +{ + lib, + writeShellApplication, + nix, + fd, +}: +writeShellApplication { + name = "nixgc"; + + runtimeInputs = [nix fd]; + + text = '' + fd . /nix/var/nix/profiles /home/*/.local/state/nix/profiles -d 3 -t symlink -E '*-link' | while read -r profile; do + nix profile wipe-history --profile "$profile" "$@" + done + ''; +} +// { + meta.platforms = lib.platforms.linux; +} -- cgit v1.2.3