Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 38 lines 894 B view raw
1{ 2 lib, 3 stdenv, 4 runCommand, 5 replaceVarsWith, 6 coreutils, 7}: 8 9let 10 name = "service-wrapper-${version}"; 11 version = "19.04"; # Akin to Ubuntu Release 12in 13runCommand name 14 { 15 script = replaceVarsWith { 16 src = ./service-wrapper.sh; 17 isExecutable = true; 18 replacements = { 19 inherit (stdenv) shell; 20 inherit coreutils; 21 }; 22 }; 23 24 meta = with lib; { 25 description = "Convenient wrapper for the systemctl commands, borrow from Ubuntu"; 26 mainProgram = "service"; 27 license = licenses.gpl2Plus; 28 platforms = platforms.linux; 29 maintainers = with maintainers; [ DerTim1 ]; 30 # Shellscript has been modified but upstream source is: https://git.launchpad.net/ubuntu/+source/init-system-helpers 31 }; 32 } 33 '' 34 mkdir -p $out/bin 35 ln -s $out/bin $out/sbin 36 cp $script $out/bin/service 37 chmod a+x $out/bin/service 38 ''