chia: add chiactl binary to system packages
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing

This commit is contained in:
Jake Hillion 2023-07-23 15:28:11 +01:00
parent 092196d718
commit fca949f4f8

View File

@ -3,6 +3,16 @@
let
cfg = config.custom.chia;
chia = nixpkgs-chia.legacyPackages.x86_64-linux.chia;
ctl = pkgs.writeScriptBin "chiactl" ''
#! ${pkgs.runtimeShell}
sudo=exec
if [[ "$USER" != chia ]]; then
sudo='exec /run/wrappers/bin/sudo -u chia'
fi
$sudo ${chia}/bin/chia "$@"
'';
in
{
options.custom.chia = {
@ -35,7 +45,7 @@ in
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [ chia ];
environment.systemPackages = [ ctl ];
users.groups.chia = { };
users.users.chia = {