From fedd0778613c7eea8921bf72602b8f00a088e91c Mon Sep 17 00:00:00 2001 From: Callum Leslie Date: Tue, 16 Sep 2025 10:36:32 +0100 Subject: [PATCH] yuh --- flake.lock | 169 +++++++++++++++++++++++++++++++++++-- flake.nix | 17 +++- hosts/hermes/copyparty.nix | 7 +- hosts/hermes/default.nix | 2 + hosts/hermes/n8n.nix | 18 ++++ hosts/hermes/nocodb.nix | 18 ++++ 6 files changed, 220 insertions(+), 11 deletions(-) create mode 100644 hosts/hermes/n8n.nix create mode 100644 hosts/hermes/nocodb.nix diff --git a/flake.lock b/flake.lock index 585cf9e..6c4ed10 100644 --- a/flake.lock +++ b/flake.lock @@ -361,6 +361,22 @@ "type": "github" } }, + "flake-compat_4": { + "flake": false, + "locked": { + "lastModified": 1747046372, + "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": [ @@ -528,6 +544,24 @@ "type": "github" } }, + "flake-utils_3": { + "inputs": { + "systems": "systems_4" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "fromYaml": { "flake": false, "locked": { @@ -560,6 +594,29 @@ "type": "github" } }, + "git-hooks_2": { + "inputs": { + "flake-compat": "flake-compat_4", + "gitignore": "gitignore_3", + "nixpkgs": [ + "scenics", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1757239681, + "narHash": "sha256-E9spYi9lxm2f1zWQLQ7xQt8Xs2nWgr1T4QM7ZjLFphM=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "ab82ab08d6bf74085bd328de2a8722c12d97bd9d", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, "gitignore": { "inputs": { "nixpkgs": [ @@ -603,6 +660,28 @@ "type": "github" } }, + "gitignore_3": { + "inputs": { + "nixpkgs": [ + "scenics", + "git-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "gnome-shell": { "flake": false, "locked": { @@ -917,6 +996,22 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1737469691, + "narHash": "sha256-nmKOgAU48S41dTPIXAq0AHZSehWUn6ZPrUKijHAMmIk=", + "owner": "NixOs", + "repo": "nixpkgs", + "rev": "9e4d5190a9482a1fb9d18adf0bdb83c6e506eaab", + "type": "github" + }, + "original": { + "owner": "NixOs", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1711163522, "narHash": "sha256-YN/Ciidm+A0fmJPWlHBGvVkcarYWSC+s3NTPk/P+q3c=", @@ -932,7 +1027,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { "lastModified": 1750215678, "narHash": "sha256-Rc/ytpamXRf6z8UA2SGa4aaWxUXRbX2MAWIu2C8M+ok=", @@ -948,7 +1043,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_5": { "locked": { "lastModified": 1725194671, "narHash": "sha256-tLGCFEFTB5TaOKkpfw3iYT9dnk4awTP/q4w+ROpMfuw=", @@ -964,6 +1059,25 @@ "type": "github" } }, + "nocodb": { + "inputs": { + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1753527533, + "narHash": "sha256-UoOwtvkNicWrlxEVNR9RL7r39mOFEwyV6BpBd5Fa1is=", + "owner": "nocodb", + "repo": "nocodb", + "rev": "bec1fa46dd23996cad16e16150c959ce587b0750", + "type": "github" + }, + "original": { + "owner": "nocodb", + "ref": "bec1fa4", + "repo": "nocodb", + "type": "github" + } + }, "nsbm": { "inputs": { "flake-parts": [ @@ -1046,7 +1160,7 @@ "flake-parts": "flake-parts_4", "flake-utils": "flake-utils_2", "mnw": "mnw", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_4", "systems": "systems_3" }, "locked": { @@ -1075,7 +1189,7 @@ "nix-systems-aarch64-linux": "nix-systems-aarch64-linux", "nix-systems-x86_64-darwin": "nix-systems-x86_64-darwin", "nix-systems-x86_64-linux": "nix-systems-x86_64-linux", - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_5", "rust-flake": "rust-flake", "systems": [ "systems" @@ -1161,12 +1275,14 @@ "nish": "nish", "nixinate": "nixinate", "nixpkgs": "nixpkgs", + "nocodb": "nocodb", "nsbm": "nsbm", "nvf": "nvf", "omnix": "omnix", "pre-commit-hooks": "pre-commit-hooks", + "scenics": "scenics", "stylix": "stylix", - "systems": "systems_5", + "systems": "systems_6", "treefmt-nix": "treefmt-nix_3", "unstable": "unstable" } @@ -1260,7 +1376,7 @@ "flake-parts": "flake-parts_3", "flake-root": "flake-root", "nix-visualize": "nix-visualize", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_3", "treefmt-nix": "treefmt-nix", "vulnix": "vulnix" }, @@ -1278,6 +1394,28 @@ "type": "github" } }, + "scenics": { + "inputs": { + "flake-utils": "flake-utils_3", + "git-hooks": "git-hooks_2", + "nixpkgs": [ + "unstable" + ] + }, + "locked": { + "lastModified": 1757517057, + "narHash": "sha256-FOovR2vgYev9BoNmbacqpB6i3Tk5NxWjRj9hFr2fB/4=", + "owner": "callumio", + "repo": "scenics", + "rev": "6afe932b2c78782e6b2e7423926eb1995fd4f5be", + "type": "github" + }, + "original": { + "owner": "callumio", + "repo": "scenics", + "type": "github" + } + }, "stylix": { "inputs": { "base16": "base16", @@ -1291,7 +1429,7 @@ "nixpkgs" ], "nur": "nur", - "systems": "systems_4", + "systems": "systems_5", "tinted-foot": "tinted-foot", "tinted-kitty": "tinted-kitty", "tinted-schemes": "tinted-schemes", @@ -1359,6 +1497,21 @@ } }, "systems_4": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, + "systems_5": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -1373,7 +1526,7 @@ "type": "github" } }, - "systems_5": { + "systems_6": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", diff --git a/flake.nix b/flake.nix index eab8f66..9ec84a4 100644 --- a/flake.nix +++ b/flake.nix @@ -40,7 +40,7 @@ # TODO: use ./hosts/ nixosConfigurations = { artemis = mkLinuxSystem [./hosts/artemis inputs.lanzaboote.nixosModules.lanzaboote] []; - hermes = mkLinuxSystem [./hosts/hermes inputs.copyparty.nixosModules.default] [inputs.copyparty.overlays.default]; + hermes = mkLinuxSystem [./hosts/hermes inputs.nocodb.nixosModules.nocodb inputs.copyparty.nixosModules.default] [inputs.copyparty.overlays.default]; }; diskoConfigurations = {}; # maybe? om.health.default = {nix-version.min-required = "2.18.5";}; @@ -54,7 +54,12 @@ ... }: { _module.args.pkgs = inputs'.nixpkgs.legacyPackages.extend self.overlays.default; - overlayAttrs = config.packages // {unstable = inputs'.unstable.legacyPackages;}; + overlayAttrs = + config.packages + // { + unstable = inputs'.unstable.legacyPackages; + scenics = inputs'.scenics.packages; + }; pre-commit = { check.enable = false; @@ -86,6 +91,9 @@ nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; + scenics.url = "github:callumio/scenics"; + scenics.inputs.nixpkgs.follows = "unstable"; + nixinate = { url = "github:callumio/nixinate"; inputs.nixpkgs.follows = "unstable"; @@ -182,5 +190,10 @@ url = "github:9001/copyparty"; inputs.nixpkgs.follows = "unstable"; }; + + nocodb = { + url = "github:nocodb/nocodb?ref=bec1fa4"; + #inputs.nixpkgs.follows = "unstable"; + }; }; } diff --git a/hosts/hermes/copyparty.nix b/hosts/hermes/copyparty.nix index 8fc9923..345f198 100644 --- a/hosts/hermes/copyparty.nix +++ b/hosts/hermes/copyparty.nix @@ -16,7 +16,12 @@ in { "/media" = { path = "/var/lib/media/library"; access = { - r = "*"; + rw = ["c"]; + }; + }; + "/paperless" = { + path = "/var/lib/media/library"; + access = { rw = ["c"]; }; }; diff --git a/hosts/hermes/default.nix b/hosts/hermes/default.nix index 6487805..11aaf6f 100644 --- a/hosts/hermes/default.nix +++ b/hosts/hermes/default.nix @@ -7,7 +7,9 @@ ./quassel.nix ./fail2ban.nix ./containers.nix + ./n8n.nix ./networking.nix + ./nocodb.nix ./ssh.nix ./media.nix ./headscale.nix diff --git a/hosts/hermes/n8n.nix b/hosts/hermes/n8n.nix new file mode 100644 index 0000000..5054b60 --- /dev/null +++ b/hosts/hermes/n8n.nix @@ -0,0 +1,18 @@ +{pkgs, ...}: let + domain = "automation.cleslie.uk"; +in { + services = { + cloudflare-dyndns.domains = [domain]; + n8n = { + enable = true; + webhookUrl = "https://" + domain + "/"; + settings = { + port = 5678; + }; + }; + caddy.virtualHosts.${domain}.extraConfig = '' + reverse_proxy http://127.0.0.1:5678 + ''; + }; + environment.systemPackages = with pkgs; [mupdf-headless]; +} diff --git a/hosts/hermes/nocodb.nix b/hosts/hermes/nocodb.nix new file mode 100644 index 0000000..db5658f --- /dev/null +++ b/hosts/hermes/nocodb.nix @@ -0,0 +1,18 @@ +_: let + domain = "hub.cleslie.uk"; +in { + services = { + cloudflare-dyndns.domains = [domain]; + nocodb = { + enable = true; + environment = { + NC_PUBLIC_URL = "https://" + domain; + #NC_INVITE_ONLY_SIGNUP = 1; + PORT = "4690"; + }; + }; + caddy.virtualHosts.${domain}.extraConfig = '' + reverse_proxy http://127.0.0.1:4690 + ''; + }; +}