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 = "Convenient wrapper for the systemctl commands, borrow from Ubuntu";
17 mainProgram = "service";
18 license = licenses.gpl2Plus;
19 platforms = platforms.linux;
20 maintainers = with maintainers; [ DerTim1 ];
21 # Shellscript has been modified but upstream source is: https://git.launchpad.net/ubuntu/+source/init-system-helpers
22 };
23}
24''
25 mkdir -p $out/bin
26 ln -s $out/bin $out/sbin
27 cp $script $out/bin/service
28 chmod a+x $out/bin/service
29''