nix: autoupdate module

This commit is contained in:
Primrose 2024-12-06 19:43:19 +01:00
parent 6c5b9b3ed2
commit 8248d470dd
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA
2 changed files with 173 additions and 1 deletions

View file

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs, lib, ... }:
let
inherit (pkgs) myPkgs;
@ -48,4 +48,31 @@ in
i18n.inputMethod.enabled = "fcitx5";
services.autoupdate = {
enable = true;
settings =
let
updateInputs = lib.concatMapStrings (input: ''
${lib.getExe pkgs.nix} flake update ${input}
'');
in
{
"dotfiles" = {
path = "/home/leana/.dotfiles";
updateCommand = ''
${updateInputs [
"nixpkgs"
"home-manager"
"nur"
"flake-parts"
"pre-commit-hooks"
"deploy-rs"
]}
${lib.getExe pkgs.nix} build ".#nixosConfigurations.carbon.config.system.build.toplevel"
'';
commitMessageCommand = ''${lib.getExe pkgs.nvd} diff "/nix/var/nix/profiles/system" result'';
};
};
};
}