-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4a424c5
commit 2e74219
Showing
5 changed files
with
67 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ config, lib, pkgs, ... }: | ||
|
||
with lib; | ||
let | ||
options = { | ||
nix-bitcoin-org.website.donate = { | ||
btcpayserverAppId = mkOption { | ||
type = types.str; | ||
}; | ||
}; | ||
}; | ||
|
||
cfg = config.nix-bitcoin-org.website.donate; | ||
|
||
btcpayserverAddress = with config.services.btcpayserver; "${address}:${toString port}"; | ||
in { | ||
inherit options; | ||
|
||
config = { | ||
nix-bitcoin-org.website.nginxHostConfig = '' | ||
location = /donate { | ||
rewrite /donate /btcpayserver/apps/${cfg.btcpayserverAppId}/pos; | ||
} | ||
location /btcpayserver/ { | ||
proxy_pass http://${btcpayserverAddress}; | ||
# Disallow access to the btcpayserver admin interface and the API | ||
location ~* ^/btcpayserver/(login|register|account|api|)(?:$|/) { | ||
return 404; | ||
} | ||
} | ||
''; | ||
}; | ||
} |