Replace tmpfiles rules with systemd oneshot service for recursive chown on second drive

Agent-Logs-Url: https://github.com/naturallaw777/staging_alpha/sessions/96b8f8fe-5a1d-42e5-8b2d-5dd5aee96044

Co-authored-by: naturallaw777 <99053422+naturallaw777@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-04-07 21:29:33 +00:00
committed by GitHub
parent 3b73eb3bd1
commit 6d1c360c02

View File

@@ -70,10 +70,24 @@ lib.mkIf config.sovran_systemsOS.services.bitcoin {
nix-bitcoin.useVersionLockedPkgs = false; nix-bitcoin.useVersionLockedPkgs = false;
systemd.tmpfiles.rules = [ systemd.services.sovran-btc-permissions = {
"d /run/media/Second_Drive/BTCEcoandBackup/Bitcoin_Node 0770 bitcoin bitcoin -" description = "Fix Bitcoin/Electrs data directory ownership on second drive";
"d /run/media/Second_Drive/BTCEcoandBackup/Electrs_Data 0770 electrs electrs -" wantedBy = [ "multi-user.target" ];
]; after = [ "run-media-Second_Drive.mount" ];
before = [ "bitcoind.service" "electrs.service" ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
};
script = ''
if [ -d /run/media/Second_Drive/BTCEcoandBackup/Bitcoin_Node ]; then
chown -R bitcoin:bitcoin /run/media/Second_Drive/BTCEcoandBackup/Bitcoin_Node
fi
if [ -d /run/media/Second_Drive/BTCEcoandBackup/Electrs_Data ]; then
chown -R electrs:electrs /run/media/Second_Drive/BTCEcoandBackup/Electrs_Data
fi
'';
};
sovran_systemsOS.domainRequirements = [ sovran_systemsOS.domainRequirements = [
{ name = "btcpayserver"; label = "BTCPay Server"; example = "pay.yourdomain.com"; } { name = "btcpayserver"; label = "BTCPay Server"; example = "pay.yourdomain.com"; }