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
service-wrapper: init at 16.04.0 #20423
Conversation
name = "service-wrapper-${version}"; | ||
version = "16.04.0"; # Ajar to Ubuntu Release | ||
|
||
inherit src; |
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.
Better would be to separate real service-wrapper
to separate file and use it in src:
src = ./service-wrapper.sh;
You don't need to pass src as attribute because you can directly override derivation attributes (lib.overrideDerivation
) later as you wish.
|
||
inherit src; | ||
|
||
unpackCmd = '' |
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.
unpackCmd, dontBuild, installPhase and postFixup can be replaced by single phase - buildCommand
But in that case you probably would find it better to use lib.runCommand
or lib.writeScriptBin
@danbst Nice hints. We need these things in documentation. |
basic |
Push/Ping :) |
in | ||
runCommand "${name}" { | ||
script = substituteAll { | ||
src = ./service-wrapper.sh; |
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 an URL, where this could be downloaded from?
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.
Unfortunately no :(
Motivation for this change
Add the service-wrapper script to Nix (mainly to NixOS). If you are familiar with SystemV or Upstart, you are used to do something like
service cron restart
instead of
systemctl restart cron
(arguments transposed). This commit adds a package named service-wrapper. It wraps commands with
service
tosystemctl
(compare the same script on Ubuntu, Debian and RedHat).Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)