nixos-module: Type=oneshot
This may improve the shutdown behavior
This commit is contained in:
parent
7f6c58f210
commit
0437b5f9a4
1 changed files with 16 additions and 4 deletions
|
@ -42,10 +42,22 @@ let
|
||||||
cfg.docker.client.package
|
cfg.docker.client.package
|
||||||
];
|
];
|
||||||
environment.ARION_PREBUILT = config.settings.out.dockerComposeYaml;
|
environment.ARION_PREBUILT = config.settings.out.dockerComposeYaml;
|
||||||
script = ''
|
serviceConfig.Type = "oneshot";
|
||||||
echo 1>&2 "docker compose file: $ARION_PREBUILT"
|
serviceConfig.RemainAfterExit = true;
|
||||||
arion --prebuilt-file "$ARION_PREBUILT" up
|
serviceConfig.ExecStart = [
|
||||||
'';
|
(lib.getExe (pkgs.writeScriptBin "nixos-arion-start" ''
|
||||||
|
#!${pkgs.runtimeShell}
|
||||||
|
echo 1>&2 "starting arion project: $ARION_PREBUILT"
|
||||||
|
arion --prebuilt-file "$ARION_PREBUILT" up --detach
|
||||||
|
''))
|
||||||
|
];
|
||||||
|
serviceConfig.ExecStop = [
|
||||||
|
(lib.getExe (pkgs.writeScriptBin "nixos-arion-stop" ''
|
||||||
|
#!${pkgs.runtimeShell}
|
||||||
|
echo 1>&2 "stopping arion project: $ARION_PREBUILT"
|
||||||
|
arion --prebuilt-file "$ARION_PREBUILT" down
|
||||||
|
''))
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue