From efb1cda6d789e81cce0fafd753fb4d96eed6f9b7 Mon Sep 17 00:00:00 2001 From: triethyl Date: Tue, 2 Sep 2025 21:21:46 -0400 Subject: homelab: working on homelab --- nixos/features/gui/apps/steam.nix | 6 +++- nixos/features/server/cloud/syncthing.nix | 1 - nixos/features/server/core/ssh.nix | 15 ---------- nixos/features/server/development/git-server.nix | 1 - nixos/features/server/gaming/minecraft.nix | 1 - nixos/features/server/media/calibre.nix | 1 - nixos/features/server/media/invidious.nix | 1 - nixos/modules/homelab/cloud/default.nix | 6 +++- nixos/modules/homelab/cloud/syncthing.nix | 35 +++++++++++++++++++++++- nixos/modules/homelab/core/default.nix | 6 +++- nixos/modules/homelab/core/ssh.nix | 17 ++++++++++++ nixos/systems/nzxt-desktop/system.nix | 2 +- 12 files changed, 67 insertions(+), 25 deletions(-) delete mode 100644 nixos/features/server/cloud/syncthing.nix delete mode 100644 nixos/features/server/core/ssh.nix delete mode 100644 nixos/features/server/development/git-server.nix delete mode 100644 nixos/features/server/gaming/minecraft.nix delete mode 100644 nixos/features/server/media/calibre.nix delete mode 100644 nixos/features/server/media/invidious.nix create mode 100644 nixos/modules/homelab/core/ssh.nix diff --git a/nixos/features/gui/apps/steam.nix b/nixos/features/gui/apps/steam.nix index 046b814..d63b3a1 100644 --- a/nixos/features/gui/apps/steam.nix +++ b/nixos/features/gui/apps/steam.nix @@ -20,7 +20,11 @@ in { }; hardware.steam-hardware.enable = true; programs.gamemode.enable = true; - environment.systemPackages = [pkgs.mangohud]; + environment.systemPackages = with pkgs; [ + mangohud + winetricks + wine-wayland + ]; # Steam Launch Options # Add this to 3D games: diff --git a/nixos/features/server/cloud/syncthing.nix b/nixos/features/server/cloud/syncthing.nix deleted file mode 100644 index 0967ef4..0000000 --- a/nixos/features/server/cloud/syncthing.nix +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/nixos/features/server/core/ssh.nix b/nixos/features/server/core/ssh.nix deleted file mode 100644 index 16fec48..0000000 --- a/nixos/features/server/core/ssh.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ config, lib, ... }: let - cfg = config.features.server.ssh; -in { - options.features.server.ssh.enable = lib.mkEnableOption "sshd"; - config = lib.mkIf cfg.enable { - services.openssh = { - enable = true; - ports = [ 2200 ]; - settings = { - PermitRootLogin = "no"; - PasswordAuthentication = false; - }; - }; - }; -} diff --git a/nixos/features/server/development/git-server.nix b/nixos/features/server/development/git-server.nix deleted file mode 100644 index 0967ef4..0000000 --- a/nixos/features/server/development/git-server.nix +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/nixos/features/server/gaming/minecraft.nix b/nixos/features/server/gaming/minecraft.nix deleted file mode 100644 index 0967ef4..0000000 --- a/nixos/features/server/gaming/minecraft.nix +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/nixos/features/server/media/calibre.nix b/nixos/features/server/media/calibre.nix deleted file mode 100644 index 0967ef4..0000000 --- a/nixos/features/server/media/calibre.nix +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/nixos/features/server/media/invidious.nix b/nixos/features/server/media/invidious.nix deleted file mode 100644 index 0967ef4..0000000 --- a/nixos/features/server/media/invidious.nix +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/nixos/modules/homelab/cloud/default.nix b/nixos/modules/homelab/cloud/default.nix index d4ee9df..24b067d 100644 --- a/nixos/modules/homelab/cloud/default.nix +++ b/nixos/modules/homelab/cloud/default.nix @@ -1 +1,5 @@ -{config, pkgs, lib, ...}: {} +{...}: { + imports = [ + ./syncthing.nix + ]; +} diff --git a/nixos/modules/homelab/cloud/syncthing.nix b/nixos/modules/homelab/cloud/syncthing.nix index 993cf42..00328f7 100644 --- a/nixos/modules/homelab/cloud/syncthing.nix +++ b/nixos/modules/homelab/cloud/syncthing.nix @@ -3,6 +3,39 @@ in { options.homelab.cloud.syncthing = { enable = lib.mkEnableOption "syncthing"; - + user = lib.mkOption { + type = lib.types.str; + description = "The username of syncthing's user"; + }; + }; + config = lib.mkIf cfg.enable { + services.syncthing = { + enable = true; + user = cfg.user; + dataDir = "/home/${cfg.user}/Sync"; + configDir = "/home/${cfg.user}/.config/syncthing"; + overrideDevices = true; + overrideFolders = true; + settings = { + devices = { + "ideapad-laptop" = { + id = "62SPMAK-NOHX3QT-MVSOS7U-UON6YPH-HXXNFXO-PRSAJ2X-GYXFWJO-6LARPQL"; + }; + "nzxt-desktop" = { + id = "2TPKPXD-LO7OL7V-GP5HOUM-2P5SUEQ-XST4UYJ-S2Z56PP-IM66IIT-GLUNLAX"; + }; + "samsung-tablet" = { + id = "ZKL25GJ-TKM2E6Y-VQSBAW5-TVG7RWM-RRAUEVA-ZOJZNCM-F3ARZUU-TPK7CA6"; + }; + }; + folders = { + "Main" = { + path = "/home/${cfg.user}/Sync"; + devices = [ "ideapad-laptop" "nzxt-desktop" "samsung-tablet" ]; + }; + }; + }; + }; + environment.systemPackages = [ pkgs.syncthing ]; }; } diff --git a/nixos/modules/homelab/core/default.nix b/nixos/modules/homelab/core/default.nix index d4ee9df..f2202aa 100644 --- a/nixos/modules/homelab/core/default.nix +++ b/nixos/modules/homelab/core/default.nix @@ -1 +1,5 @@ -{config, pkgs, lib, ...}: {} +{...}: { + imports = [ + ./ssh.nix + ]; +} diff --git a/nixos/modules/homelab/core/ssh.nix b/nixos/modules/homelab/core/ssh.nix new file mode 100644 index 0000000..1b4b559 --- /dev/null +++ b/nixos/modules/homelab/core/ssh.nix @@ -0,0 +1,17 @@ +{config, lib, ...}: let + cfg = config.homelab.core.ssh; +in { + options.homelab.core.ssh = { + enable = lib.mkEnableOption "ssh"; + }; + config = lib.mkIf cfg.enable { + services.openssh = { + enable = true; + ports = [ 2200 ]; + settings = { + PermitRootLogin = "no"; + PasswordAuthentication = false; + }; + }; + }; +} diff --git a/nixos/systems/nzxt-desktop/system.nix b/nixos/systems/nzxt-desktop/system.nix index db42aa1..3a6932c 100644 --- a/nixos/systems/nzxt-desktop/system.nix +++ b/nixos/systems/nzxt-desktop/system.nix @@ -8,7 +8,7 @@ stateVersion = "23.11"; }; - age.secrets.culsans-user-password.file = ../../secrets/user-passwords/nzxt-desktop/culsans.age; + age.secrets.culsans-user-password.file = ../../../secrets/user-passwords/nzxt-desktop/culsans.age; users.users."culsans" = { hashedPasswordFile = config.age.secrets.culsans-user-password.path; -- cgit v1.2.3