all: toggle system update based off status of the tree
Dirty means we are doing development on something so don't autoUpgrade the changes away.
This commit is contained in:
parent
734685410b
commit
8a23bd37e8
10
flake.nix
10
flake.nix
@ -76,7 +76,15 @@
|
||||
flakes.taskobs.overlay
|
||||
];
|
||||
|
||||
buildVer = { system.configurationRevision = self.rev or "DIRTY"; };
|
||||
# Set our configurationRevison based on the status of our git repo.
|
||||
# If the repo is dirty, disable autoUpgrade as it means we are
|
||||
# testing something.
|
||||
buildVer = let state = self.rev or "DIRTY";
|
||||
in {
|
||||
system.configurationRevision = state;
|
||||
system.autoUpgrade.enable = (state != "DIRTY");
|
||||
};
|
||||
|
||||
buildShell = pkgs:
|
||||
pkgs.mkShell {
|
||||
shellHook = ''
|
||||
|
@ -14,7 +14,8 @@ with lib; {
|
||||
config = mkMerge [
|
||||
(mkIf config.autoUpdate.enable {
|
||||
system.autoUpgrade = {
|
||||
enable = true;
|
||||
# enable is set in flake depending on the state of the tree
|
||||
# DIRTY means disabled, git revision means enabled
|
||||
allowReboot = mkDefault false;
|
||||
flake = "github:qbit/xin";
|
||||
dates = "*-*-* *:05:00";
|
||||
|
Loading…
Reference in New Issue
Block a user