Skip to content

Commit df489a9

Browse files
Merge pull request #11 from ethannortharc/fix/nixos-incus-agent-service
fix: add incus-agent systemd service to NixOS module
2 parents 89bd8f7 + 868d99b commit df489a9

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

nix/devbox-module.nix

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,26 @@ in {
5050
virtualisation.docker.enable = lib.mkDefault (sets.container or false);
5151
services.tailscale.enable = lib.mkDefault (sets.network or false);
5252

53+
# ── Incus/LXD Agent ─────────────────────────────────
54+
# Required for `incus exec` to work after nixos-rebuild.
55+
# The agent binary is mounted at /run/incus_agent/ by the hypervisor;
56+
# this service starts it on boot so the host can communicate with the VM.
57+
systemd.services.incus-agent = {
58+
description = "Incus VM Agent";
59+
wantedBy = [ "multi-user.target" ];
60+
after = [ "network.target" "local-fs.target" ];
61+
serviceConfig = {
62+
Type = "notify";
63+
ExecStart = "/run/incus_agent/incus-agent";
64+
Restart = "always";
65+
RestartSec = 5;
66+
WorkingDirectory = "/run/incus_agent";
67+
};
68+
unitConfig = {
69+
ConditionPathExists = "/run/incus_agent/incus-agent";
70+
};
71+
};
72+
5373
# ── Dynamic linker compat ─────────────────────────
5474
# Required for VS Code Server, Cursor, and other dynamically linked
5575
# binaries that expect a standard FHS layout (ld-linux, libc, etc.).

0 commit comments

Comments
 (0)