Add stateVersion option

This commit is contained in:
Tobias Happ 2019-11-29 13:28:25 +01:00 committed by Alexander Sosedkin
parent d87275a4f8
commit 6c80065616
3 changed files with 37 additions and 0 deletions

View file

@ -24,6 +24,9 @@
#unzip #unzip
]; ];
# Read the changelog before changing this value
system.stateVersion = "19.09";
# After installing home-manager channel like # After installing home-manager channel like
# nix-channel --add https://github.com/rycee/home-manager/archive/master.tar.gz home-manager # nix-channel --add https://github.com/rycee/home-manager/archive/master.tar.gz home-manager
# nix-channel --update # nix-channel --update

View file

@ -11,5 +11,6 @@
./environment/path.nix ./environment/path.nix
./home-manager.nix ./home-manager.nix
./user.nix ./user.nix
./version.nix
<nixpkgs/nixos/modules/misc/assertions.nix> <nixpkgs/nixos/modules/misc/assertions.nix>
] ]

33
modules/version.nix Normal file
View file

@ -0,0 +1,33 @@
# Licensed under GNU Lesser General Public License v3 or later, see COPYING.
# Copyright (c) 2019 Alexander Sosedkin and other contributors, see AUTHORS.
{ config, lib, pkgs, ... }:
with lib;
{
###### interface
options = {
system.stateVersion = mkOption {
type = types.enum [ "19.09" ];
default = "19.09";
description = ''
It is occasionally necessary for nix-on-droid to change
configuration defaults in a way that is incompatible with
stateful data. This could, for example, include switching the
default data format or location of a file.
</para><para>
The <emphasis>state version</emphasis> indicates which default
settings are in effect and will therefore help avoid breaking
program configurations. Switching to a higher state version
typically requires performing some manual steps, such as data
conversion or moving files.
'';
};
};
}