Compare commits

3 Commits

Author SHA1 Message Date
Sovran_Systems
10ef36859d Merge pull request #132 from naturallaw777/copilot/fix-ownership-permissions
Replace tmpfiles rules with systemd oneshot service for recursive ownership fix on second drive
2026-04-07 16:41:54 -05:00
copilot-swe-agent[bot]
6d1c360c02 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>
2026-04-07 21:29:33 +00:00
copilot-swe-agent[bot]
3b73eb3bd1 Initial plan 2026-04-07 21:28:36 +00:00

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"; }