nixos/lvm: replace boot.isContainer with services.lvm.enable

This commit is contained in:
Sandro Jäckel 2022-10-26 17:21:07 +02:00 committed by Sandro Jäckel
parent f26896669b
commit 5452a26077
No known key found for this signature in database
GPG Key ID: 3AF5A43A3EECC2E5
2 changed files with 8 additions and 1 deletions

View File

@ -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 ];

View File

@ -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";