From 2f883d1c8e6e17d6c0390a429e5fb2596054692b Mon Sep 17 00:00:00 2001 From: joy Date: Wed, 23 Oct 2024 21:31:27 +0200 Subject: [PATCH] uh --- hosts/iso/default.nix | 2 +- hosts/server/default.nix | 2 ++ modules/programs/bat/default.nix | 3 --- modules/secrets/default.nix | 8 -------- modules/secrets/secrets.yaml | 5 ++--- modules/services/default.nix | 1 - modules/services/syncthing/default.nix | 28 +++++++++++++++++++++----- modules/wm/default.nix | 1 + modules/wm/syncthing/default.nix | 10 +++++++++ 9 files changed, 39 insertions(+), 21 deletions(-) create mode 100644 modules/wm/syncthing/default.nix diff --git a/hosts/iso/default.nix b/hosts/iso/default.nix index 33e16a3..69fc7d7 100644 --- a/hosts/iso/default.nix +++ b/hosts/iso/default.nix @@ -1,7 +1,7 @@ {modulesPath, ...}: { imports = [ "${modulesPath}/installer/cd-dvd/installation-cd-minimal.nix" - ../../modules/programs/norm/misc + ../../modules ]; nixpkgs.hostPlatform = "x86_64-linux"; diff --git a/hosts/server/default.nix b/hosts/server/default.nix index 425956d..dc131bd 100644 --- a/hosts/server/default.nix +++ b/hosts/server/default.nix @@ -8,8 +8,10 @@ ./hardware.nix ../../modules/programs ../../modules/system + ../../modules/secrets ../../modules/services ../../modules/services/invidious ../../modules/services/forgejo + ../../modules/services/syncthing ]; } diff --git a/modules/programs/bat/default.nix b/modules/programs/bat/default.nix index 8e00d24..0b696b4 100644 --- a/modules/programs/bat/default.nix +++ b/modules/programs/bat/default.nix @@ -1,8 +1,5 @@ {lib, ...}: { programs.bat = { enable = true; - config = { - theme = lib.mkForce "base16-stylix"; - }; }; } diff --git a/modules/secrets/default.nix b/modules/secrets/default.nix index 689e700..8f8966c 100644 --- a/modules/secrets/default.nix +++ b/modules/secrets/default.nix @@ -13,12 +13,4 @@ sops.secrets.contact = { owner = "joy"; }; - - users.users.sometestservice = { - home = "/var/lib/sometestservice"; - createHome = true; - isSystemUser = true; - group = "sometestservice"; - }; - users.groups.sometestservice = {}; } diff --git a/modules/secrets/secrets.yaml b/modules/secrets/secrets.yaml index ca73e05..1c5db79 100644 --- a/modules/secrets/secrets.yaml +++ b/modules/secrets/secrets.yaml @@ -1,7 +1,6 @@ mail: ENC[AES256_GCM,data:fczs+TGhEprQIq90Mj6b+7YMcdc=,iv:VDPWXJ4j0lCB/lGPEav7tc2UyDSeP4pWjwc1GdJaRvc=,tag:dcegyG0iWTNHWwiok9LeCw==,type:str] spyware: ENC[AES256_GCM,data:qMIq9wxQEWQ12yv3TS5L+vKJ7k0=,iv:4CcYjHu5P/NG2TJHIQGrHxGLpvJkJQwi43vEUTuHzcc=,tag:IkEBbib9sCEYvplLSK6FaQ==,type:str] contact: ENC[AES256_GCM,data:Ar1oEaGVJrzk2tZjjC1oJevP3ms=,iv:W0ZZe1Okk2DgTRsNaDfwpdUhkXZHdVdENOudUZarhm0=,tag:xUgtoxMkO4WBVn2Ly2ADtA==,type:str] -sync: ENC[AES256_GCM,data:0kfXpI6hOIowLCtvoEi9Kh2KSUg=,iv:FrR3H+9Mpz3r7QUqsAVOYc72TRqfWqjUG/2Pby4XTxo=,tag:+1CxjAZaWkfC5nvTT45RBw==,type:str] sops: kms: [] gcp_kms: [] @@ -17,8 +16,8 @@ sops: OFFGTHdpNmpvU0NxRkZKakp6d1ZQOHcKlyLSgKBK3W6uRlkFpTTrbClwAmEx7DPL KpxncKiz0MoFsnlIP2evqPrxS/K9RP3EYRmdSKKr9VuLeWTIg+/nJA== -----END AGE ENCRYPTED FILE----- - lastmodified: "2024-10-23T16:07:07Z" - mac: ENC[AES256_GCM,data:6obWmz9HdOT3Rp4Ue+AtaBS2fIz5SpjgZBPJMF9FAyGNTWiEi2xCHLZ1cu89wgfZCRTYh900KU4Iatk7yp2kdAX6dNKM/HzTuqsJreCEm/08Gg3Pl8RitJTSGMtHZ2NPNVRjKf3JOl9Tgr5zzO17+xdcBc21z7KieJVN3voyaJs=,iv:Xvjvuv/g3qH3soOTbGiY6x5nHTKT+iJVe6odygaVVQs=,tag:w+FS7/aUdRAyCcJNIlyd0w==,type:str] + lastmodified: "2024-10-23T18:00:17Z" + mac: ENC[AES256_GCM,data:skJj/3pvaKOwVIoJbCDXbpX41zLQMczKw46uPGFfY0ZzRTaZlf2Gn4pruJq064/lwuXxWy3ckvSO3la9epCY+B64g4GiszkHqoxNy94ALK18wF/zokLCqt5MtSZUEhcqiUlcw/86msyCeHTH8dkbMX8GvQ83824LWmaqpG0aZNg=,iv:lat6ZqUbSbcOykTmFHjXFPMVWuOZzm4uJeBNwNO2beE=,tag:azqjPRjxZSqHngIEZP7fWw==,type:str] pgp: [] unencrypted_suffix: _unencrypted version: 3.9.1 diff --git a/modules/services/default.nix b/modules/services/default.nix index b382554..72507b9 100644 --- a/modules/services/default.nix +++ b/modules/services/default.nix @@ -1,7 +1,6 @@ { imports = [ ./vm - ./syncthing ./docker ./ssh ./misc diff --git a/modules/services/syncthing/default.nix b/modules/services/syncthing/default.nix index 23d528e..c231b69 100644 --- a/modules/services/syncthing/default.nix +++ b/modules/services/syncthing/default.nix @@ -1,9 +1,27 @@ { - services = { - syncthing = { - enable = true; - user = "joy"; - configDir = "/home/joy/.config/syncthing"; + services.syncthing = { + enable = true; + dataDir = "/home/joy"; + openDefaultPorts = true; + configDir = "/home/joy/.config/syncthing"; + user = "joy"; + group = "users"; + guiAddress = "0.0.0.0:8384"; + }; + services.nginx = { + enable = true; + recommendedProxySettings = true; + recommendedTlsSettings = true; + virtualHosts."sync.joygnu.org" = { + enableACME = true; + forceSSL = true; + locations."/" = { + proxyPass = "http://127.0.0.1:8384"; + proxyWebsockets = true; + extraConfig = + "proxy_ssl_server_name on;" + + "proxy_pass_header Authorization;"; + }; }; }; } diff --git a/modules/wm/default.nix b/modules/wm/default.nix index fc9f556..ef3915e 100644 --- a/modules/wm/default.nix +++ b/modules/wm/default.nix @@ -4,6 +4,7 @@ ./theme ./gnome ./polkit + ./syncthing ./gdm ]; home-manager = { diff --git a/modules/wm/syncthing/default.nix b/modules/wm/syncthing/default.nix new file mode 100644 index 0000000..80a1d78 --- /dev/null +++ b/modules/wm/syncthing/default.nix @@ -0,0 +1,10 @@ +{ + services.syncthing = { + enable = true; + dataDir = "/home/joy"; + openDefaultPorts = true; + configDir = "/home/joy/.config/syncthing"; + user = "joy"; + group = "users"; + }; +}