Move autoUpgrade back to flake.nix but use flake output instead of URL
Set autoUpgrade flake to current flake outpath but keeping nixpkgs update, means things won't automatically be rolled back if there's no internet connection. Keep using remote URL for server though to keep unattended updates.
This commit is contained in:
parent
b7a21f3377
commit
78f7af88a8
45
flake.nix
45
flake.nix
|
@ -14,6 +14,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = {
|
outputs = {
|
||||||
|
self,
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
home-manager,
|
home-manager,
|
||||||
stylix,
|
stylix,
|
||||||
|
@ -42,7 +43,11 @@
|
||||||
./hosts/${hostName}/configuration.nix
|
./hosts/${hostName}/configuration.nix
|
||||||
./hosts/${hostName}/hardware-configuration.nix
|
./hosts/${hostName}/hardware-configuration.nix
|
||||||
./system/default.nix
|
./system/default.nix
|
||||||
({pkgs, ...}: {
|
({
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
nix = {
|
nix = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
|
@ -66,9 +71,22 @@
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
system = {inherit stateVersion;};
|
|
||||||
networking = {inherit hostName;};
|
networking = {inherit hostName;};
|
||||||
programs.${shell}.enable = true;
|
programs.${shell}.enable = true;
|
||||||
|
system = {
|
||||||
|
inherit stateVersion;
|
||||||
|
autoUpgrade = {
|
||||||
|
enable = true;
|
||||||
|
flake = lib.mkDefault self.outPath;
|
||||||
|
flags = [
|
||||||
|
"--update-input"
|
||||||
|
"nixpkgs"
|
||||||
|
"--no-write-lock-file"
|
||||||
|
"-L" # print build logs
|
||||||
|
];
|
||||||
|
dates = "02:00";
|
||||||
|
};
|
||||||
|
};
|
||||||
users = {
|
users = {
|
||||||
defaultUserShell = pkgs.${shell};
|
defaultUserShell = pkgs.${shell};
|
||||||
users = let
|
users = let
|
||||||
|
@ -139,7 +157,6 @@
|
||||||
systemConfig {
|
systemConfig {
|
||||||
inherit hostName user system;
|
inherit hostName user system;
|
||||||
systemModules = [
|
systemModules = [
|
||||||
./system/autoupgrade.nix
|
|
||||||
./services/caddy.nix
|
./services/caddy.nix
|
||||||
./services/gitea.nix
|
./services/gitea.nix
|
||||||
./services/grafana.nix
|
./services/grafana.nix
|
||||||
|
@ -147,7 +164,9 @@
|
||||||
./services/sshd.nix
|
./services/sshd.nix
|
||||||
./services/syncthing.nix
|
./services/syncthing.nix
|
||||||
];
|
];
|
||||||
homeModules = [./home/default.nix];
|
homeModules = [
|
||||||
|
./home/default.nix
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
## Personal
|
## Personal
|
||||||
|
@ -164,7 +183,9 @@
|
||||||
./system/hyprland.nix
|
./system/hyprland.nix
|
||||||
./system/games.nix
|
./system/games.nix
|
||||||
];
|
];
|
||||||
homeModules = [./home/hyprland/default.nix];
|
homeModules = [
|
||||||
|
./home/hyprland/default.nix
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
Vanguard = let
|
Vanguard = let
|
||||||
|
@ -175,11 +196,12 @@
|
||||||
systemConfig {
|
systemConfig {
|
||||||
inherit hostName user system;
|
inherit hostName user system;
|
||||||
systemModules = [
|
systemModules = [
|
||||||
./system/autoupgrade.nix
|
|
||||||
./system/hyprland.nix
|
./system/hyprland.nix
|
||||||
./system/games.nix
|
./system/games.nix
|
||||||
];
|
];
|
||||||
homeModules = [./home/hyprland/default.nix];
|
homeModules = [
|
||||||
|
./home/hyprland/default.nix
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
## Work
|
## Work
|
||||||
|
@ -195,7 +217,9 @@
|
||||||
./system/laptop.nix
|
./system/laptop.nix
|
||||||
./system/hyprland.nix
|
./system/hyprland.nix
|
||||||
];
|
];
|
||||||
homeModules = [./home/hyprland/default.nix];
|
homeModules = [
|
||||||
|
./home/hyprland/default.nix
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
Scorch = let
|
Scorch = let
|
||||||
|
@ -206,10 +230,11 @@
|
||||||
systemConfig {
|
systemConfig {
|
||||||
inherit hostName user system;
|
inherit hostName user system;
|
||||||
systemModules = [
|
systemModules = [
|
||||||
./system/autoupgrade.nix
|
|
||||||
./system/hyprland.nix
|
./system/hyprland.nix
|
||||||
];
|
];
|
||||||
homeModules = [./home/hyprland/default.nix];
|
homeModules = [
|
||||||
|
./home/hyprland/default.nix
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{...}: {
|
{config, ...}: {
|
||||||
users.mutableUsers = false;
|
users.mutableUsers = false;
|
||||||
system.autoUpgrade = {
|
system.autoUpgrade = {
|
||||||
|
flake = "git+${config.nix.registry.nixos.to.url}";
|
||||||
randomizedDelaySec = "15min";
|
randomizedDelaySec = "15min";
|
||||||
allowReboot = true;
|
allowReboot = true;
|
||||||
rebootWindow = {
|
rebootWindow = {
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
{config, ...}: let
|
|
||||||
flakeURL = config.nix.registry.nixos.to.url;
|
|
||||||
in {
|
|
||||||
system.autoUpgrade = {
|
|
||||||
enable = true;
|
|
||||||
flake = "git+${flakeURL}";
|
|
||||||
flags = [
|
|
||||||
"--update-input"
|
|
||||||
"nixpkgs"
|
|
||||||
"--no-write-lock-file"
|
|
||||||
"-L" # print build logs
|
|
||||||
];
|
|
||||||
dates = "02:00";
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Reference in a new issue