nixos/lvm: replace boot.isContainer with services.lvm.enable
This commit is contained in:
parent
f26896669b
commit
5452a26077
@ -5,6 +5,10 @@ let
|
||||
cfg = config.services.lvm;
|
||||
in {
|
||||
options.services.lvm = {
|
||||
enable = mkEnableOption (lib.mdDoc "lvm2") // {
|
||||
default = true;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.lvm2;
|
||||
@ -30,7 +34,7 @@ in {
|
||||
# minimal configuration file to make lvmconfig/lvm2-activation-generator happy
|
||||
environment.etc."lvm/lvm.conf".text = "config {}";
|
||||
})
|
||||
(mkIf (!config.boot.isContainer) {
|
||||
(mkIf cfg.enable {
|
||||
systemd.tmpfiles.packages = [ cfg.package.out ];
|
||||
environment.systemPackages = [ cfg.package ];
|
||||
systemd.packages = [ cfg.package ];
|
||||
|
@ -19,6 +19,9 @@ with lib;
|
||||
# containers do not need to setup devices
|
||||
services.udev.enable = false;
|
||||
|
||||
# containers normally do not need to manage logical volumes
|
||||
services.lvm.enable = lib.mkDefault false;
|
||||
|
||||
# Shut up warnings about not having a boot loader.
|
||||
system.build.installBootLoader = lib.mkDefault "${pkgs.coreutils}/bin/true";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user