From 2e175f8c107ef7c32e16f3c56fd71c3377f2bfea Mon Sep 17 00:00:00 2001 From: Inex Code Date: Fri, 17 Mar 2023 14:50:54 +0300 Subject: [PATCH] feat: Add state version --- configuration.nix | 1 + variables-module.nix | 7 +++++++ variables.nix | 1 + 3 files changed, 9 insertions(+) diff --git a/configuration.nix b/configuration.nix index 1f2ba8c..513f854 100644 --- a/configuration.nix +++ b/configuration.nix @@ -89,6 +89,7 @@ in allowReboot = config.services.userdata.autoUpgrade.allowReboot; channel = "https://channel.selfprivacy.org/nixos-selfpricacy"; }; + system.stateVersion = config.services.userdata.stateVersion; nix = { optimise.automatic = true; gc = { diff --git a/variables-module.nix b/variables-module.nix index 6fd24f9..82b1db5 100644 --- a/variables-module.nix +++ b/variables-module.nix @@ -41,6 +41,13 @@ in type = types.nullOr types.bool; }; }; + stateVersion = mkOption { + description = '' + State version of the server + ''; + type = types.string; + default = "22.11"; + }; ######################## # Server admin options # ######################## diff --git a/variables.nix b/variables.nix index d129077..b9a7366 100644 --- a/variables.nix +++ b/variables.nix @@ -7,6 +7,7 @@ in hostname = lib.attrsets.attrByPath [ "hostname" ] null jsonData; domain = lib.attrsets.attrByPath [ "domain" ] null jsonData; timezone = lib.attrsets.attrByPath [ "timezone" ] "Europe/Uzhgorod" jsonData; + stateVersion = lib.attrsets.attrByPath [ "stateVersion" ] "22.05" jsonData; autoUpgrade = { enable = lib.attrsets.attrByPath [ "autoUpgrade" "enable" ] true jsonData; allowReboot = lib.attrsets.attrByPath [ "autoUpgrade" "allowReboot" ] true jsonData;