Compare commits
3 Commits
977aa539a3
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 349181f35b | |||
| 0b8b7564a1 | |||
| 54e0f94af5 |
42
flake.lock
generated
42
flake.lock
generated
@@ -58,11 +58,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1773025010,
|
||||
"narHash": "sha256-khlHllTsovXgT2GZ0WxT4+RvuMjNeR5OW0UYeEHPYQo=",
|
||||
"lastModified": 1769524058,
|
||||
"narHash": "sha256-zygdD6X1PcVNR2PsyK4ptzrVEiAdbMqLos7utrMDEWE=",
|
||||
"owner": "nix-community",
|
||||
"repo": "disko",
|
||||
"rev": "7b9f7f88ab3b339f8142dc246445abb3c370d3d3",
|
||||
"rev": "71a3fc97d80881e91710fe721f1158d3b96ae14d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -203,11 +203,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1773264488,
|
||||
"narHash": "sha256-rK0507bDuWBrZo+0zts9bCs/+RRUEHuvFE5DHWPxX/Q=",
|
||||
"lastModified": 1770260404,
|
||||
"narHash": "sha256-3iVX1+7YUIt23hBx1WZsUllhbmP2EnXrV8tCRbLxHc8=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "5c0f63f8d55040a7eed69df7e3fcdd15dfb5a04c",
|
||||
"rev": "0d782ee42c86b196acff08acfbf41bb7d13eed5b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -445,11 +445,11 @@
|
||||
},
|
||||
"nixos-hardware": {
|
||||
"locked": {
|
||||
"lastModified": 1772972630,
|
||||
"narHash": "sha256-mUJxsNOrBMNOUJzN0pfdVJ1r2pxeqm9gI/yIKXzVVbk=",
|
||||
"lastModified": 1770882871,
|
||||
"narHash": "sha256-nw5g+xl3veea+maxJ2/81tMEA/rPq9aF1H5XF35X+OE=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixos-hardware",
|
||||
"rev": "3966ce987e1a9a164205ac8259a5fe8a64528f72",
|
||||
"rev": "af04cb78aa85b2a4d1c15fc7270347e0d0eda97b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -491,11 +491,11 @@
|
||||
},
|
||||
"nixpkgs-unstable": {
|
||||
"locked": {
|
||||
"lastModified": 1772963539,
|
||||
"narHash": "sha256-9jVDGZnvCckTGdYT53d/EfznygLskyLQXYwJLKMPsZs=",
|
||||
"lastModified": 1770841267,
|
||||
"narHash": "sha256-9xejG0KoqsoKEGp2kVbXRlEYtFFcDTHjidiuX8hGO44=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "9dcb002ca1690658be4a04645215baea8b95f31d",
|
||||
"rev": "ec7c70d12ce2fc37cb92aff673dcdca89d187bae",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -535,11 +535,11 @@
|
||||
},
|
||||
"nixpkgs_4": {
|
||||
"locked": {
|
||||
"lastModified": 1773068389,
|
||||
"narHash": "sha256-vMrm7Pk2hjBRPnCSjhq1pH0bg350Z+pXhqZ9ICiqqCs=",
|
||||
"lastModified": 1770770419,
|
||||
"narHash": "sha256-iKZMkr6Cm9JzWlRYW/VPoL0A9jVKtZYiU4zSrVeetIs=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "44bae273f9f82d480273bab26f5c50de3724f52f",
|
||||
"rev": "6c5e707c6b5339359a9a9e215c5e66d6d802fd7a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -647,11 +647,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1773096132,
|
||||
"narHash": "sha256-M3zEnq9OElB7zqc+mjgPlByPm1O5t2fbUrH3t/Hm5Ag=",
|
||||
"lastModified": 1770683991,
|
||||
"narHash": "sha256-xVfPvXDf9QN3Eh9dV+Lw6IkWG42KSuQ1u2260HKvpnc=",
|
||||
"owner": "Mic92",
|
||||
"repo": "sops-nix",
|
||||
"rev": "d1ff3b1034d5bab5d7d8086a7803c5a5968cd784",
|
||||
"rev": "8b89f44c2cc4581e402111d928869fe7ba9f7033",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -786,11 +786,11 @@
|
||||
"yazi-flavors": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1772541353,
|
||||
"narHash": "sha256-ZXJx4iwGCAi6qqDiLSuJvX3UL6XzypxSO7ptspDD/Yw=",
|
||||
"lastModified": 1770522883,
|
||||
"narHash": "sha256-tCAJXPV7s1akc+zHGdWjmdMPG4NpBE92vcO7LAvI5TI=",
|
||||
"owner": "yazi-rs",
|
||||
"repo": "flavors",
|
||||
"rev": "c02c804bb7c8873da8182745654fb57dc63b7348",
|
||||
"rev": "4c5753789ea535540e868e2764127be9230cef23",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
@@ -35,6 +35,13 @@
|
||||
|
||||
# systemd.user.startServices = "sd-switch"; # TODO: what is this
|
||||
|
||||
# Expire old hm generations
|
||||
hm-expire = {
|
||||
enable = true;
|
||||
dates = "weekly";
|
||||
expire = "-30 days";
|
||||
};
|
||||
|
||||
programs = {
|
||||
home-manager.enable = true;
|
||||
git.enable = true;
|
||||
|
||||
@@ -39,6 +39,20 @@
|
||||
"ca-derivations"
|
||||
];
|
||||
|
||||
# Expire old hm generations
|
||||
hm-expire = {
|
||||
enable = true;
|
||||
dates = "weekly";
|
||||
expire = "-30 days";
|
||||
};
|
||||
# Remove unused packets
|
||||
services.nix-gc = {
|
||||
enable = true;
|
||||
automatic = true;
|
||||
frequency = "weekly";
|
||||
persistent = true;
|
||||
};
|
||||
|
||||
# nix.settings. # warn-dirty = false; # TODO: do I want this
|
||||
#
|
||||
# Ensure we can still build when missing-server is not accessible
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
../common/optional/podman.nix
|
||||
../common/optional/wireguard.nix
|
||||
../common/optional/wireshark.nix
|
||||
../common/optional/flatpak.nix
|
||||
|
||||
../common/optional/avahi.nix
|
||||
|
||||
@@ -28,10 +28,12 @@
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 30d";
|
||||
persistent = true;
|
||||
};
|
||||
nix.optimise = {
|
||||
automatic = true;
|
||||
dates = ["weekly"]; # Optional; allows customizing optimisation schedule
|
||||
persistent = true;
|
||||
};
|
||||
|
||||
programs.nix-ld.enable = true;
|
||||
|
||||
9
hosts/common/optional/wireshark.nix
Normal file
9
hosts/common/optional/wireshark.nix
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
programs.wireshark = {
|
||||
enable = true;
|
||||
dumpcap.enable = true;
|
||||
usbmon.enable = true;
|
||||
};
|
||||
|
||||
users.users.julian.extraGroups = ["wireshark"];
|
||||
}
|
||||
@@ -5,4 +5,5 @@
|
||||
colors = import ./colors.nix;
|
||||
hostname = import ./hostname.nix;
|
||||
non-nixos = import ./non-nixos.nix;
|
||||
hm-expire = import ./hm-expire.nix;
|
||||
}
|
||||
|
||||
46
modules/home-manager/hm-expire.nix
Normal file
46
modules/home-manager/hm-expire.nix
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.hm-expire;
|
||||
in {
|
||||
options.hm-expire = {
|
||||
enable = lib.mkEnableOption "Whether to enable hm-expire";
|
||||
dates = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "weekly";
|
||||
};
|
||||
expire = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "-30 days";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
# This creates a user-level systemd service
|
||||
systemd.user.services.cleanup-home-manager = {
|
||||
Unit = {
|
||||
Description = "Cleanup old Home Manager generations";
|
||||
};
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${pkgs.bash}/bin/bash -c '${pkgs.home-manager}/bin/home-manager expire-generations \"${cfg.expire}\"'";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.timers.cleanup-home-manager = {
|
||||
Unit = {
|
||||
Description = "Weekly cleanup of Home Manager generations";
|
||||
};
|
||||
Timer = {
|
||||
OnCalendar = cfg.dates;
|
||||
Persistent = true;
|
||||
};
|
||||
Install = {
|
||||
WantedBy = ["timers.target"];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user