From 122fe8c72748d3e06a6b10afee45664ac4b1c4c7 Mon Sep 17 00:00:00 2001 From: K900 Date: Wed, 4 Mar 2026 20:49:27 +0300 Subject: [PATCH] Revert "nixos/qemu-vm: replace postBootCommands by a systemd service" --- nixos/modules/virtualisation/qemu-vm.nix | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/nixos/modules/virtualisation/qemu-vm.nix b/nixos/modules/virtualisation/qemu-vm.nix index 94e56a900c8a..5f001e05aa47 100644 --- a/nixos/modules/virtualisation/qemu-vm.nix +++ b/nixos/modules/virtualisation/qemu-vm.nix @@ -1236,25 +1236,11 @@ in # allow `system.build.toplevel' to be included. (If we had a direct # reference to ${regInfo} here, then we would get a cyclic # dependency.) - systemd.services.register-nix-paths = lib.mkIf config.nix.enable { - wantedBy = [ - "multi-user.target" - ]; - after = [ - "nix-daemon.service" - "nix-daemon.socket" - ]; - restartIfChanged = false; - serviceConfig = { - Type = "oneshot"; - RemainAfterExit = true; - }; - script = '' - if [[ "$(cat /proc/cmdline)" =~ regInfo=([^ ]*) ]]; then - ${config.nix.package.out}/bin/nix-store --load-db < "''${BASH_REMATCH[1]}" - fi - ''; - }; + boot.postBootCommands = lib.mkIf config.nix.enable '' + if [[ "$(cat /proc/cmdline)" =~ regInfo=([^ ]*) ]]; then + ${config.nix.package.out}/bin/nix-store --load-db < ''${BASH_REMATCH[1]} + fi + ''; boot.initrd.availableKernelModules = optional (cfg.qemu.diskInterface == "scsi") "sym53c8xx" ++ optional (cfg.tpm.enable) "tpm_tis";