1
0
Fork 0
This commit is contained in:
Malte Brandy 2019-07-26 15:54:36 +02:00
parent 64d3e92cf4
commit 5ae3cfa7a2
No known key found for this signature in database
GPG key ID: 226A2D41EF5378C9

View file

@ -0,0 +1,22 @@
{ pkgs, config, lib, ... }:
let
inherit (import ../common/lib.nix) writeHaskellScript get-niv-path gcRetentionDays;
inherit (import ./lib.nix) update-home;
configPath = "/home/${config.home.username}/git/nixos/config";
home-maintenance = writeHaskellScript
{ name = "user-maintenance"; imports = [ ]; bins = [ (update-home configPath) pkgs.nix pkgs.git];} ''
main = do
git "-C" "${configPath}" "pull"
update_home
nix_collect_garbage "--delete-older-than" "${toString gcRetentionDays}d"
nix "optimise-store"
'';
in
{
home = {
packages = builtins.attrValues {
inherit home-maintenance get-niv-path;
update-home = update-home configPath;
};
};
}