feat: Add state version

This commit is contained in:
Inex Code 2023-03-17 14:50:54 +03:00
parent 497cf28ecc
commit 2e175f8c10
3 changed files with 9 additions and 0 deletions

View file

@ -89,6 +89,7 @@ in
allowReboot = config.services.userdata.autoUpgrade.allowReboot; allowReboot = config.services.userdata.autoUpgrade.allowReboot;
channel = "https://channel.selfprivacy.org/nixos-selfpricacy"; channel = "https://channel.selfprivacy.org/nixos-selfpricacy";
}; };
system.stateVersion = config.services.userdata.stateVersion;
nix = { nix = {
optimise.automatic = true; optimise.automatic = true;
gc = { gc = {

View file

@ -41,6 +41,13 @@ in
type = types.nullOr types.bool; type = types.nullOr types.bool;
}; };
}; };
stateVersion = mkOption {
description = ''
State version of the server
'';
type = types.string;
default = "22.11";
};
######################## ########################
# Server admin options # # Server admin options #
######################## ########################

View file

@ -7,6 +7,7 @@ in
hostname = lib.attrsets.attrByPath [ "hostname" ] null jsonData; hostname = lib.attrsets.attrByPath [ "hostname" ] null jsonData;
domain = lib.attrsets.attrByPath [ "domain" ] null jsonData; domain = lib.attrsets.attrByPath [ "domain" ] null jsonData;
timezone = lib.attrsets.attrByPath [ "timezone" ] "Europe/Uzhgorod" jsonData; timezone = lib.attrsets.attrByPath [ "timezone" ] "Europe/Uzhgorod" jsonData;
stateVersion = lib.attrsets.attrByPath [ "stateVersion" ] "22.05" jsonData;
autoUpgrade = { autoUpgrade = {
enable = lib.attrsets.attrByPath [ "autoUpgrade" "enable" ] true jsonData; enable = lib.attrsets.attrByPath [ "autoUpgrade" "enable" ] true jsonData;
allowReboot = lib.attrsets.attrByPath [ "autoUpgrade" "allowReboot" ] true jsonData; allowReboot = lib.attrsets.attrByPath [ "autoUpgrade" "allowReboot" ] true jsonData;