Skip to content

Commit

Permalink
nixos-module: Type=oneshot
Browse files Browse the repository at this point in the history
This may improve the shutdown behavior
  • Loading branch information
roberth committed Jun 24, 2024
1 parent 6b1c8bd commit 311e3a1
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions nixos-module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,22 @@ let
cfg.docker.client.package
];
environment.ARION_PREBUILT = config.settings.out.dockerComposeYaml;
script = ''
echo 1>&2 "docker compose file: $ARION_PREBUILT"
arion --prebuilt-file "$ARION_PREBUILT" up
'';
serviceConfig.Type = "oneshot";
serviceConfig.RemainAfterExit = true;
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
''))
];
};
};
};
Expand Down

0 comments on commit 311e3a1

Please sign in to comment.