move nixos module to external file
Avoids anonymous imports which makes the module easier to find and reference.
This commit is contained in:
parent
d145ee2b5c
commit
762dd2dd84
2 changed files with 26 additions and 27 deletions
28
flake.nix
28
flake.nix
|
|
@ -55,33 +55,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
flake = {
|
flake = {
|
||||||
nixosModules.sidebus-vm =
|
nixosModules.sidebus-vm = ./nixosModules/sidebus-vm.nix;
|
||||||
{ ... }:
|
|
||||||
{
|
|
||||||
environment.sessionVariables.DBUS_SESSION_BUS_ADDRESS = "unix:path=/run/sidebus.sock";
|
|
||||||
systemd.sockets.sidebus-agent = {
|
|
||||||
# SocketMode= is 0666 by default
|
|
||||||
listenStreams = [ "/run/sidebus.sock" ];
|
|
||||||
wantedBy = [ "sockets.target" ];
|
|
||||||
documentation = [ "https://git.clan.lol/valpackett/sidebus" ];
|
|
||||||
};
|
|
||||||
systemd.services.sidebus-agent = {
|
|
||||||
# TODO: confinement (can do a lot)
|
|
||||||
serviceConfig = {
|
|
||||||
ExecStart = throw "sidebus-vm module requires setting systemd.services.sidebus-agent.serviceConfig.ExecStart to a sidebus-agent package";
|
|
||||||
ImportCredential = "sidebus.*";
|
|
||||||
};
|
|
||||||
documentation = [ "https://git.clan.lol/valpackett/sidebus" ];
|
|
||||||
};
|
|
||||||
systemd.mounts = [
|
|
||||||
{
|
|
||||||
type = "virtiofs";
|
|
||||||
what = "vm-doc-portal";
|
|
||||||
where = "/run/vm-doc-portal";
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
25
nixosModules/sidebus-vm.nix
Normal file
25
nixosModules/sidebus-vm.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
{
|
||||||
|
environment.sessionVariables.DBUS_SESSION_BUS_ADDRESS = "unix:path=/run/sidebus.sock";
|
||||||
|
systemd.sockets.sidebus-agent = {
|
||||||
|
# SocketMode= is 0666 by default
|
||||||
|
listenStreams = [ "/run/sidebus.sock" ];
|
||||||
|
wantedBy = [ "sockets.target" ];
|
||||||
|
documentation = [ "https://git.clan.lol/valpackett/sidebus" ];
|
||||||
|
};
|
||||||
|
systemd.services.sidebus-agent = {
|
||||||
|
# TODO: confinement (can do a lot)
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStart = throw "sidebus-vm module requires setting systemd.services.sidebus-agent.serviceConfig.ExecStart to a sidebus-agent package";
|
||||||
|
ImportCredential = "sidebus.*";
|
||||||
|
};
|
||||||
|
documentation = [ "https://git.clan.lol/valpackett/sidebus" ];
|
||||||
|
};
|
||||||
|
systemd.mounts = [
|
||||||
|
{
|
||||||
|
type = "virtiofs";
|
||||||
|
what = "vm-doc-portal";
|
||||||
|
where = "/run/vm-doc-portal";
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue