-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NixOS synergy + hot swap #18
base: master
Are you sure you want to change the base?
Conversation
Nixpkgs go stuff complained about the nested module in nix/nixos/test/socket-server, which is not a problem for go build.
nix/nixos/socketmaster-service.nix
Outdated
# Avoid automatic restarts. This will trigger a reload instead. | ||
reloadIfChanged = true; | ||
serviceConfig.ExecStart = [ | ||
"${systemConfig.socketmaster.package}/bin/socketmaster -command ${lib.escapeShellArg config.command} -start ${toString config.startMillis} -listen fd://3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"${systemConfig.socketmaster.package}/bin/socketmaster -command ${lib.escapeShellArg config.command} -start ${toString config.startMillis} -listen fd://3" | |
"${systemConfig.socketmaster.package}/bin/socketmaster -command /run/socketmaster/${config.name} -start ${toString config.startMillis} -listen fd://3" |
If I'm not mistaken the command needs to point to a mutable location so that on reload, it would load the new command.
As an aside, the command script might also include a bunch of env vars.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I figured this could be covered by an entry in a config file instead. Not dissimilar to a systemd unit file, but far more limited, because we can't change many of those fancy settings like security or mounts related ones once the systemd service is running.
systemAttrs = eachDefaultSystem perSystem; | ||
|
||
in | ||
systemAttrs // flakeAttrs; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reminds me of flake-parts :)
Goals:
HUP