nixpkgs/pkgs/by-name/se/service-wrapper/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
805 B
Nix
Raw Normal View History

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