Why Nostr? What is Njump?
2025-06-03 02:00:43

Linux Is Best on Nostr: Tested and it works on NixOS. Now, watch NixOS Development change something, so this ...

Tested and it works on NixOS.

Now, watch NixOS Development change something, so this stops working in the future.


# ----------------------------------------
# 🗑️ Weekly Garbage Collection.
# ----------------------------------------

# Cleans unused packages every Monday at 4 PM, waiting 24+ hours after updates to avoid issues.
#
# ✅ What it does:
# • Runs: "nix-collect-garbage -d".
# • Deletes unused system generations and packages.
# • Frees up disk space safely.
#
# ⚠️ What it doesn't do:
# • ❌ Won't remove your currently active or booted system configuration.
# • ❌ Doesn't reboot your machine.

# 📝 Tip: Adjust the times below to fit your schedule or preferences.


# Enable automatic garbage collection in Nix.
# This cleans up unused packages and old system generations regularly.
nix.gc = {
automatic = true;
dates = "Mon *-*-* 16:00"; # Monday, 4:00 PM - Change if you want a different day and time.
};

# Timer for running Nix's built-in automatic garbage collection
systemd.timers.nix-gc.timerConfig = {
WakeSystem = true;
Persistent = true;
};

# Custom service to wipe ALL old system generations manually.
# This is a more thorough cleanup, safely removing all old system snapshots.
systemd.services.nix-gc-wipe = {
description = "Wipe all old system generations";
serviceConfig = {
Type = "oneshot";
Environment = "PATH=/run/current-system/sw/bin";
ExecStart = "/bin/sh -c 'nix-env --delete-generations old --profile /nix/var/nix/profiles/system && nix-collect-garbage -d'";
};
};

# Timer to run the custom wipe service every Monday at 4:15 PM
systemd.timers.nix-gc-wipe = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnCalendar = "Mon *-*-* 16:15:00"; # Monday, 4:15 PM - Change if you want a different day and time.
WakeSystem = true;
Persistent = true;
};
};
Author Public Key
npub19676qfa73jxrtzddlnxkj3syuj8qswjvhe74pha9vx2s3m3k4vqqw0ln2g