auto upgrade

This commit is contained in:
Chris Dombroski 2024-04-13 16:30:55 -04:00
parent 3ebaf47f26
commit 3e5352ac53
2 changed files with 35 additions and 1 deletions

View file

@ -32,7 +32,14 @@
nixosConfigurations = {
smolboi = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [ ./systems/smolboi/configuration.nix ];
modules = [
./systems/smolboi/configuration.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.users.cdombroski = import ./systems/smolboi/home.nix;
}
];
};
orangepihole = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";

View file

@ -56,6 +56,7 @@
];
})
# # Adds the 'hello' command to your environment. It prints a friendly
# # "Hello, world!" when run.
# pkgs.hello
@ -74,6 +75,32 @@
# '')
];
systemd.user = {
services = {
autoupgrade = {
Service = {
WorkingDirectory = "/home/cdombroski/work/nix-configs";
Type = "oneshot";
ExecStart = "${pkgs.writeShellScript "upgrade-system" ''
${pkgs.nix}/bin/nix flake update
${pkgs.git}/bin/git add .
${pkgs.git}/bin/git commit -m "update flake"
${pkgs.git}/bin/git push
${pkgs.deploy-rs}/bin/deploy
''}";
};
};
};
timers = {
autoupgrade = {
Timer = {
OnCalendar = "daily";
};
Install.WantedBy = [ "timers.target" ];
};
};
};
nixpkgs.config = {
allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
"discord"