2019-01-15 23:41:31 +01:00
|
|
|
{ stdenv, runCommand, substituteAll, coreutils }:
|
2016-11-14 14:56:24 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
name = "service-wrapper-${version}";
|
2019-04-28 18:35:34 +02:00
|
|
|
version = "19.04"; # Akin to Ubuntu Release
|
2016-11-14 14:56:24 +01:00
|
|
|
in
|
2019-09-09 01:38:31 +02:00
|
|
|
runCommand name {
|
2016-11-14 14:56:24 +01:00
|
|
|
script = substituteAll {
|
|
|
|
src = ./service-wrapper.sh;
|
2019-03-06 00:10:34 +01:00
|
|
|
isExecutable = true;
|
2019-01-15 23:41:31 +01:00
|
|
|
inherit (stdenv) shell;
|
2016-11-14 14:56:24 +01:00
|
|
|
inherit coreutils;
|
|
|
|
};
|
|
|
|
|
2019-01-15 23:41:31 +01:00
|
|
|
meta = with stdenv.lib; {
|
2016-11-14 14:56:24 +01:00
|
|
|
description = "A convenient wrapper for the systemctl commands, borrow from Ubuntu";
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ DerTim1 ];
|
2019-04-28 18:35:34 +02:00
|
|
|
# Shellscript has been modified but upstream source is: https://git.launchpad.net/ubuntu/+source/init-system-helpers
|
2016-11-14 14:56:24 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
ln -s $out/bin $out/sbin
|
|
|
|
cp $script $out/bin/service
|
|
|
|
chmod a+x $out/bin/service
|
|
|
|
''
|