From 5bd15a768ac403bb2195ce10bf1d4a47efea654f Mon Sep 17 00:00:00 2001 From: Alexander Tomokhov Date: Fri, 22 Dec 2023 23:04:03 +0400 Subject: [PATCH] system.stateVersion: default or config.selfprivacy.stateVersion --- configuration.nix | 4 +++- selfprivacy-module.nix | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/configuration.nix b/configuration.nix index fc8365f..ad22b24 100644 --- a/configuration.nix +++ b/configuration.nix @@ -78,7 +78,9 @@ "# Completely remove remnants of NIXOS_LUSTRATE." "R! /old-root" ]; - system.stateVersion = config.selfprivacy.stateVersion; + system.stateVersion = + lib.mkIf (config.selfprivacy.stateVersion != null) + config.selfprivacy.stateVersion; system.autoUpgrade = { enable = config.selfprivacy.autoUpgrade.enable; allowReboot = config.selfprivacy.autoUpgrade.allowReboot; diff --git a/selfprivacy-module.nix b/selfprivacy-module.nix index 268153a..b0fa077 100644 --- a/selfprivacy-module.nix +++ b/selfprivacy-module.nix @@ -36,7 +36,8 @@ with lib; }; stateVersion = mkOption { description = "State version of the server"; - type = types.str; + type = types.nullOr types.str; + default = null; }; ######################## # Server admin options #