From 4ad26636a72f33bc0eedcbbc909995d3a986ccea Mon Sep 17 00:00:00 2001 From: Jimbo Date: Sat, 12 Oct 2024 19:41:05 -0400 Subject: [PATCH] Gonna revert and modify the original flake, add back overlays from a shared file, and figure things out after --- modules/home/default.nix | 4 ---- modules/home/files/default.nix | 3 +++ modules/profiles/pc/home/default.nix | 12 ++++++++++++ modules/profiles/pc/system/default.nix | 17 +++++++++++++++++ modules/profiles/server/home/default.nix | 14 ++++++++++++++ modules/profiles/server/system/default.nix | 17 +++++++++++++++++ .../accounts/groups/nfsShare/default.nix | 4 +++- .../accounts/users/liquidsoap/default.nix | 1 + .../accounts/users/nextcloud/default.nix | 1 + .../system/accounts/users/nginx/default.nix | 1 + modules/system/default.nix | 15 ++++++--------- .../wireguard/{client => pc}/default.nix | 0 .../wireguard/{host => server}/default.nix | 0 modules/system/services/common/default.nix | 6 ++++++ modules/system/services/default.nix | 7 +++++++ modules/system/services/pc/default.nix | 10 ++++++++++ modules/system/services/server/default.nix | 18 ++++++++++++++++++ 17 files changed, 116 insertions(+), 14 deletions(-) create mode 100644 modules/profiles/pc/home/default.nix create mode 100644 modules/profiles/pc/system/default.nix create mode 100644 modules/profiles/server/home/default.nix create mode 100644 modules/profiles/server/system/default.nix rename modules/system/devices/networking/wireguard/{client => pc}/default.nix (100%) rename modules/system/devices/networking/wireguard/{host => server}/default.nix (100%) create mode 100644 modules/system/services/common/default.nix create mode 100644 modules/system/services/default.nix create mode 100644 modules/system/services/pc/default.nix create mode 100644 modules/system/services/server/default.nix diff --git a/modules/home/default.nix b/modules/home/default.nix index 7ca9b09..9216df2 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -1,9 +1,5 @@ { ... }: { - imports = [ - ./users - ]; - nixpkgs.config.allowUnfree = true; # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion diff --git a/modules/home/files/default.nix b/modules/home/files/default.nix index 1a101b7..465108f 100644 --- a/modules/home/files/default.nix +++ b/modules/home/files/default.nix @@ -1,5 +1,8 @@ {pkgs, ...}: { home.file = { + "VMs" = { + source = config.lib.file.mkOutOfStoreSymlink "/etc/libvirt/VMs"; + }; ".face" = { source = ./assets/user-icon.png; }; diff --git a/modules/profiles/pc/home/default.nix b/modules/profiles/pc/home/default.nix new file mode 100644 index 0000000..548a355 --- /dev/null +++ b/modules/profiles/pc/home/default.nix @@ -0,0 +1,12 @@ +{ ... }: +{ + imports = [ + ../../../home + ../../../home/users + ../../../home/files + ../../../home/settings + ../../../home/programs + ../../../home/sway + ../../../home/utils + ]; +} diff --git a/modules/profiles/pc/system/default.nix b/modules/profiles/pc/system/default.nix new file mode 100644 index 0000000..8cd65bc --- /dev/null +++ b/modules/profiles/pc/system/default.nix @@ -0,0 +1,17 @@ +{ ... }: +{ + imports = [ + ../../../system + ../../../system/accounts + ../../../system/desktop + ../../../system/devices + ../../../system/devices/networking/firewall/server + ../../../system/programs + ../../../system/services + ]; + + networking.hostName = "firefly"; + + # Force Electron to use Wayland + environment.sessionVariables.NIXOS_OZONE_WL = "1"; +} diff --git a/modules/profiles/server/home/default.nix b/modules/profiles/server/home/default.nix new file mode 100644 index 0000000..ceff00b --- /dev/null +++ b/modules/profiles/server/home/default.nix @@ -0,0 +1,14 @@ +{ ... }: +{ + imports = [ + ../../../home + ../../../home/users + ../../../home/programs/fastfetch + ../../../home/programs/git + ../../../home/programs/ncmpcpp + ../../../home/programs/neovim + ../../../home/programs/ranger + ../../../home/programs/tmux + ../../../home/utils/zsh + ]; +} diff --git a/modules/profiles/server/system/default.nix b/modules/profiles/server/system/default.nix new file mode 100644 index 0000000..c3d5a03 --- /dev/null +++ b/modules/profiles/server/system/default.nix @@ -0,0 +1,17 @@ +{ ... }: +{ + imports = [ + ../../../system + ../../../system/accounts + ../../../system/devices/filesystems + ../../../system/devices/networking + ../../../system/devices/networking/firewall/server + ../../../system/devices/networking/wireguard/server + ../../../system/programs/git + ../../../system/programs/security + ../../../system/services/common + ../../../system/services/server + ]; + + networking.hostName = "cyberspark"; +} diff --git a/modules/system/accounts/groups/nfsShare/default.nix b/modules/system/accounts/groups/nfsShare/default.nix index 9871b4e..81ca445 100644 --- a/modules/system/accounts/groups/nfsShare/default.nix +++ b/modules/system/accounts/groups/nfsShare/default.nix @@ -1,4 +1,6 @@ { ... }: { - users.groups.nfsShare = {}; + users.groups.nfsShare = { + gid = 983; + }; } diff --git a/modules/system/accounts/users/liquidsoap/default.nix b/modules/system/accounts/users/liquidsoap/default.nix index 264a72a..0ee4723 100644 --- a/modules/system/accounts/users/liquidsoap/default.nix +++ b/modules/system/accounts/users/liquidsoap/default.nix @@ -4,6 +4,7 @@ nextcloud = { extraGroups = [ "nginx" ]; isSystemUser = true; + uid = 155; }; }; } diff --git a/modules/system/accounts/users/nextcloud/default.nix b/modules/system/accounts/users/nextcloud/default.nix index 1ec736c..f6c7553 100644 --- a/modules/system/accounts/users/nextcloud/default.nix +++ b/modules/system/accounts/users/nextcloud/default.nix @@ -3,6 +3,7 @@ nextcloud = { extraGroups = [ "nfsShare" ]; isSystemUser = true; + uid = 995; }; }; } diff --git a/modules/system/accounts/users/nginx/default.nix b/modules/system/accounts/users/nginx/default.nix index 304ff44..9697ae8 100644 --- a/modules/system/accounts/users/nginx/default.nix +++ b/modules/system/accounts/users/nginx/default.nix @@ -4,6 +4,7 @@ nginx = { extraGroups = [ "turnserver" "virtualMail" ]; isSystemUser = true; + uid = 60; }; }; } diff --git a/modules/system/default.nix b/modules/system/default.nix index 5dd77d0..4bc2579 100644 --- a/modules/system/default.nix +++ b/modules/system/default.nix @@ -1,12 +1,5 @@ -{ outputs, config, pkgs, ... }: { - imports = [ - ./accounts - ./modules/networking - ./modules/overlays - ./programs/git - ./services/garbage-collection - ]; - +{ outputs, config, pkgs, ... }: +{ nix = { settings = { experimental-features = "nix-command flakes"; @@ -36,5 +29,9 @@ packages = with pkgs; [ terminus_font ]; }; + nixpkgs.config.allowUnfree = true; hardware.enableRedistributableFirmware = true; + + # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion + system.stateVersion = "24.05"; } diff --git a/modules/system/devices/networking/wireguard/client/default.nix b/modules/system/devices/networking/wireguard/pc/default.nix similarity index 100% rename from modules/system/devices/networking/wireguard/client/default.nix rename to modules/system/devices/networking/wireguard/pc/default.nix diff --git a/modules/system/devices/networking/wireguard/host/default.nix b/modules/system/devices/networking/wireguard/server/default.nix similarity index 100% rename from modules/system/devices/networking/wireguard/host/default.nix rename to modules/system/devices/networking/wireguard/server/default.nix diff --git a/modules/system/services/common/default.nix b/modules/system/services/common/default.nix new file mode 100644 index 0000000..837aa1e --- /dev/null +++ b/modules/system/services/common/default.nix @@ -0,0 +1,6 @@ +{ ... }: +{ + imports = [ + ./ssh + ]; +} diff --git a/modules/system/services/default.nix b/modules/system/services/default.nix new file mode 100644 index 0000000..4c94199 --- /dev/null +++ b/modules/system/services/default.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + imports = [ + ./common + ./pc + ]; +} diff --git a/modules/system/services/pc/default.nix b/modules/system/services/pc/default.nix new file mode 100644 index 0000000..0e07249 --- /dev/null +++ b/modules/system/services/pc/default.nix @@ -0,0 +1,10 @@ +{ ... }: +{ + imports = [ + ./mpd + ./networkfs + ./school + ./sunshine + ./virtualization/qemu + ]; +} diff --git a/modules/system/services/server/default.nix b/modules/system/services/server/default.nix new file mode 100644 index 0000000..c99b72b --- /dev/null +++ b/modules/system/services/server/default.nix @@ -0,0 +1,18 @@ +{ ... }: +{ + imports = [ + ./acme + ./ddclient + ./fileserver + ./forgejo + ./icecast + ./mailserver + ./minecraft + ./misc + ./mysql + ./nginx + ./social + ./transmission + ./vaultwarden + ]; +}