From 054103a00465cbb5de7f0ac49a2712595e3c7313 Mon Sep 17 00:00:00 2001 From: oddlama Date: Mon, 18 Dec 2023 02:19:38 +0100 Subject: [PATCH] fix: only set boot.initrd.systemd.enable = true for non containers --- modules/config/boot.nix | 28 +++++++++++++++------------- modules/guests/container.nix | 2 +- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/modules/config/boot.nix b/modules/config/boot.nix index ee0f69a..9c4fad1 100644 --- a/modules/config/boot.nix +++ b/modules/config/boot.nix @@ -4,20 +4,22 @@ pkgs, ... }: { - boot = { - initrd.systemd = { - enable = true; - emergencyAccess = config.repo.secrets.global.root.hashedPassword; - # TODO good idea? targets.emergency.wants = ["network.target" "sshd.service"]; - extraBin.ip = "${pkgs.iproute2}/bin/ip"; + config = lib.mkIf (!config.boot.isContainer) { + boot = { + initrd.systemd = { + enable = true; + emergencyAccess = config.repo.secrets.global.root.hashedPassword; + # TODO good idea? targets.emergency.wants = ["network.target" "sshd.service"]; + extraBin.ip = "${pkgs.iproute2}/bin/ip"; + }; + + # NOTE: Add "rd.systemd.unit=rescue.target" to debug initrd + kernelParams = ["log_buf_len=10M"]; + tmp.useTmpfs = true; + + loader.timeout = lib.mkDefault 2; }; - # NOTE: Add "rd.systemd.unit=rescue.target" to debug initrd - kernelParams = ["log_buf_len=10M"]; - tmp.useTmpfs = true; - - loader.timeout = lib.mkDefault 2; + console.earlySetup = true; }; - - console.earlySetup = true; } diff --git a/modules/guests/container.nix b/modules/guests/container.nix index 96f936c..c312600 100644 --- a/modules/guests/container.nix +++ b/modules/guests/container.nix @@ -15,7 +15,7 @@ guestName: guestCfg: { substring ; - initialLinkName = "mv-${(substring 0 13 (builtins.hashString "sha256" guestName))}"; + initialLinkName = "mv-${(substring 0 12 (builtins.hashString "sha256" guestName))}"; in { autoStart = guestCfg.autostart; macvlans = ["${guestCfg.container.macvlan}:${initialLinkName}"];