From 476cbf253445b6980b7f7be0d4acd83b48bbcfeb Mon Sep 17 00:00:00 2001 From: "Simon R. - fantomitechno" Date: Fri, 26 Jun 2026 11:25:38 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=9A=20move=20again?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hosts/conseil/default.nix | 77 ++------------------------- modules/nas/copyparty.nix | 47 ++++++++++++++++ modules/nas/default.nix | 16 ++++++ modules/nas/s3.nix | 19 +++++++ {hosts/conseil/pswd => pswd}/.gitkeep | 0 5 files changed, 86 insertions(+), 73 deletions(-) create mode 100644 modules/nas/copyparty.nix create mode 100644 modules/nas/default.nix create mode 100644 modules/nas/s3.nix rename {hosts/conseil/pswd => pswd}/.gitkeep (100%) diff --git a/hosts/conseil/default.nix b/hosts/conseil/default.nix index 7d63834..a7b5002 100644 --- a/hosts/conseil/default.nix +++ b/hosts/conseil/default.nix @@ -1,7 +1,5 @@ { pkgs, - dotfileFolder, - flakes, ... }: @@ -9,7 +7,10 @@ imports = [ ./hardware-configuration.nix ../server.nix - ]; + ] + ++ builtins.map (i: ../../modules/${i}) ([ + "nas" + ]); # Bootloader boot = { @@ -20,75 +21,5 @@ kernelPackages = pkgs.linuxPackages; }; - services = { - nfs.server = { - enable = true; - statdPort = 4000; - lockdPort = 4001; - mountdPort = 4002; - # exports = '' - # - # ''; - }; - - copyparty = { - enable = true; - user = "copyparty"; - group = "copyparty"; - settings = { - i = "172.16.20.10"; - p = [ - 3210 - 3211 - ]; - no-reload = true; - ignored-flag = false; - }; - - accounts = { - fantomitechno = { - passwordFile = "${dotfileFolder}/hosts/conseil/pswd/copyparty-fantom"; - }; - }; - - volumes = { - "/public" = { - # path = "" - - access = { - r = "*"; - rw = [ "fantomitechno" ]; - }; - - flags = { - scan = 60; - }; - }; - }; - }; - - garage = { - enable = true; - - settings = { - metadata_dir = "/var/lib/garage/meta"; - data_dir = "/var/lib/garage/data"; - - s3_api = { - api_bind_addr = "[::]:3900"; - s3_region = "garage"; - }; - - s3_web = { - bind_addr = "[::]:3902"; - }; - }; - }; - }; - - nixpkgs = { - overlays = [ flakes.inputs.copyparty.overlays.default ]; - }; - system.stateVersion = "26.05"; } diff --git a/modules/nas/copyparty.nix b/modules/nas/copyparty.nix new file mode 100644 index 0000000..3b7f0c6 --- /dev/null +++ b/modules/nas/copyparty.nix @@ -0,0 +1,47 @@ +{ + dotfileFolder, + flakes, + ... +}: + +{ + services.copyparty = { + enable = true; + user = "copyparty"; + group = "copyparty"; + settings = { + i = "172.16.20.10"; + p = [ + 3210 + 3211 + ]; + no-reload = true; + ignored-flag = false; + }; + + accounts = { + fantomitechno = { + passwordFile = "${dotfileFolder}/pswd/copyparty-fantom"; + }; + }; + + volumes = { + "/public" = { + # path = "" + + access = { + r = "*"; + rw = [ "fantomitechno" ]; + }; + + flags = { + scan = 60; + }; + }; + }; + }; + + nixpkgs = { + overlays = [ flakes.inputs.copyparty.overlays.default ]; + }; +} diff --git a/modules/nas/default.nix b/modules/nas/default.nix new file mode 100644 index 0000000..e418c03 --- /dev/null +++ b/modules/nas/default.nix @@ -0,0 +1,16 @@ +{ ... }: { + imports = [ + ./copyparty.nix + ./s3.nix + ]; + + services.nfs.server = { + enable = true; + statdPort = 4000; + lockdPort = 4001; + mountdPort = 4002; + # exports = '' + # + # ''; + }; +} diff --git a/modules/nas/s3.nix b/modules/nas/s3.nix new file mode 100644 index 0000000..6c01776 --- /dev/null +++ b/modules/nas/s3.nix @@ -0,0 +1,19 @@ +{ ... }: { + services.garage = { + enable = true; + + settings = { + metadata_dir = "/var/lib/garage/meta"; + data_dir = "/var/lib/garage/data"; + + s3_api = { + api_bind_addr = "[::]:3900"; + s3_region = "garage"; + }; + + s3_web = { + bind_addr = "[::]:3902"; + }; + }; + }; +} diff --git a/hosts/conseil/pswd/.gitkeep b/pswd/.gitkeep similarity index 100% rename from hosts/conseil/pswd/.gitkeep rename to pswd/.gitkeep -- 2.54.0