Skip to content

Commit

Permalink
recurring-donations: Run under recurring-donations user
Browse files Browse the repository at this point in the history
  • Loading branch information
nixbitcoin committed May 19, 2020
1 parent 5d01ea7 commit b8e10af
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions modules/recurring-donations.nix
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,21 @@ in {
};

config = mkIf cfg.enable {
users.users.recurring-donations = {
description = "recurring-donations User";
group = "recurring-donations";
extraGroups = [ "clightning" ];
};
users.groups.recurring-donations = {};

systemd.services.recurring-donations = {
description = "Run recurring-donations";
requires = [ "clightning.service" ];
after = [ "clightning.service" ];
path = with pkgs; [ nix-bitcoin.clightning curl torsocks sudo jq ];
serviceConfig = {
ExecStart = "${pkgs.bash}/bin/bash ${recurring-donations-script}";
# TODO: would be better if this was operator, but I don't get sudo
# working inside the shell script
User = "clightning";
User = "recurring-donations";
Type = "oneshot";
} // nix-bitcoin-services.defaultHardening
// nix-bitcoin-services.allowTor;
Expand Down

0 comments on commit b8e10af

Please sign in to comment.