Allow to easily override the assertion for supported distros.
This commit is contained in:
parent
9278cc8be8
commit
84a4ddac1e
1 changed files with 3 additions and 1 deletions
|
|
@ -15,6 +15,8 @@
|
||||||
default = [ ];
|
default = [ ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
allowAnyDistro = lib.mkEnableOption "the usage of system-manager on untested distributions";
|
||||||
|
|
||||||
preActivationAssertions = lib.mkOption {
|
preActivationAssertions = lib.mkOption {
|
||||||
type = with lib.types; attrsOf (submodule ({ name, ... }: {
|
type = with lib.types; attrsOf (submodule ({ name, ... }: {
|
||||||
options = {
|
options = {
|
||||||
|
|
@ -70,7 +72,7 @@
|
||||||
supportedIds = [ "nixos" "ubuntu" ];
|
supportedIds = [ "nixos" "ubuntu" ];
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
enable = true;
|
enable = !config.system-manager.allowAnyDistro;
|
||||||
script = ''
|
script = ''
|
||||||
source /etc/os-release
|
source /etc/os-release
|
||||||
${lib.concatStringsSep "\n" (lib.flip map supportedIds (supportedId: ''
|
${lib.concatStringsSep "\n" (lib.flip map supportedIds (supportedId: ''
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue