From a207695b2b9762a8325c6c64ba59d29e8303585e Mon Sep 17 00:00:00 2001 From: Rouven Seifert Date: Thu, 13 Apr 2023 14:24:39 +0200 Subject: [PATCH] configured the purge bot --- flake.lock | 22 +++++++++++++++++++ flake.nix | 7 ++++++ hosts/falkenstein-1/modules/purge/default.nix | 18 +++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 hosts/falkenstein-1/modules/purge/default.nix diff --git a/flake.lock b/flake.lock index 672b868..2afb1e2 100644 --- a/flake.lock +++ b/flake.lock @@ -444,6 +444,27 @@ "type": "github" } }, + "purge": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1681388319, + "narHash": "sha256-vyZKyXkF/EvgHa3V9eh0RcFr+GpryX8BTp39X8xw6qw=", + "owner": "therealr5", + "repo": "purge", + "rev": "706233355bb912a0a41654773bce1e64a92aef0c", + "type": "github" + }, + "original": { + "owner": "therealr5", + "ref": "nix", + "repo": "purge", + "type": "github" + } + }, "root": { "inputs": { "flake-utils": "flake-utils", @@ -455,6 +476,7 @@ "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs_2", "nixvim": "nixvim", + "purge": "purge", "sops-nix": "sops-nix", "xdph": "xdph" } diff --git a/flake.nix b/flake.nix index 137ed43..11080c6 100644 --- a/flake.nix +++ b/flake.nix @@ -57,6 +57,11 @@ flake-utils.follows = "flake-utils"; }; }; + + purge = { + url = github:therealr5/purge/nix; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = @@ -69,6 +74,7 @@ , nix-colors , nixos-hardware , nixvim + , purge , ... }@attrs: { formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt; @@ -114,6 +120,7 @@ ./hosts/falkenstein-1 ./shared sops-nix.nixosModules.sops + purge.nixosModules.default ]; }; }; diff --git a/hosts/falkenstein-1/modules/purge/default.nix b/hosts/falkenstein-1/modules/purge/default.nix new file mode 100644 index 0000000..cfe3a07 --- /dev/null +++ b/hosts/falkenstein-1/modules/purge/default.nix @@ -0,0 +1,18 @@ +{ config, pkgs, ... }: +let + domain = "purge.rfive.de"; +in +{ + sops.secrets."purge/environment".owner = "purge"; + services.purge = { + enable = true; + environmentFile = config.sops.secrets."purge/environment".path; + }; + services.nginx.virtualHosts."${domain}" = { + enableACME = true; + forceSSL = true; + locations."/" = { + proxyPass = "http://127.0.0.1:${toString config.services.purge.port}"; + }; + }; +}