diff --git a/hosts/lacros/id_ed25519.pub b/hosts/lacros/id_ed25519.pub index e36a85d..1fa6123 100644 --- a/hosts/lacros/id_ed25519.pub +++ b/hosts/lacros/id_ed25519.pub @@ -1 +1 @@ -ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC2lMkUd+BbXITE5LTg94hEzmA6UKsIIbaf5YOjGoLzl +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBk6ALxn+zKrRys6/c1oYSoWJaUUEo3nAM224ElhjJQR diff --git a/modules/extras/overlays/default.nix b/modules/extras/overlays/default.nix index c24e25c..3086ea3 100644 --- a/modules/extras/overlays/default.nix +++ b/modules/extras/overlays/default.nix @@ -1,7 +1,4 @@ { ... }: { - imports = [ - ./packages - ./unstable - ]; + imports = [ ./unstable ]; } diff --git a/modules/extras/overlays/packages/default.nix b/modules/extras/overlays/packages/default.nix deleted file mode 100644 index a9e3e72..0000000 --- a/modules/extras/overlays/packages/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ pkgs, ... }: -{ - nixpkgs.overlays = [ - (final: _prev: { - xash3d = pkgs.callPackage ./xash3d {}; - hlsdk = pkgs.callPackage ./hlsdk {}; - }) - ]; -} diff --git a/modules/extras/overlays/packages/hlsdk/default.nix b/modules/extras/overlays/packages/hlsdk/default.nix deleted file mode 100644 index 4e52de7..0000000 --- a/modules/extras/overlays/packages/hlsdk/default.nix +++ /dev/null @@ -1,52 +0,0 @@ -{ lib -, pkgs -, stdenv -, fetchFromGitHub -, gamedir ? "valve" -, enableGoldsourceSupport ? true -, enableVgui ? false -, enableVoicemgr ? false -, enableBugfixes ? false -, enableCrowbarIdleAnim ? false -}: - -stdenv.mkDerivation { - pname = "fwgs-hlsdk"; - version = "2023-03-01"; - - nativeBuildInputs = with pkgs; [cmake]; - - src = fetchFromGitHub { - owner = "FWGS"; - repo = "hlsdk-portable"; - rev = "d11f853464ee5d951e25ce9d0eea001780b92196"; - sha256 = if enableVgui then "sha256-Qd+SUie+jlfxo6aefordYw665ZaNaR3TxufntfIaoCo=" else "sha256-WU+I+mmoyXvW1pvqJLddPaA8/tod3TtvqzVPYJRbGz4="; - fetchSubmodules = enableVgui; - }; - - cmakeFlags = let - optionals = lib.optionals; - optional = (cond: val: optionals cond [val]); - cmakeBool = (x: if x then "ON" else "OFF"); - in [ - "-DUSE_VGUI=${cmakeBool enableVgui}" - "-DGOLDSOURCE_SUPPORT=${cmakeBool enableGoldsourceSupport}" - "-DUSE_VOICEMGR=${cmakeBool enableVoicemgr}" - "-DBARNACLE_FIX_VISIBILITY=${cmakeBool enableBugfixes}" - "-DCROWBAR_DELAY_FIX=${cmakeBool enableBugfixes}" - "-DCROWBAR_FIX_RAPID_CROWBAR=${cmakeBool enableBugfixes}" - "-DGAUSS_OVERCHARGE_FIX=${cmakeBool enableBugfixes}" - "-DTRIPMINE_BEAM_DUPLICATION_FIX=${cmakeBool enableBugfixes}" - "-DHANDGRENADE_DEPLOY_FIX=${cmakeBool enableBugfixes}" - "-DWEAPONS_ANIMATION_TIMES_FIX=${cmakeBool enableBugfixes}" - "-DCROWBAR_IDLE_ANIM=${cmakeBool enableCrowbarIdleAnim}" - ] ++ (optional (gamedir != "valve") "-DGAMEDIR=${gamedir}") - ++ (optional stdenv.is64bit "-D64BIT=ON"); - - meta = with lib; { - description = "Portable Half-Life SDK. GoldSource and Xash3D. Crossplatform."; - homepage = "https://github.com/FWGS/hlsdk-portable"; - license = with licenses; [ unfree ]; - # maintainers = with maintainers; [ chayleaf ]; - }; -} diff --git a/modules/extras/overlays/packages/xash3d/change-zip-date.patch b/modules/extras/overlays/packages/xash3d/change-zip-date.patch deleted file mode 100644 index d907a52..0000000 --- a/modules/extras/overlays/packages/xash3d/change-zip-date.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/scripts/waifulib/zip.py b/scripts/waifulib/zip.py -index 6e903ba7..d47f1754 100644 ---- a/scripts/waifulib/zip.py -+++ b/scripts/waifulib/zip.py -@@ -25,7 +25,11 @@ class ziparchive(Task.Task): - arcfile = src.path_from(self.relative_to) - - Logs.debug('%s: %s <- %s as %s', self.__class__.__name__, outfile, infile, arcfile) -- zf.write(infile, arcfile) -+ -+ arcfile = zipfile.ZipInfo(filename=arcfile, date_time=(1980, 1, 1, 0, 0, 0)) -+ -+ with open(infile, 'rb') as f: -+ zf.writestr(arcfile, f.read()) - - @TaskGen.feature('zip') - def create_zip_archive(self): \ No newline at end of file diff --git a/modules/extras/overlays/packages/xash3d/default.nix b/modules/extras/overlays/packages/xash3d/default.nix deleted file mode 100644 index 7afff9e..0000000 --- a/modules/extras/overlays/packages/xash3d/default.nix +++ /dev/null @@ -1,68 +0,0 @@ -{ lib -, pkgs -, stdenv -, fetchFromGitHub -, dedicated ? false # dedicated server -, gamedir ? "valve" -, enableBsp2 ? false # bsp2 support (for quake) -, enableGles1 ? false # gles1 renderer (nanogl) -, enableGles2 ? false # gles2 renderer (glwes) -, enableGl4es ? false # gles2 renderer (gl4es) -, enableGl ? true # opengl renderer -, enableSoft ? true # soft renderer -, enableUtils ? false # mdldec -}: - -stdenv.mkDerivation { - pname = "xash3d-fwgs"; - version = "2023-03-01"; - - nativeBuildInputs = with pkgs; [python3 pkg-config makeWrapper]; - buildInputs = with pkgs; [SDL2 libopus freetype fontconfig]; - - src = fetchFromGitHub { - owner = "FWGS"; - repo = "xash3d-fwgs"; - rev = "7e9d46689ca76d6bf1669ada6344fc724dd683cf"; - sha256 = "sha256-rvONYm1Gz9PpK8KY6RIIJ82FtxGcWe/4YoT2eV4sCOc="; - fetchSubmodules = true; - }; - patches = [ ./change-zip-date.patch ]; - - configurePhase = let - optionals = lib.optionals; - optional = (cond: val: optionals cond [val]); - flags = ["-8" "-P" "--prefix=/"] - ++ (optional dedicated "-d") - ++ (optionals (gamedir != "valve") ["--gamedir" gamedir]) - ++ (optional enableBsp2 "--enable-bsp2") - ++ (optional enableGles1 "--enable-gles1") - ++ (optional enableGles2 "--enable-gles2") - ++ (optional enableGl4es "--enable-gl4es") - ++ (optional (!enableGl) "--disable-gl") - ++ (optional (!enableSoft) "--disable-soft") - ++ (optional enableUtils "--enable-utils") - ; - in '' - python3 ./waf configure -T release ${lib.strings.escapeShellArgs flags} - ''; - - buildPhase = '' - python3 ./waf build - ''; - - installPhase = '' - python3 ./waf install "--destdir=$out" - mkdir $out/bin - makeWrapper $out/lib/xash3d/xash3d $out/bin/xash3d --set XASH3D_EXTRAS_PAK1 $out/share/xash3d/valve/extras.pk3 - ''; - - meta = with lib; { - description = "Xash3D FWGS engine"; - homepage = "https://github.com/FWGS/xash3d-fwgs"; - # this is a mess because of vendoring... - # maybe the correct thing to do use to simply use `[ unfree gpl3Plus ]` instead - license = with licenses; [ unfree gpl2Plus gpl3Plus lgpl3Plus mit bsd3 ]; - # maintainers = with maintainers; [ chayleaf ]; - }; -} diff --git a/modules/home/programs/gui/rofi/default.nix b/modules/home/programs/gui/rofi/default.nix index 1828492..20bdf93 100644 --- a/modules/home/programs/gui/rofi/default.nix +++ b/modules/home/programs/gui/rofi/default.nix @@ -125,37 +125,23 @@ }; home.packages = with pkgs; [ - (pkgs.writeScriptBin "rofiscripts" '' - # Scratchpad function - scratchpads() { - SCRATCHPADS=$(echo -e "Btop\nMusic\nSound\nEasyEffects" | rofi -dmenu -i -p "Scratchpads") - case $SCRATCHPADS in - Btop) foot -a btop -T Btop btop;; - Music) foot -a music -T Music ncmpcpp;; - Sound) foot -a sound -T Sound pulsemixer;; - esac - } - - # Lock menu - power() { - POWER=$(echo -e "Shutdown\nReboot\nSleep\nLock\nKill" | rofi -dmenu -i -p "Power") - case $POWER in - Shutdown) poweroff;; - Reboot) reboot;; - Sleep) sleep-$XDG_CURRENT_DESKTOP &;; - Lock) swaylock &;; - Kill) pkill -9 $XDG_CURRENT_DESKTOP;; - esac - } - - # Check for command-line arguments - if [ "$1" == "--scratchpads" ]; then - scratchpads - elif [ "$1" == "--power" ]; then - power - else - echo "Please --scratchpads or --power." - fi + (pkgs.writeScriptBin "rofiscratch" '' + SCRATCHPADS=$(echo -e "Btop\nMusic\nSound\nEasyEffects" | rofi -dmenu -i -p "Scratchpads") + case $SCRATCHPADS in + Btop) foot -a btop -T Btop btop;; + Music) foot -a music -T Music ncmpcpp;; + Sound) foot -a sound -T Sound pulsemixer;; + esac + '') + (pkgs.writeScriptBin "rofipower" '' + POWER=$(echo -e "Shutdown\nReboot\nSleep\nLock\nKill" | rofi -dmenu -i -p "Power") + case $POWER in + Shutdown) poweroff;; + Reboot) reboot;; + Sleep) sleep-$XDG_CURRENT_DESKTOP &;; + Lock) swaylock &;; + Kill) pkill -9 $XDG_CURRENT_DESKTOP;; + esac '') rofi-bluetooth bemoji diff --git a/modules/home/programs/misc/avtools/spotdl/default.nix b/modules/home/programs/misc/avtools/spotdl/default.nix index 24b029f..f280f9b 100644 --- a/modules/home/programs/misc/avtools/spotdl/default.nix +++ b/modules/home/programs/misc/avtools/spotdl/default.nix @@ -1,5 +1,7 @@ { pkgs, ... }: { - home.packages = with pkgs; [ spotdl ]; - programs.zsh.shellAliases.spotdl = "spotdl --m3u --format opus"; + home = { + packages = with pkgs; [ spotdl ]; + shellAliases.spotdl = "spotdl --m3u --format opus"; + }; } diff --git a/modules/home/programs/misc/avtools/yt-dlp/default.nix b/modules/home/programs/misc/avtools/yt-dlp/default.nix index fc4892d..e8239bc 100644 --- a/modules/home/programs/misc/avtools/yt-dlp/default.nix +++ b/modules/home/programs/misc/avtools/yt-dlp/default.nix @@ -1,20 +1,19 @@ { ... }: { - programs = { - yt-dlp = { - enable = true; - settings = { - add-metadata = true; - embed-thumbnail = true; - convert-thumbnails = "jpg"; - audio-format = "opus"; - output = ''"%(artist)s - %(title)s.%(ext)s"''; - }; - }; - zsh.shellAliases = { - ytm3u = "yt-dlp -gS proto:m3u8"; - opusdl = ''yt-dlp -f ba -x --audio-quality 0''; - spotdl = "spotdl --m3u --format opus"; + programs.yt-dlp = { + enable = true; + settings = { + add-metadata = true; + embed-thumbnail = true; + convert-thumbnails = "jpg"; + audio-format = "opus"; + output = ''"%(artist)s - %(title)s.%(ext)s"''; }; }; + + home.shellAliases = { + ytm3u = "yt-dlp -gS proto:m3u8"; + opusdl = ''yt-dlp -f ba -x --audio-quality 0''; + spotdl = "spotdl --m3u --format opus"; + }; } diff --git a/modules/home/programs/misc/gaming/default.nix b/modules/home/programs/misc/gaming/default.nix index 0508cd9..5f77668 100644 --- a/modules/home/programs/misc/gaming/default.nix +++ b/modules/home/programs/misc/gaming/default.nix @@ -2,7 +2,6 @@ { imports = [ ./launchers - ./games ./emulators ]; } diff --git a/modules/home/programs/misc/gaming/games/default.nix b/modules/home/programs/misc/gaming/games/default.nix deleted file mode 100644 index b951409..0000000 --- a/modules/home/programs/misc/gaming/games/default.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ pkgs, ... }: -{ - home.packages = with pkgs; [ xash3d ]; -} diff --git a/modules/home/wms/hyprland/hotkeys/default.nix b/modules/home/wms/hyprland/hotkeys/default.nix index ddbe8b5..12cd5aa 100644 --- a/modules/home/wms/hyprland/hotkeys/default.nix +++ b/modules/home/wms/hyprland/hotkeys/default.nix @@ -21,7 +21,7 @@ # Prime + key "${primeMod}, s, exec, rofi -show run -p Command" "${primeMod}, c, exec, clipman pick -t rofi" - "${primeMod}, x, exec, rofiscripts --power" + "${primeMod}, x, exec, rofipower" "${primeMod}, b, exec, pkill -USR1 waybar" "${primeMod}, Return, exec, foot" @@ -33,7 +33,7 @@ "${primeMod} Shift, Return, exec, foot ranger" # Prime + ctrl + key - "${primeMod} Ctrl, s, exec, rofiscripts --scratchpads" + "${primeMod} Ctrl, s, exec, rofiscratch" ''${primeMod} Ctrl, c, exec, wlpicker && notify-send "Color copied to clipboard"'' ## Media diff --git a/modules/home/wms/niri/hotkeys/default.nix b/modules/home/wms/niri/hotkeys/default.nix index b2a67e8..be2af53 100644 --- a/modules/home/wms/niri/hotkeys/default.nix +++ b/modules/home/wms/niri/hotkeys/default.nix @@ -20,7 +20,7 @@ // Prime + key ${primeMod}+s { spawn "sh" "-c" "rofi -show run -p Command"; } ${primeMod}+c { spawn "sh" "-c" "clipman pick -t rofi"; } - ${primeMod}+x { spawn "sh" "-c" "rofiscripts --power"; } + ${primeMod}+x { spawn "sh" "-c" "rofipower"; } ${primeMod}+b { spawn "sh" "-c" "pkill -USR1 waybar"; } ${primeMod}+Return { spawn "sh" "-c" "foot"; } @@ -32,7 +32,7 @@ ${primeMod}+Shift+Return { spawn "sh" "-c" "foot ranger"; } // Prime + ctrl + key - ${primeMod}+Ctrl+s { spawn "sh" "-c" "rofiscripts --scratchpads"; } + ${primeMod}+Ctrl+s { spawn "sh" "-c" "rofiscratch"; } ${primeMod}+Ctrl+c { spawn "sh" "-c" "wlpicker && notify-send \"Color copied to clipboard\""; } //// Media diff --git a/modules/home/wms/programs/waybar/default.nix b/modules/home/wms/programs/waybar/default.nix index 26e93da..4697927 100644 --- a/modules/home/wms/programs/waybar/default.nix +++ b/modules/home/wms/programs/waybar/default.nix @@ -248,7 +248,7 @@ "sway/scratchpad" = scratchpadModule; "tray" = trayModule; "bluetooth" = bluetoothModule; - "network" = networkModule // { interface = "enp*"; }; + "network" = networkModule; }; display2 = { diff --git a/modules/home/wms/sway/hotkeys/default.nix b/modules/home/wms/sway/hotkeys/default.nix index 4079521..c9f89d4 100644 --- a/modules/home/wms/sway/hotkeys/default.nix +++ b/modules/home/wms/sway/hotkeys/default.nix @@ -23,7 +23,7 @@ # Prime + key "${primeMod}+s" = ''exec rofi -show run -p Command''; "${primeMod}+c" = ''exec clipman pick -t rofi''; - "${primeMod}+x" = ''exec rofiscripts --power''; + "${primeMod}+x" = ''exec rofipower''; "${primeMod}+b" = ''exec pkill -USR1 waybar''; "${primeMod}+Return" = ''exec foot''; @@ -36,7 +36,7 @@ # Prime + ctrl + key "${primeMod}+Ctrl+x" = ''exec prop-sway''; - "${primeMod}+Ctrl+s" = ''exec rofiscripts --scratchpads''; + "${primeMod}+Ctrl+s" = ''exec rofiscratch''; "${primeMod}+Ctrl+c" = ''exec wlpicker && notify-send "Color copied to clipboard"''; ## Media diff --git a/modules/system/accounts/users/jimbo/default.nix b/modules/system/accounts/users/jimbo/default.nix index 50c5527..a9d610a 100644 --- a/modules/system/accounts/users/jimbo/default.nix +++ b/modules/system/accounts/users/jimbo/default.nix @@ -1,41 +1,39 @@ { pkgs, config, ... }: { - users.users = { - jimbo = { - description = "Jimbo"; - hashedPassword = config.secrets.jimboAccPass; - isNormalUser = true; - openssh.authorizedKeys.keys = [ - (builtins.readFile ../../../../../hosts/tower/id_ed25519.pub) + users.users.jimbo = { + description = "Jimbo"; + hashedPassword = config.secrets.jimboAccPass; + isNormalUser = true; + openssh.authorizedKeys.keys = [ + (builtins.readFile ../../../../../hosts/tower/id_ed25519.pub) - (builtins.readFile ../../../../../hosts/axolotl/id_ed25519.pub) - (builtins.readFile ../../../../../hosts/lacros/id_ed25519.pub) - (builtins.readFile ../../../../../hosts/redmond/id_ed25519.pub) + (builtins.readFile ../../../../../hosts/axolotl/id_ed25519.pub) + (builtins.readFile ../../../../../hosts/lacros/id_ed25519.pub) + (builtins.readFile ../../../../../hosts/redmond/id_ed25519.pub) - (builtins.readFile ../../../../../hosts/kitty/id_ed25519.pub) - (builtins.readFile ../../../../../hosts/xenia/id_ed25519.pub) - (builtins.readFile ../../../../../hosts/prophet/id_ed25519.pub) + (builtins.readFile ../../../../../hosts/kitty/id_ed25519.pub) + (builtins.readFile ../../../../../hosts/xenia/id_ed25519.pub) + (builtins.readFile ../../../../../hosts/prophet/id_ed25519.pub) - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJahAoF74BY6GCTsFkt1ADKaraFgJJozW1Y1aBTLK0j9 Pixel9" - ]; - extraGroups = [ - "wheel" - "audio" - "video" - "input" - "disk" - "dialout" - "rtkit" - "kvm" - "libvirtd" - "qemu-libvirtd" - "nginx" - "minecraft" - "nfsShare" - ]; - uid = 1000; - shell = pkgs.zsh; - }; + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJahAoF74BY6GCTsFkt1ADKaraFgJJozW1Y1aBTLK0j9 Pixel9" + ]; + extraGroups = [ + "wheel" + "audio" + "video" + "input" + "disk" + "dialout" + "rtkit" + "kvm" + "libvirtd" + "qemu-libvirtd" + "nginx" + "minecraft" + "nfsShare" + ]; + uid = 1000; + shell = pkgs.zsh; }; home-manager.users.jimbo = import ../../../../home; diff --git a/modules/system/devices/audio/default.nix b/modules/system/devices/audio/default.nix index fed96bd..daafb03 100644 --- a/modules/system/devices/audio/default.nix +++ b/modules/system/devices/audio/default.nix @@ -1,20 +1,22 @@ -{ config, pkgs, ... }: +{ lib, config, pkgs, ... }: { - services.pipewire = { - enable = config.system.desktop.enable; - wireplumber = { + config = lib.mkIf config.system.desktop.enable { + services.pipewire = { enable = true; - configPackages = [ - (pkgs.writeTextDir "share/wireplumber/wireplumber.conf.d/11-bluetooth-policy.conf" '' - wireplumber.settings = { bluetooth.autoswitch-to-headset-profile = false } - '') - ]; + wireplumber = { + enable = true; + configPackages = [ + (pkgs.writeTextDir "share/wireplumber/wireplumber.conf.d/11-bluetooth-policy.conf" '' + wireplumber.settings = { bluetooth.autoswitch-to-headset-profile = false } + '') + ]; + }; + alsa = { + enable = true; + support32Bit = true; + }; + pulse.enable = true; + #jack.enable = true; }; - alsa = { - enable = true; - support32Bit = true; - }; - pulse.enable = true; - #jack.enable = true; }; } diff --git a/modules/system/programs/backlights/default.nix b/modules/system/programs/backlights/default.nix index 938d7d9..7fffaf9 100644 --- a/modules/system/programs/backlights/default.nix +++ b/modules/system/programs/backlights/default.nix @@ -1,7 +1,9 @@ -{ config, ... }: +{ lib, config, ... }: { - programs = { - light.enable = config.system.desktop.enable; - kbdlight.enable = config.system.desktop.enable; + config = lib.mkIf config.system.desktop.enable { + programs = { + light.enable = true; + kbdlight.enable = true; + }; }; } diff --git a/modules/system/programs/desktops/default.nix b/modules/system/programs/desktops/default.nix index ad4fbdf..5cc0e36 100644 --- a/modules/system/programs/desktops/default.nix +++ b/modules/system/programs/desktops/default.nix @@ -1,17 +1,19 @@ { config, lib, ... }: { - programs = { - sway.enable = config.system.desktop.enable; - niri.enable = config.system.desktop.enable; - hyprland.enable = config.system.desktop.enable; - xwayland.enable = lib.mkForce true; - }; + config = lib.mkIf config.system.desktop.enable { + programs = { + sway.enable = true; + niri.enable = true; + hyprland.enable = true; + xwayland.enable = lib.mkForce true; + }; - environment.sessionVariables = { - WLR_RENDERER = "vulkan"; - NIXOS_OZONE_WL = "1"; - }; + environment.sessionVariables = { + WLR_RENDERER = "vulkan"; + NIXOS_OZONE_WL = "1"; + }; - services.dbus.enable = config.system.desktop.enable; - security.pam.services.swaylock = {}; + services.dbus.enable = true; + security.pam.services.swaylock = {}; + }; } diff --git a/modules/system/programs/gaming/default.nix b/modules/system/programs/gaming/default.nix index 7a1470d..7a4f414 100644 --- a/modules/system/programs/gaming/default.nix +++ b/modules/system/programs/gaming/default.nix @@ -1,9 +1,11 @@ -{ config, ... }: +{ config, lib, ... }: { - programs.gamemode = { - enable = config.system.desktop.enable; - settings.general.renice = 10; - }; + config = lib.mkIf config.system.desktop.enable { + programs.gamemode = { + enable = true; + settings.general.renice = 10; + }; - hardware.steam-hardware.enable = config.system.desktop.enable; + hardware.steam-hardware.enable = config.system.desktop.enable; + }; } diff --git a/modules/system/services/general/displaymanager/default.nix b/modules/system/services/general/displaymanager/default.nix index f3bdeee..ad5fdce 100644 --- a/modules/system/services/general/displaymanager/default.nix +++ b/modules/system/services/general/displaymanager/default.nix @@ -1,34 +1,36 @@ -{ config, pkgs, ... }: +{ config, pkgs, lib, ... }: { - services.greetd = { - enable = config.system.desktop.enable; - restart = true; - settings = { - terminal = { - vt = 2; - switch = true; + config = lib.mkIf config.system.desktop.enable { + services.greetd = { + enable = true; + restart = true; + settings = { + terminal = { + vt = 2; + switch = true; + }; + default_session.command = '' + ${pkgs.greetd.tuigreet}/bin/tuigreet --remember --remember-user-session --user-menu --asterisks --sessions /etc/greetd/environments + ''; }; - default_session.command = '' - ${pkgs.greetd.tuigreet}/bin/tuigreet --remember --remember-user-session --user-menu --asterisks --sessions /etc/greetd/environments + }; + + environment.etc = { + "greetd/environments/sway.desktop".text = '' + [Desktop Entry] + Name=Sway + Exec=sway --unsupported-gpu + ''; + "greetd/environments/niri.desktop".text = '' + [Desktop Entry] + Name=Niri + Exec=niri-session + ''; + "greetd/environments/hyprland.desktop".text = '' + [Desktop Entry] + Name=Hyprland + Exec=Hyprland ''; }; }; - - environment.etc = { - "greetd/environments/sway.desktop".text = '' - [Desktop Entry] - Name=Sway - Exec=sway --unsupported-gpu - ''; - "greetd/environments/niri.desktop".text = '' - [Desktop Entry] - Name=Niri - Exec=niri-session - ''; - "greetd/environments/hyprland.desktop".text = '' - [Desktop Entry] - Name=Hyprland - Exec=Hyprland - ''; - }; } diff --git a/modules/system/services/general/gvfs/default.nix b/modules/system/services/general/gvfs/default.nix index e9a4838..cc0a7aa 100644 --- a/modules/system/services/general/gvfs/default.nix +++ b/modules/system/services/general/gvfs/default.nix @@ -1,7 +1,7 @@ -{ config, ... }: +{ config, lib, ... }: { - services = { - gvfs.enable = config.system.desktop.enable; - udisks2.enable = config.system.desktop.enable; + services = lib.mkIf config.system.desktop.enable { + gvfs.enable = true; + udisks2.enable = true; }; } diff --git a/modules/system/services/general/portals/default.nix b/modules/system/services/general/portals/default.nix index 659669b..43649a0 100644 --- a/modules/system/services/general/portals/default.nix +++ b/modules/system/services/general/portals/default.nix @@ -1,17 +1,19 @@ { config, pkgs, lib, ... }: { - xdg.portal = { - wlr = { - enable = lib.mkForce config.system.desktop.enable; - settings.screencast = { - max_fps = 60; - chooser_type = "simple"; - chooser_cmd = "${pkgs.slurp}/bin/slurp -f %o -or -B 00000066 -b 00000099"; + config = lib.mkIf config.system.desktop.enable { + xdg.portal = { + wlr = { + enable = lib.mkForce true; + settings.screencast = { + max_fps = 60; + chooser_type = "simple"; + chooser_cmd = "${pkgs.slurp}/bin/slurp -f %o -or -B 00000066 -b 00000099"; + }; }; + extraPortals = with pkgs; [ + xdg-desktop-portal-gnome + xdg-desktop-portal-hyprland + ]; }; - extraPortals = with pkgs; [ - xdg-desktop-portal-gnome - xdg-desktop-portal-hyprland - ]; }; } diff --git a/modules/system/services/general/tlp/default.nix b/modules/system/services/general/tlp/default.nix index b0cec06..097e7bc 100644 --- a/modules/system/services/general/tlp/default.nix +++ b/modules/system/services/general/tlp/default.nix @@ -1,4 +1,4 @@ -{ lib, ... }: +{ ... }: { services.tlp.enable = true; } diff --git a/modules/system/services/server/fileserver/local/samba/default.nix b/modules/system/services/server/fileserver/local/samba/default.nix index d844597..f3df7d5 100644 --- a/modules/system/services/server/fileserver/local/samba/default.nix +++ b/modules/system/services/server/fileserver/local/samba/default.nix @@ -20,7 +20,7 @@ # Advertise to Windows samba-wsdd = { - enable = config.system.server.enable; + enable = config.services.samba.enable; openFirewall = true; }; }; diff --git a/modules/system/services/server/fileserver/public/default.nix b/modules/system/services/server/fileserver/public/default.nix index 252fe21..c3610c0 100644 --- a/modules/system/services/server/fileserver/public/default.nix +++ b/modules/system/services/server/fileserver/public/default.nix @@ -1,7 +1,4 @@ { ... }: { - imports = [ - ./nextcloud - ./photoprism - ]; + imports = [ ./nextcloud ]; } diff --git a/modules/system/services/server/fileserver/public/nextcloud/nginx/default.nix b/modules/system/services/server/fileserver/public/nextcloud/nginx/default.nix index 367a642..04f61f5 100644 --- a/modules/system/services/server/fileserver/public/nextcloud/nginx/default.nix +++ b/modules/system/services/server/fileserver/public/nextcloud/nginx/default.nix @@ -1,6 +1,6 @@ -{ config, ... }: +{ lib, config, ... }: { - services.nginx.virtualHosts."cloud.${config.domains.jim1}" = { + services.nginx.virtualHosts."cloud.${config.domains.jim1}" = lib.mkIf config.services.nextcloud.enable { enableACME = true; addSSL = true; onlySSL = true; diff --git a/modules/system/services/server/fileserver/public/photoprism/default.nix b/modules/system/services/server/fileserver/public/photoprism/default.nix deleted file mode 100644 index b176bb4..0000000 --- a/modules/system/services/server/fileserver/public/photoprism/default.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ config, ... }: -{ - imports = [ ./nginx ]; - - services.photoprism = { - enable = config.system.server.enable; - port = 2342; - originalsPath = "/var/lib/private/photoprism/originals"; - address = "0.0.0.0"; - settings = { - PHOTOPRISM_ADMIN_USER = "jimbo"; - PHOTOPRISM_ADMIN_PASSWORD = "${config.secrets.prismAdminPass}"; - PHOTOPRISM_DEFAULT_LOCALE = "en"; - PHOTOPRISM_DATABASE_DRIVER = "mysql"; - PHOTOPRISM_DATABASE_NAME = "photoprism"; - PHOTOPRISM_DATABASE_SERVER = "/run/mysqld/mysqld.sock"; - PHOTOPRISM_DATABASE_USER = "photoprism"; - PHOTOPRISM_SITE_URL = "https://gallery.${config.domains.jim1}"; - PHOTOPRISM_SITE_TITLE = "Jimbo's PhotoPrism"; - }; - }; -} diff --git a/modules/system/services/server/fileserver/public/photoprism/nginx/default.nix b/modules/system/services/server/fileserver/public/photoprism/nginx/default.nix deleted file mode 100644 index 169d953..0000000 --- a/modules/system/services/server/fileserver/public/photoprism/nginx/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ config, ... }: -{ - services.nginx.virtualHosts."gallery.${config.domains.jim1}" = { - enableACME = true; - forceSSL = true; - locations."/" = { - proxyPass = "http://127.0.0.1:2342"; - proxyWebsockets = true; - }; - }; -} diff --git a/modules/system/services/server/forgejo/default.nix b/modules/system/services/server/forgejo/default.nix index e70f3dc..027cc0d 100644 --- a/modules/system/services/server/forgejo/default.nix +++ b/modules/system/services/server/forgejo/default.nix @@ -2,33 +2,33 @@ { imports = [ ./nginx ]; - services.forgejo = { - enable = config.system.server.enable; - settings = { - server = { - DOMAIN = "git.${config.domains.jim1}"; - ROOT_URL = "https://git.${config.domains.jim1}:443"; - HTTP_PORT = 3110; - SSH_PORT = 2299; - START_SSH_SERVER = true; - }; - ui = { - DEFAULT_THEME = "forgejo-dark"; - }; - mailer = { - ENABLED = true; - SMTP_ADDR = "mx.${config.domains.jim1}"; - FROM = "Jimbo's Git "; - USER = "noreply@${config.domains.jim1}"; - PASSWD = config.secrets.noreplyPassword; - PROTOCOL = "smtps"; - }; - service = { - REGISTER_EMAIL_CONFIRM = true; - DISABLE_REGISTRATION = true; + config = lib.mkIf config.system.server.enable { + services.forgejo = { + enable = true; + settings = { + server = { + DOMAIN = "git.${config.domains.jim1}"; + ROOT_URL = "https://git.${config.domains.jim1}:443"; + HTTP_PORT = 3110; + SSH_PORT = 2299; + START_SSH_SERVER = true; + }; + mailer = { + ENABLED = true; + SMTP_ADDR = "mx.${config.domains.jim1}"; + FROM = "Jimbo's Git "; + USER = "noreply@${config.domains.jim1}"; + PASSWD = config.secrets.noreplyPassword; + PROTOCOL = "smtps"; + }; + service = { + REGISTER_EMAIL_CONFIRM = true; + DISABLE_REGISTRATION = true; + }; + ui.DEFAULT_THEME = "forgejo-dark"; }; }; - }; - networking.firewall.allowedTCPPorts = [ 2299 ]; + networking.firewall.allowedTCPPorts = [ 2299 ]; + }; } diff --git a/modules/system/services/server/forgejo/nginx/default.nix b/modules/system/services/server/forgejo/nginx/default.nix index 23354d7..6cff04e 100644 --- a/modules/system/services/server/forgejo/nginx/default.nix +++ b/modules/system/services/server/forgejo/nginx/default.nix @@ -1,6 +1,6 @@ -{ config, ... }: +{ lib, config, ... }: { - services.nginx.virtualHosts."git.${config.domains.jim1}" = { + services.nginx.virtualHosts."git.${config.domains.jim1}" = lib.mkIf config.services.forgejo.enable { enableACME = true; forceSSL = true; locations."/" = { diff --git a/modules/system/services/server/icecast/nginx/default.nix b/modules/system/services/server/icecast/nginx/default.nix index de520cf..54aee63 100644 --- a/modules/system/services/server/icecast/nginx/default.nix +++ b/modules/system/services/server/icecast/nginx/default.nix @@ -1,6 +1,6 @@ -{ config, ... }: +{ lib, config, ... }: { - services.nginx.virtualHosts."icecast.${config.domains.jim1}" = { + services.nginx.virtualHosts."icecast.${config.domains.jim1}" = lib.mkIf services.icecast.enable { enableACME = true; forceSSL = true; locations."/" = { diff --git a/modules/system/services/server/mailserver/simplenix/default.nix b/modules/system/services/server/mailserver/simplenix/default.nix index 63dc29b..8aad38c 100644 --- a/modules/system/services/server/mailserver/simplenix/default.nix +++ b/modules/system/services/server/mailserver/simplenix/default.nix @@ -6,7 +6,7 @@ ]; mailserver = rec { - enable = config.system.mailserver.enable; + enable = true; domains = [ "${config.domains.jim1}" "${config.domains.jim2}" diff --git a/modules/system/services/server/snowflake/default.nix b/modules/system/services/server/snowflake/default.nix new file mode 100644 index 0000000..6c9a989 --- /dev/null +++ b/modules/system/services/server/snowflake/default.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + services.snowflake-proxy.enable = true; +} diff --git a/modules/system/settings/security/polkit/default.nix b/modules/system/settings/security/polkit/default.nix index 1b00dae..2539503 100644 --- a/modules/system/settings/security/polkit/default.nix +++ b/modules/system/settings/security/polkit/default.nix @@ -1,7 +1,7 @@ -{ config, ... }: +{ config, lib, ... }: { - security = { - polkit.enable = config.system.desktop.enable; - rtkit.enable = config.system.desktop.enable; + security = lib.mkIf config.system.desktop.enable { + polkit.enable = true; + rtkit.enable = true; }; } diff --git a/modules/system/settings/security/rtprio/default.nix b/modules/system/settings/security/rtprio/default.nix index 8b71080..3ff7add 100644 --- a/modules/system/settings/security/rtprio/default.nix +++ b/modules/system/settings/security/rtprio/default.nix @@ -1,6 +1,6 @@ -{ ... }: +{ lib, config, ... }: { - security.pam.loginLimits = [ + security.pam.loginLimits = lib.mkIf config.system.desktop.enable [ { domain = "@users"; item = "rtprio";