mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-15 14:26:33 +01:00
41 lines
841 B
Nix
41 lines
841 B
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
|
|
let
|
|
cfg = config.virtualisation.incus.agent;
|
|
in
|
|
{
|
|
meta = {
|
|
maintainers = lib.teams.lxc.members;
|
|
};
|
|
|
|
options = {
|
|
virtualisation.incus.agent.enable = lib.mkEnableOption "Incus agent";
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
services.udev.packages = [ config.virtualisation.incus.package.agent_loader ];
|
|
systemd.packages = [ config.virtualisation.incus.package.agent_loader ];
|
|
|
|
systemd.services.incus-agent = {
|
|
enable = true;
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
path = [
|
|
pkgs.kmod
|
|
pkgs.util-linux
|
|
|
|
# allow `incus exec` to find system binaries
|
|
"/run/current-system/sw"
|
|
];
|
|
|
|
# avoid killing nixos-rebuild switch when executed through incus exec
|
|
restartIfChanged = false;
|
|
stopIfChanged = false;
|
|
};
|
|
};
|
|
}
|