Allow to easily override the assertion for supported distros.

This commit is contained in:
r-vdp 2023-03-23 14:57:18 +01:00
parent 9278cc8be8
commit 84a4ddac1e
No known key found for this signature in database

View file

@ -15,6 +15,8 @@
default = [ ];
};
allowAnyDistro = lib.mkEnableOption "the usage of system-manager on untested distributions";
preActivationAssertions = lib.mkOption {
type = with lib.types; attrsOf (submodule ({ name, ... }: {
options = {
@ -70,7 +72,7 @@
supportedIds = [ "nixos" "ubuntu" ];
in
{
enable = true;
enable = !config.system-manager.allowAnyDistro;
script = ''
source /etc/os-release
${lib.concatStringsSep "\n" (lib.flip map supportedIds (supportedId: ''