Unverified Commit 122fe8c7 authored by K900's avatar K900 Committed by GitHub
Browse files

Revert "nixos/qemu-vm: replace postBootCommands by a systemd service"

parent 99d0ec30
Loading
Loading
Loading
Loading
+5 −19
Original line number Diff line number Diff line
@@ -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 = ''
    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]}"
        ${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";