From 31c316d19cd974bb81a5d6de62142ff24db1c78e Mon Sep 17 00:00:00 2001 From: triethyl Date: Tue, 2 Sep 2025 10:48:21 -0400 Subject: reorganized directory structure --- nixos/features/services/bundles/printing.nix | 13 ++++++++ nixos/features/services/core/systemd-boot.nix | 11 +++++++ nixos/features/services/extra/plymouth.nix | 36 ++++++++++++++++++++++ nixos/features/services/extra/sddm.nix | 23 ++++++++++++++ nixos/features/services/extra/ssh.nix | 14 +++++++++ nixos/features/services/extra/syncthing-client.nix | 35 +++++++++++++++++++++ nixos/features/services/extra/udisks2.nix | 12 ++++++++ nixos/features/services/hardware/bluetooth.nix | 23 ++++++++++++++ nixos/features/services/hardware/iwd.nix | 19 ++++++++++++ .../features/services/hardware/networkmanager.nix | 11 +++++++ nixos/features/services/hardware/pipewire.nix | 15 +++++++++ 11 files changed, 212 insertions(+) create mode 100644 nixos/features/services/bundles/printing.nix create mode 100644 nixos/features/services/core/systemd-boot.nix create mode 100644 nixos/features/services/extra/plymouth.nix create mode 100644 nixos/features/services/extra/sddm.nix create mode 100644 nixos/features/services/extra/ssh.nix create mode 100644 nixos/features/services/extra/syncthing-client.nix create mode 100644 nixos/features/services/extra/udisks2.nix create mode 100644 nixos/features/services/hardware/bluetooth.nix create mode 100644 nixos/features/services/hardware/iwd.nix create mode 100644 nixos/features/services/hardware/networkmanager.nix create mode 100644 nixos/features/services/hardware/pipewire.nix (limited to 'nixos/features/services') diff --git a/nixos/features/services/bundles/printing.nix b/nixos/features/services/bundles/printing.nix new file mode 100644 index 0000000..ea255be --- /dev/null +++ b/nixos/features/services/bundles/printing.nix @@ -0,0 +1,13 @@ +{ config, lib, ... }: let + cfg = config.features.services.bundles.printing; +in { + options.features.services.bundles.printing.enable = lib.mkEnableOption "printing"; + config = lib.mkIf cfg.enable { + services.printing.enable = true; + services.avahi = { + enable = true; + nssmdns4 = true; + openFirewall = true; + }; + }; +} diff --git a/nixos/features/services/core/systemd-boot.nix b/nixos/features/services/core/systemd-boot.nix new file mode 100644 index 0000000..2826f1b --- /dev/null +++ b/nixos/features/services/core/systemd-boot.nix @@ -0,0 +1,11 @@ +{ config, lib, ... }: let + cfg = config.features.services.core.systemd-boot; +in { + options.features.services.core.systemd-boot.enable = lib.mkEnableOption "systemd-boot"; + config = lib.mkIf cfg.enable { + boot.loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + }; +} diff --git a/nixos/features/services/extra/plymouth.nix b/nixos/features/services/extra/plymouth.nix new file mode 100644 index 0000000..07f00cd --- /dev/null +++ b/nixos/features/services/extra/plymouth.nix @@ -0,0 +1,36 @@ +{ config, pkgs, lib, ... }: let + cfg = config.features.services.extra.plymouth; +in { + options.features.services.extra.plymouth.enable = lib.mkEnableOption "plymouth"; + config = lib.mkIf cfg.enable { + boot = { + plymouth = { + enable = true; + theme = "dark_planet"; + themePackages = with pkgs; [ + # By default we would install all themes + (adi1090x-plymouth-themes.override { + selected_themes = [ "dark_planet" ]; + }) + ]; + }; + + # Enable "Silent Boot" + consoleLogLevel = 0; + initrd.verbose = false; + kernelParams = [ + "quiet" + "splash" + "boot.shell_on_fail" + "loglevel=3" + "rd.systemd.show_status=false" + "rd.udev.log_level=3" + "udev.log_priority=3" + ]; + # Hide the OS choice for bootloaders. + # It's still possible to open the bootloader list by pressing any key + # It will just not appear on screen unless a key is pressed + loader.timeout = 0; + }; + }; +} diff --git a/nixos/features/services/extra/sddm.nix b/nixos/features/services/extra/sddm.nix new file mode 100644 index 0000000..f266575 --- /dev/null +++ b/nixos/features/services/extra/sddm.nix @@ -0,0 +1,23 @@ +{ config, pkgs, lib, ... }: let + cfg = config.features.services.extra.sddm; + sddm-astronaut = pkgs.sddm-astronaut.override { + themeConfig = { + # Background = ./background.png; + }; + }; +in { + options.features.services.extra.sddm.enable = lib.mkEnableOption "sddm"; + config = lib.mkIf cfg.enable { + services = { + displayManager.sddm = { + enable = true; + wayland.enable = true; + package = pkgs.kdePackages.sddm; + theme = "sddm-astronaut-theme"; + extraPackages = [ sddm-astronaut ]; + }; + # xserver.enable = true; + }; + environment.systemPackages = [ sddm-astronaut ]; + }; +} diff --git a/nixos/features/services/extra/ssh.nix b/nixos/features/services/extra/ssh.nix new file mode 100644 index 0000000..d1cee26 --- /dev/null +++ b/nixos/features/services/extra/ssh.nix @@ -0,0 +1,14 @@ +{ config, lib, ... }: let + cfg = config.features.services.extra.ssh; +in { + options.features.services.extra.ssh.enable = lib.mkEnableOption "ssh"; + config = lib.mkIf cfg.enable { + services.openssh = { + enable = true; + settings = { + PermitRootLogin = "no"; + PasswordAuthentication = false; + }; + }; + }; +} diff --git a/nixos/features/services/extra/syncthing-client.nix b/nixos/features/services/extra/syncthing-client.nix new file mode 100644 index 0000000..6d3d3d3 --- /dev/null +++ b/nixos/features/services/extra/syncthing-client.nix @@ -0,0 +1,35 @@ +{ config, pkgs, lib, ... }: let + cfg = config.features.services.extra.syncthing-client; +in { + options.features.services.extra.syncthing-client = { + enable = lib.mkEnableOption "syncthing"; + username = lib.mkOption { + type = lib.types.str; + description = "The username of syncthing's user"; + }; + }; + config = lib.mkIf cfg.enable { + services.syncthing = { + enable = true; + user = cfg.username; + dataDir = "/home/${cfg.username}/Sync"; + configDir = "/home/${cfg.username}/.config/syncthing"; + overrideDevices = true; + overrideFolders = true; + settings = { + devices = { + "prodesk-server" = { + id = "SBH4S2T-B7KVAAI-BKBOQKZ-YSNQDSM-TKXPV6O-OSZUD3O-N6USL6L-DHL3BAK"; + }; + }; + folders = { + "Main" = { + path = "/home/${cfg.username}/Sync"; + devices = [ "prodesk-server" ]; + }; + }; + }; + }; + environment.systemPackages = [ pkgs.syncthing ]; + }; +} diff --git a/nixos/features/services/extra/udisks2.nix b/nixos/features/services/extra/udisks2.nix new file mode 100644 index 0000000..2ec2fa4 --- /dev/null +++ b/nixos/features/services/extra/udisks2.nix @@ -0,0 +1,12 @@ +{ + config, + lib, + ... +}: let + cfg = config.features.services.extra.udisks2; +in { + options.features.services.extra.udisks2.enable = lib.mkEnableOption "udisks2"; + config = lib.mkIf cfg.enable { + services.udisks2.enable = true; + }; +} diff --git a/nixos/features/services/hardware/bluetooth.nix b/nixos/features/services/hardware/bluetooth.nix new file mode 100644 index 0000000..a9829ac --- /dev/null +++ b/nixos/features/services/hardware/bluetooth.nix @@ -0,0 +1,23 @@ +{ config, pkgs, lib, ... }: let + cfg = config.features.services.hardware.bluetooth; +in { + options.features.services.hardware.bluetooth.enable = lib.mkEnableOption "bluetooth"; + config = lib.mkIf cfg.enable { + environment.systemPackages = [ pkgs.bluetui ]; + services.blueman = { + enable = true; + }; + hardware.bluetooth = { + enable = true; + powerOnBoot = true; + }; + services.pulseaudio = { + package = pkgs.pulseaudioFull; + }; + hardware.bluetooth.settings = { + General = { + Enable = "Source,Sink,Media,Socket"; + }; + }; + }; +} diff --git a/nixos/features/services/hardware/iwd.nix b/nixos/features/services/hardware/iwd.nix new file mode 100644 index 0000000..c2394bc --- /dev/null +++ b/nixos/features/services/hardware/iwd.nix @@ -0,0 +1,19 @@ +{ config, pkgs, lib, ... }: let + cfg = config.features.services.hardware.iwd; +in { + options.features.services.hardware.iwd.enable = lib.mkEnableOption "iwd"; + config = lib.mkIf cfg.enable { + environment.systemPackages = [ pkgs.impala ]; + networking.wireless.iwd = { + enable = true; + settings = { + IPv6 = { + Enabled = true; + }; + Settings = { + AutoConnect = true; + }; + }; + }; + }; +} diff --git a/nixos/features/services/hardware/networkmanager.nix b/nixos/features/services/hardware/networkmanager.nix new file mode 100644 index 0000000..49cc7bc --- /dev/null +++ b/nixos/features/services/hardware/networkmanager.nix @@ -0,0 +1,11 @@ +{ config, lib, ... }: let + cfg = config.features.services.hardware.networkmanager; +in { + options.features.services.hardware.networkmanager.enable = lib.mkEnableOption "networkmanager"; + config = lib.mkIf cfg.enable { + networking.networkmanager = { + enable = true; + }; + systemd.services.NetworkManager-wait-online.enable = false; + }; +} diff --git a/nixos/features/services/hardware/pipewire.nix b/nixos/features/services/hardware/pipewire.nix new file mode 100644 index 0000000..f36a0e9 --- /dev/null +++ b/nixos/features/services/hardware/pipewire.nix @@ -0,0 +1,15 @@ +{ config, pkgs, lib, ... }: let + cfg = config.features.services.hardware.pipewire; +in { + options.features.services.hardware.pipewire.enable = lib.mkEnableOption "pipewire"; + config = lib.mkIf cfg.enable { + security.rtkit.enable = true; + environment.systemPackages = [ pkgs.git ]; # Fixes a weird error + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + }; +} -- cgit v1.2.3