From 4b69c8d811d148bc59ccd58ecc91f2e7faf330bb Mon Sep 17 00:00:00 2001 From: xqtc161 Date: Tue, 14 May 2024 22:16:52 +0200 Subject: [PATCH 1/7] nax flake update --- flake.lock | 82 +++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 60 insertions(+), 22 deletions(-) diff --git a/flake.lock b/flake.lock index 89ef77b..73e54d7 100644 --- a/flake.lock +++ b/flake.lock @@ -49,11 +49,11 @@ }, "locked": { "dir": "pkgs/firefox-addons", - "lastModified": 1715077665, - "narHash": "sha256-m7t26gM7ckv65oqgHNNMN7+d2OAXBi6tvWinb1vZ0UI=", + "lastModified": 1715659401, + "narHash": "sha256-pqeXE2v8b3Hvvr4BP5Qco3j/KCG2MUOdNcfZk4KcVvQ=", "owner": "rycee", "repo": "nur-expressions", - "rev": "536d68d47657d50afe486fe559ab83018cfcca1c", + "rev": "78de0ad8fdb664b581614be18ce1cadf2674014b", "type": "gitlab" }, "original": { @@ -129,6 +129,21 @@ "type": "github" } }, + "flake-root": { + "locked": { + "lastModified": 1713493429, + "narHash": "sha256-ztz8JQkI08tjKnsTpfLqzWoKFQF4JGu2LRz8bkdnYUk=", + "owner": "srid", + "repo": "flake-root", + "rev": "bc748b93b86ee76e2032eecda33440ceb2532fcd", + "type": "github" + }, + "original": { + "owner": "srid", + "repo": "flake-root", + "type": "github" + } + }, "flake-utils": { "locked": { "lastModified": 1629284811, @@ -245,11 +260,11 @@ ] }, "locked": { - "lastModified": 1715077503, - "narHash": "sha256-AfHQshzLQfUqk/efMtdebHaQHqVntCMjhymQzVFLes0=", + "lastModified": 1715486357, + "narHash": "sha256-4pRuzsHZOW5W4CsXI9uhKtiJeQSUoe1d2M9mWU98HC4=", "owner": "nix-community", "repo": "home-manager", - "rev": "6e277d9566de9976f47228dd8c580b97488734d4", + "rev": "44677a1c96810a8e8c4ffaeaad10c842402647c1", "type": "github" }, "original": { @@ -267,11 +282,11 @@ ] }, "locked": { - "lastModified": 1714679908, - "narHash": "sha256-KzcXzDvDJjX34en8f3Zimm396x6idbt+cu4tWDVS2FI=", + "lastModified": 1715486357, + "narHash": "sha256-4pRuzsHZOW5W4CsXI9uhKtiJeQSUoe1d2M9mWU98HC4=", "owner": "nix-community", "repo": "home-manager", - "rev": "9036fe9ef8e15a819fa76f47a8b1f287903fb848", + "rev": "44677a1c96810a8e8c4ffaeaad10c842402647c1", "type": "github" }, "original": { @@ -321,11 +336,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1715010655, - "narHash": "sha256-FmdhvR/hgBkPDvIv/HOEIQsSMaVXh8wvTrnep8dF3Jc=", + "lastModified": 1715148395, + "narHash": "sha256-lRxjTxY3103LGMjWdVqntKZHhlmMX12QUjeFrQMmGaE=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "d1659c9eb8af718118fb4bbe2c86797c8b8623eb", + "rev": "a4e2b7909fc1bdf30c30ef21d388fde0b5cdde4a", "type": "github" }, "original": { @@ -353,11 +368,11 @@ }, "nixpkgs-master": { "locked": { - "lastModified": 1715108851, - "narHash": "sha256-NJj8+Qqqtka2xH2fQ1LFVKE3PBAR6GLRVRVsK58A8+4=", + "lastModified": 1715674092, + "narHash": "sha256-ufaMMDTnSb/jtiPSwy5zeGPl/pvCrp//Ee3fkD/u784=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "403d5963cc5ca2de87bc891dd9090c9995dc7a97", + "rev": "ea9b756c5a6e0f8ef6cc89c62b3e3a79ac1af236", "type": "github" }, "original": { @@ -401,11 +416,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1714906307, - "narHash": "sha256-UlRZtrCnhPFSJlDQE7M0eyhgvuuHBTe1eJ9N9AQlJQ0=", + "lastModified": 1715534503, + "narHash": "sha256-5ZSVkFadZbFP1THataCaSf0JH2cAH3S29hU9rrxTEqk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "25865a40d14b3f9cf19f19b924e2ab4069b09588", + "rev": "2057814051972fa1453ddfb0d98badbea9b83c06", "type": "github" }, "original": { @@ -436,19 +451,21 @@ "devshell": "devshell", "flake-compat": "flake-compat_2", "flake-parts": "flake-parts", + "flake-root": "flake-root", "home-manager": "home-manager_2", "nix-darwin": "nix-darwin", "nixpkgs": [ "nixpkgs" ], - "pre-commit-hooks": "pre-commit-hooks" + "pre-commit-hooks": "pre-commit-hooks", + "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1715093176, - "narHash": "sha256-zb0hnSNnniskSB/B9r3+zjQyJTwLT84Vm4WMz/v2ErI=", + "lastModified": 1715582453, + "narHash": "sha256-pW8a12PHt/PUphG8Tn0nb+mfbTS7JS4YbThGPepCcb0=", "owner": "nix-community", "repo": "nixvim", - "rev": "b731bedfb9a75f9d25da4d8e97a95f03eb863274", + "rev": "4530a35bad28a0e8b21905b0817a225e6387811c", "type": "github" }, "original": { @@ -593,6 +610,27 @@ "repo": "default", "type": "github" } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1714058656, + "narHash": "sha256-Qv4RBm4LKuO4fNOfx9wl40W2rBbv5u5m+whxRYUMiaA=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "c6aaf729f34a36c445618580a9f95a48f5e4e03f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } } }, "root": "root", From 692f64fe65e6c6459fc7377ae7bf6fb661ab0f8c Mon Sep 17 00:00:00 2001 From: xqtc161 Date: Thu, 16 May 2024 19:00:47 +0200 Subject: [PATCH 2/7] Enable forgejo on beleth --- hosts/x86_64-linux/beleth/default.nix | 1 + hosts/x86_64-linux/beleth/git.nix | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 hosts/x86_64-linux/beleth/git.nix diff --git a/hosts/x86_64-linux/beleth/default.nix b/hosts/x86_64-linux/beleth/default.nix index 6735696..f301d15 100644 --- a/hosts/x86_64-linux/beleth/default.nix +++ b/hosts/x86_64-linux/beleth/default.nix @@ -14,6 +14,7 @@ with lib; { ./transmission.nix ./lanrarari.nix ./uptime.nix + ./git.nix ../../gc.nix ../../../common ]; diff --git a/hosts/x86_64-linux/beleth/git.nix b/hosts/x86_64-linux/beleth/git.nix new file mode 100644 index 0000000..202a11c --- /dev/null +++ b/hosts/x86_64-linux/beleth/git.nix @@ -0,0 +1,6 @@ +{lib, inputs, ...}: +{ + services.forgejo = { + enable = true; + }; +} From 1d79b1c9655b7eb6c13ceac1f3a7fd0d7c5083b7 Mon Sep 17 00:00:00 2001 From: xqtc161 Date: Thu, 16 May 2024 19:06:02 +0200 Subject: [PATCH 3/7] Add forgejo to caddyfile --- hosts/x86_64-linux/beleth/default.nix | 7 +++++++ hosts/x86_64-linux/beleth/git.nix | 3 +++ 2 files changed, 10 insertions(+) diff --git a/hosts/x86_64-linux/beleth/default.nix b/hosts/x86_64-linux/beleth/default.nix index f301d15..437afd1 100644 --- a/hosts/x86_64-linux/beleth/default.nix +++ b/hosts/x86_64-linux/beleth/default.nix @@ -40,15 +40,22 @@ with lib; { root * /var/www/demos/ file_server browse } + git.heroin.trade { + reverse_proxy http://localhost:3001 + } + jellyfin.heroin.trade { reverse_proxy http://127.0.0.1:8096 } + calibre.heroin.trade { reverse_proxy http://localhost:3000 } + grafana.heroin.trade { reverse_proxy http://127.0.0.1:2342 } + uptime.heroin.trade { reverse_proxy 127.0.0.1:3001 } diff --git a/hosts/x86_64-linux/beleth/git.nix b/hosts/x86_64-linux/beleth/git.nix index 202a11c..a457f56 100644 --- a/hosts/x86_64-linux/beleth/git.nix +++ b/hosts/x86_64-linux/beleth/git.nix @@ -2,5 +2,8 @@ { services.forgejo = { enable = true; + settings.server = { + HTTP_PORT = 3001; + }; }; } From 90ebd62b04d8ed675f61457c348ff7a948497caf Mon Sep 17 00:00:00 2001 From: xqtc161 Date: Thu, 16 May 2024 19:08:16 +0200 Subject: [PATCH 4/7] Change forgejo port --- hosts/x86_64-linux/beleth/default.nix | 2 +- hosts/x86_64-linux/beleth/git.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hosts/x86_64-linux/beleth/default.nix b/hosts/x86_64-linux/beleth/default.nix index 437afd1..ad071b1 100644 --- a/hosts/x86_64-linux/beleth/default.nix +++ b/hosts/x86_64-linux/beleth/default.nix @@ -41,7 +41,7 @@ with lib; { file_server browse } git.heroin.trade { - reverse_proxy http://localhost:3001 + reverse_proxy http://localhost:3002 } jellyfin.heroin.trade { diff --git a/hosts/x86_64-linux/beleth/git.nix b/hosts/x86_64-linux/beleth/git.nix index a457f56..e300f04 100644 --- a/hosts/x86_64-linux/beleth/git.nix +++ b/hosts/x86_64-linux/beleth/git.nix @@ -3,7 +3,7 @@ services.forgejo = { enable = true; settings.server = { - HTTP_PORT = 3001; + HTTP_PORT = 3002; }; }; } From e02792574687c50ac95d805f9ca6c2317059b444 Mon Sep 17 00:00:00 2001 From: xqtc161 Date: Thu, 16 May 2024 19:15:20 +0200 Subject: [PATCH 5/7] Change forgejo root url --- hosts/x86_64-linux/beleth/git.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts/x86_64-linux/beleth/git.nix b/hosts/x86_64-linux/beleth/git.nix index e300f04..4466bcc 100644 --- a/hosts/x86_64-linux/beleth/git.nix +++ b/hosts/x86_64-linux/beleth/git.nix @@ -4,6 +4,7 @@ enable = true; settings.server = { HTTP_PORT = 3002; + ROOT_URL = "https://git.heroin.trade"; }; }; } From 7cb85302174e4603bd4b8fe72af29a440540e3c8 Mon Sep 17 00:00:00 2001 From: xqtc161 Date: Thu, 16 May 2024 19:22:28 +0200 Subject: [PATCH 6/7] disable forgejo registration --- hosts/x86_64-linux/beleth/git.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hosts/x86_64-linux/beleth/git.nix b/hosts/x86_64-linux/beleth/git.nix index 4466bcc..5f0f5fe 100644 --- a/hosts/x86_64-linux/beleth/git.nix +++ b/hosts/x86_64-linux/beleth/git.nix @@ -6,5 +6,10 @@ HTTP_PORT = 3002; ROOT_URL = "https://git.heroin.trade"; }; + settings = { + service = { + DISABLE_REGISTRATION = true; + }; + }; }; } From 6963e6e3667013c8ca5f44c9f29bd51332dcb8b7 Mon Sep 17 00:00:00 2001 From: xqtc161 Date: Thu, 16 May 2024 19:26:46 +0200 Subject: [PATCH 7/7] disable explore and api access if user is not signed in --- hosts/x86_64-linux/beleth/git.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts/x86_64-linux/beleth/git.nix b/hosts/x86_64-linux/beleth/git.nix index 5f0f5fe..e0d4fe2 100644 --- a/hosts/x86_64-linux/beleth/git.nix +++ b/hosts/x86_64-linux/beleth/git.nix @@ -9,6 +9,7 @@ settings = { service = { DISABLE_REGISTRATION = true; + REQUIRE_SIGNIN_VIEW = true; }; }; };