From d3ab0012225fc21f2ee877c76a0d125283c7ee14 Mon Sep 17 00:00:00 2001 From: Cilly Leang Date: Wed, 18 Mar 2026 01:52:34 +1100 Subject: [PATCH] containers/fluorite: init --- containers/fluorite/configuration.nix | 16 +++++++ containers/fluorite/flake.lock | 27 ++++++++++++ containers/fluorite/flake.nix | 62 +++++++++++++++++++++++++++ flake.lock | 47 ++++++++++++++++---- flake.nix | 1 + 5 files changed, 145 insertions(+), 8 deletions(-) create mode 100644 containers/fluorite/configuration.nix create mode 100644 containers/fluorite/flake.lock create mode 100644 containers/fluorite/flake.nix diff --git a/containers/fluorite/configuration.nix b/containers/fluorite/configuration.nix new file mode 100644 index 0000000..09dd485 --- /dev/null +++ b/containers/fluorite/configuration.nix @@ -0,0 +1,16 @@ +{ ... }: { + system.stateVersion = "25.11"; + systemd.tmpfiles.rules = [ + "d /persist/slskd/Downloads 755 slskd slskd" + ]; + networking.firewall.allowedTCPPorts = [ 5030 50300 ]; + networking.firewall.allowedUDPPorts = [ 5030 50300 ]; + + services.slskd = { + enable = true; + settings = { + directories.downloads = "/persist/slskd/Downloads"; + shares.downloads = "/binds/shared/"; + }; + }; +} diff --git a/containers/fluorite/flake.lock b/containers/fluorite/flake.lock new file mode 100644 index 0000000..88ab73f --- /dev/null +++ b/containers/fluorite/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1773282481, + "narHash": "sha256-b/GV2ysM8mKHhinse2wz+uP37epUrSE+sAKXy/xvBY4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "fe416aaedd397cacb33a610b33d60ff2b431b127", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/containers/fluorite/flake.nix b/containers/fluorite/flake.nix new file mode 100644 index 0000000..a589f7c --- /dev/null +++ b/containers/fluorite/flake.nix @@ -0,0 +1,62 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + }; + outputs = { nixpkgs, ... }: + let + name = "fluorite"; + fqdn = "fluorite.lava.moe"; + subnetId = "6"; + + subnet = x: "fd0d:1::${subnetId}:${toString x}"; + host = subnet 1; + client = subnet 2; + + subnet4 = x: "10.30.${subnetId}.${toString x}"; + host4 = subnet4 1; + client4 = subnet4 2; + + modules = [ + ./configuration.nix + ]; + in { + nixosConfigurations.container = nixpkgs.lib.nixosSystem { + inherit modules; + }; + nixosModule = { ... }: { + services.nginx.virtualHosts."${fqdn}" = { + useACMEHost = "lava.moe"; + forceSSL = true; + locations."/".proxyPass = "http://[${client}]:5030"; + listenAddresses = [ "10.0.0.1" "[fd0d::1]" ]; + }; + + systemd.tmpfiles.rules = [ "d /persist/containers/${name} 755 root users" ]; + containers.${name} = { + autoStart = true; + privateNetwork = true; + hostAddress = host4; + localAddress = client4; + hostAddress6 = host; + localAddress6 = client; + # privateUsers = "pick"; + nixpkgs = nixpkgs; + ephemeral = true; + config = { imports = modules; }; + specialArgs = { inherit fqdn; }; + + bindMounts."persist" = { + hostPath = "/persist/containers/${name}"; + mountPoint = "/persist"; + isReadOnly = false; + }; + bindMounts."shared" = { + hostPath = "/persist/media/music"; + mountPoint = "/binds/shared"; + isReadOnly = true; + }; + # flake = "path:" + ./.; + }; + }; + }; +} diff --git a/flake.lock b/flake.lock index 305fddb..2bd4720 100644 --- a/flake.lock +++ b/flake.lock @@ -114,6 +114,20 @@ }, "parent": [] }, + "c-fluorite": { + "inputs": { + "nixpkgs": "nixpkgs_9" + }, + "locked": { + "path": "./containers/fluorite", + "type": "path" + }, + "original": { + "path": "./containers/fluorite", + "type": "path" + }, + "parent": [] + }, "catppuccin": { "inputs": { "nixpkgs": "nixpkgs_5" @@ -519,7 +533,7 @@ "nix-gaming": { "inputs": { "flake-parts": "flake-parts_2", - "nixpkgs": "nixpkgs_9" + "nixpkgs": "nixpkgs_10" }, "locked": { "lastModified": 1770778188, @@ -603,6 +617,22 @@ } }, "nixpkgs_10": { + "locked": { + "lastModified": 1770537093, + "narHash": "sha256-pF1quXG5wsgtyuPOHcLfYg/ft/QMr8NnX0i6tW2187s=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "fef9403a3e4d31b0a23f0bacebbec52c248fbb51", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_11": { "locked": { "lastModified": 1770562336, "narHash": "sha256-ub1gpAONMFsT/GU2hV6ZWJjur8rJ6kKxdm9IlCT0j84=", @@ -618,7 +648,7 @@ "type": "github" } }, - "nixpkgs_11": { + "nixpkgs_12": { "locked": { "lastModified": 1770019141, "narHash": "sha256-VKS4ZLNx4PNrABoB0L8KUpc1fE7CLpQXQs985tGfaCU=", @@ -748,16 +778,16 @@ }, "nixpkgs_9": { "locked": { - "lastModified": 1770537093, - "narHash": "sha256-pF1quXG5wsgtyuPOHcLfYg/ft/QMr8NnX0i6tW2187s=", + "lastModified": 1773282481, + "narHash": "sha256-b/GV2ysM8mKHhinse2wz+uP37epUrSE+sAKXy/xvBY4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "fef9403a3e4d31b0a23f0bacebbec52c248fbb51", + "rev": "fe416aaedd397cacb33a610b33d60ff2b431b127", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixpkgs-unstable", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } @@ -804,7 +834,7 @@ "pastel": { "inputs": { "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs_11", + "nixpkgs": "nixpkgs_12", "pnpm2nix": "pnpm2nix" }, "locked": { @@ -869,6 +899,7 @@ "c-citrine": "c-citrine", "c-diamond": "c-diamond", "c-emerald": "c-emerald", + "c-fluorite": "c-fluorite", "catppuccin": "catppuccin_2", "catppuccin-palette": "catppuccin-palette", "fast-syntax-highlighting": "fast-syntax-highlighting", @@ -877,7 +908,7 @@ "neovim-nightly": "neovim-nightly", "nix-gaming": "nix-gaming", "nix-index-database": "nix-index-database", - "nixpkgs": "nixpkgs_10", + "nixpkgs": "nixpkgs_11", "nvim-treesitter": "nvim-treesitter", "pastel": "pastel", "pure": "pure", diff --git a/flake.nix b/flake.nix index 3746d08..8b91291 100644 --- a/flake.nix +++ b/flake.nix @@ -43,6 +43,7 @@ c-citrine.url = "path:./containers/citrine"; c-diamond.url = "path:./containers/diamond"; c-emerald.url = "path:./containers/emerald"; + c-fluorite.url = "path:./containers/fluorite"; }; outputs = { self, agenix, catppuccin, nixpkgs, ... } @ inputs: