mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-01 23:22:37 +00:00
disnix: add a target for services activated and deactivated by dysnomia
This commit is contained in:
parent
67e03d0c50
commit
a744aa74aa
@ -121,6 +121,7 @@ in
|
|||||||
disnix =
|
disnix =
|
||||||
{ description = "Disnix server";
|
{ description = "Disnix server";
|
||||||
|
|
||||||
|
wants = [ "dysnomia.target" ];
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
after = [ "dbus.service" ]
|
after = [ "dbus.service" ]
|
||||||
++ optional config.services.httpd.enable "httpd.service"
|
++ optional config.services.httpd.enable "httpd.service"
|
||||||
@ -137,6 +138,17 @@ in
|
|||||||
environment = {
|
environment = {
|
||||||
HOME = "/root";
|
HOME = "/root";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
preStart = ''
|
||||||
|
mkdir -p /etc/systemd-mutable/system
|
||||||
|
if [ ! -f /etc/systemd-mutable/system/dysnomia.target ]
|
||||||
|
then
|
||||||
|
( echo "[Unit]"
|
||||||
|
echo "Description=Services that are activated and deactivated by Dysnomia"
|
||||||
|
echo "After=final.target"
|
||||||
|
) > /etc/systemd-mutable/system/dysnomia.target
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
exec = "disnix-service";
|
exec = "disnix-service";
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user