From 5b589f7df8d77047f6270a3d079b55755e8428a0 Mon Sep 17 00:00:00 2001 From: Anish Lakhwara Date: Wed, 14 Dec 2022 01:05:56 +1000 Subject: [PATCH] attempting archive box --- flake.nix | 4 ++++ hosts/box/default.nix | 2 +- hosts/profiles/archivebox/default.nix | 18 +++++++++++++++++- hosts/profiles/dns/default.nix | 1 + hosts/profiles/mossnet-hosts/default.nix | 1 + 5 files changed, 24 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 6ce377d3..fe59ae42 100644 --- a/flake.nix +++ b/flake.nix @@ -83,6 +83,10 @@ "SunVox" "renoise" ]; + # config.permittedInsecurePackages = [ + # "python3.10-django-3.1.14" # Needed for archivebox deployments on curve + # # Check when archive box updates it's dependeny + # ]; overlays = [ rust-overlay.overlays.default tidalcycles.overlays.default diff --git a/hosts/box/default.nix b/hosts/box/default.nix index 1e9104ec..aea4f9f7 100644 --- a/hosts/box/default.nix +++ b/hosts/box/default.nix @@ -18,7 +18,7 @@ ../profiles/calibre ../profiles/wallabag ../profiles/finance - ../profiles/archivebox + # ../profiles/archivebox ]; # For some reason this doesn't work in the profile, but does over here?? diff --git a/hosts/profiles/archivebox/default.nix b/hosts/profiles/archivebox/default.nix index e5d53ae1..e5ddaaff 100644 --- a/hosts/profiles/archivebox/default.nix +++ b/hosts/profiles/archivebox/default.nix @@ -7,6 +7,22 @@ let port = "8123"; in { + nixpkgs.config.permittedInsecurePackages = [ + "python3.10-django-3.1.14" + ]; + + services.nginx.virtualHosts."archive.mossnet.lan" = { + enableACME = false; + forceSSL = false; + + locations."/" = { + extraConfig = '' + proxy_pass http://localhost:${port}/; + proxy_set_header X-Forwarded-Host $host; + ''; + }; + }; + systemd.services.archivebox-install = { description = "archivebox install service"; wantedBy = [ "multi-user.target" ]; @@ -25,7 +41,7 @@ in ''; script = '' - echo "Setting up wallabag files in ${dataDir} ..." + echo "Setting up archivebox files in ${dataDir} ..." cd "${dataDir}" archivebox init diff --git a/hosts/profiles/dns/default.nix b/hosts/profiles/dns/default.nix index 178b3b45..bfa48374 100644 --- a/hosts/profiles/dns/default.nix +++ b/hosts/profiles/dns/default.nix @@ -25,6 +25,7 @@ "fin.mossnet.lan" "paper.mossnet.lan" "cal.mossnet.lan" + "archive.mossnet.lan" ]; "192.168.1.226" = [ "df-web.lan" diff --git a/hosts/profiles/mossnet-hosts/default.nix b/hosts/profiles/mossnet-hosts/default.nix index ec95ab80..d8835864 100644 --- a/hosts/profiles/mossnet-hosts/default.nix +++ b/hosts/profiles/mossnet-hosts/default.nix @@ -11,6 +11,7 @@ 192.168.1.240 fin.mossnet.lan 192.168.1.240 paper.mossnet.lan 192.168.1.240 books.mossnet.lan + 192.168.1.240 archive.mossnet.lan ''; # 10.0.69.4 mossnet.lan # 10.0.69.4 links.mossnet.lan