1{ lib, stdenv, runCommand, substituteAll, coreutils }:
2
3let
4 name = "service-wrapper-${version}";
5 version = "19.04"; # Akin to Ubuntu Release
6in
7runCommand name {
8 script = substituteAll {
9 src = ./service-wrapper.sh;
10 isExecutable = true;
11 inherit (stdenv) shell;
12 inherit coreutils;
13 };
14
15 meta = with lib; {
16 description = "A convenient wrapper for the systemctl commands, borrow from Ubuntu";
17 license = licenses.gpl2Plus;
18 platforms = platforms.linux;
19 maintainers = with maintainers; [ DerTim1 ];
20 # Shellscript has been modified but upstream source is: https://git.launchpad.net/ubuntu/+source/init-system-helpers
21 };
22}
23''
24 mkdir -p $out/bin
25 ln -s $out/bin $out/sbin
26 cp $script $out/bin/service
27 chmod a+x $out/bin/service
28''