-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add different init systems service files for Nix #6558
Open
unrooted
wants to merge
7
commits into
NixOS:master
Choose a base branch
from
unrooted:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
b3d4436
add OpenRC service for Nix
unrooted 746d37d
add Dinit service for Nix
unrooted a894729
add shepherd service file
unrooted 4420553
add runit service
unrooted 16b1fd3
Update misc/shepherd/nix-daemon.service.scm
unrooted 795bf59
Update misc/openrc/nix-daemon.service.in
unrooted e0a6aea
Update misc/runit/nix-daemon.service.in
unrooted File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
type = process | ||
command = /nix/var/nix/profiles/default/bin/nix-daemon --daemon | ||
smooth-recovery = true | ||
logfile = /var/run/nix-daemon.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/sbin/openrc-run | ||
|
||
name="${RC_SVCNAME}" | ||
description="Nix Daemon" | ||
command_args_background="--daemon" | ||
pidfile="/var/run/nix-daemon.pid" | ||
command="/nix/var/nix/profiles/default/bin/nix-daemon" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
sv check nix >/dev/null || exit 1 | ||
exec /nix/var/nix/profiles/default/bin/nix-daemon --daemon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
define nix-daemon | ||
(make <service> | ||
#:provides '(nix-daemon) | ||
#:docstring "nix-daemon, the nix package manager's daemon" | ||
#:start (make-forkexec-constructor | ||
'("/nix/var/nix/profiles/default/bin/nix-daemon")) | ||
#:stop (make-kill-destructor) | ||
#:respawn? #t) | ||
(register-services nix-daemon) | ||
|
||
(start nix-daemon) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is there a reason for the weird spacing? Does dinit require this? (6 spaces followed by 2 tabs here, and 6 spaces followed by 1 tab for the
logfile
)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've just noticed that. To be honest - I've just followed how some built-in service files on Artix look like. I've wanted to keep it the same way, so the


=
is in the same place. (ntpd and cronie service files, for example). I can fix it with next commit.Thanks for noticing. Besides from that, is there anything else? I'll for sure add more service files soon, however, my question is, should I declare some other things somewhere else to make it work with Nix? If so, where? Is the directory where the files are even OK?