From b01e8ebadb46263f385290270f9c39073284d0c5 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Tue, 11 Jun 2024 16:24:12 -0400 Subject: [PATCH] nixosModules: reformat to store all options in options.nix --- hosts/fallarbor/default.nix | 2 +- hosts/lavaridge/default.nix | 2 +- hosts/mauville/default.nix | 2 +- hosts/petalburg/default.nix | 2 +- hosts/rustboro/default.nix | 2 +- nixosModules/apps/nicotine-plus/default.nix | 5 - nixosModules/apps/podman/default.nix | 5 - nixosModules/apps/steam/default.nix | 4 - nixosModules/apps/virt-manager/default.nix | 5 - .../nixos/audiobookshelf/default.nix | 17 -- .../containers/nixos/navidrome/default.nix | 15 -- .../containers/oci/audiobookshelf/default.nix | 15 -- .../containers/oci/freshRSS/default.nix | 10 - .../containers/oci/jellyfin/default.nix | 20 -- .../oci/plexMediaServer/default.nix | 24 +- .../containers/oci/transmission/default.nix | 25 -- nixosModules/default.nix | 3 +- nixosModules/desktop/cinnamon/default.nix | 5 - nixosModules/desktop/gnome/default.nix | 5 - nixosModules/desktop/gnome/fprintdFix.nix | 6 - nixosModules/desktop/greetd/default.nix | 22 -- nixosModules/desktop/hyprland/default.nix | 5 - nixosModules/desktop/lightdm/default.nix | 6 - nixosModules/desktop/plasma/default.nix | 5 - nixosModules/desktop/sway/default.nix | 5 - nixosModules/desktop/waylandComp.nix | 5 - nixosModules/options.nix | 255 ++++++++++++++++++ nixosModules/scripts/hoenn/default.nix | 5 - nixosModules/services/binaryCache/default.nix | 4 - nixosModules/services/flatpak/default.nix | 5 - nixosModules/services/ollama/default.nix | 16 -- nixosModules/services/syncthing/default.nix | 21 -- nixosModules/services/tailscale/default.nix | 4 - nixosModules/system/plymouth/default.nix | 6 - .../system/power-profiles-daemon/default.nix | 5 - nixosModules/system/zramSwap/default.nix | 11 - nixosModules/user/dustin/default.nix | 26 -- nixosModules/{user => users}/aly/default.nix | 14 +- nixosModules/{user => users}/default.nix | 0 nixosModules/users/dustin/default.nix | 16 ++ 40 files changed, 282 insertions(+), 328 deletions(-) create mode 100644 nixosModules/options.nix delete mode 100644 nixosModules/user/dustin/default.nix rename nixosModules/{user => users}/aly/default.nix (66%) rename nixosModules/{user => users}/default.nix (100%) create mode 100644 nixosModules/users/dustin/default.nix diff --git a/hosts/fallarbor/default.nix b/hosts/fallarbor/default.nix index 8271ad24..d057ef3d 100644 --- a/hosts/fallarbor/default.nix +++ b/hosts/fallarbor/default.nix @@ -41,7 +41,7 @@ plymouth.enable = true; zramSwap = {enable = true;}; }; - user = { + users = { aly = { enable = true; password = "$y$j9T$0p6rc4p5sn0LJ/6XyAGP7.$.wmTafwMMscdW1o8kqqoHJP7U8kF.4WBmzzcPYielR3"; diff --git a/hosts/lavaridge/default.nix b/hosts/lavaridge/default.nix index 45bc69cf..61b6e4b4 100644 --- a/hosts/lavaridge/default.nix +++ b/hosts/lavaridge/default.nix @@ -33,7 +33,7 @@ plymouth.enable = true; zramSwap = {enable = true;}; }; - user = { + users = { aly = { enable = true; password = "$y$j9T$NSS7QcEtN4yiigPyofwlI/$nxdgz0lpySa0heDMjGlHe1gX3BWf48jK6Tkfg4xMEs6"; diff --git a/hosts/mauville/default.nix b/hosts/mauville/default.nix index c5c308c1..f7ea298a 100644 --- a/hosts/mauville/default.nix +++ b/hosts/mauville/default.nix @@ -55,7 +55,7 @@ in { hyprland.enable = true; sway.enable = true; }; - user = { + users = { aly = { enable = true; password = "$y$j9T$SHPShqI2IpRE101Ey2ry/0$0mhW1f9LbVY02ifhJlP9XVImge9HOpf23s9i1JFLIt9"; diff --git a/hosts/petalburg/default.nix b/hosts/petalburg/default.nix index f7a872a9..e166627b 100644 --- a/hosts/petalburg/default.nix +++ b/hosts/petalburg/default.nix @@ -29,7 +29,7 @@ plymouth.enable = true; zramSwap = {enable = true;}; }; - user = { + users = { aly = { enable = true; password = "$y$j9T$TitXX3J690cnK41XciNMg/$APKHM/os6FKd9H9aXGxaHaQ8zP5SenO9EO94VYafl43"; diff --git a/hosts/rustboro/default.nix b/hosts/rustboro/default.nix index 1b663ab8..72fa6181 100644 --- a/hosts/rustboro/default.nix +++ b/hosts/rustboro/default.nix @@ -29,7 +29,7 @@ size = 100; }; }; - user = { + users = { aly = { enable = true; password = "$y$j9T$VdtiEyMOegHpcUwgmCVFD0$K8Ne6.zk//VJNq2zxVQ0xE0Wg3LohvAQd3Xm9aXdM15"; diff --git a/nixosModules/apps/nicotine-plus/default.nix b/nixosModules/apps/nicotine-plus/default.nix index 2fe4c739..fe30cd13 100644 --- a/nixosModules/apps/nicotine-plus/default.nix +++ b/nixosModules/apps/nicotine-plus/default.nix @@ -4,11 +4,6 @@ config, ... }: { - options = { - alyraffauf.apps.nicotine-plus.enable = - lib.mkEnableOption "Enable Nicotine+ soulseek client."; - }; - config = lib.mkIf config.alyraffauf.apps.nicotine-plus.enable { environment.systemPackages = [pkgs.nicotine-plus]; networking = { diff --git a/nixosModules/apps/podman/default.nix b/nixosModules/apps/podman/default.nix index 2578e74d..b9fdcacb 100644 --- a/nixosModules/apps/podman/default.nix +++ b/nixosModules/apps/podman/default.nix @@ -4,11 +4,6 @@ config, ... }: { - options = { - alyraffauf.apps.podman.enable = - lib.mkEnableOption "Enables Podman for OCI container support."; - }; - config = lib.mkIf config.alyraffauf.apps.podman.enable { virtualisation = { oci-containers = {backend = "podman";}; diff --git a/nixosModules/apps/steam/default.nix b/nixosModules/apps/steam/default.nix index 04a39490..9b3ef6e9 100644 --- a/nixosModules/apps/steam/default.nix +++ b/nixosModules/apps/steam/default.nix @@ -4,10 +4,6 @@ config, ... }: { - options = { - alyraffauf.apps.steam.enable = lib.mkEnableOption "Enables Steam for video games."; - }; - config = lib.mkIf config.alyraffauf.apps.steam.enable { hardware.steam-hardware.enable = true; programs.steam = { diff --git a/nixosModules/apps/virt-manager/default.nix b/nixosModules/apps/virt-manager/default.nix index 03c7c336..13184dd6 100644 --- a/nixosModules/apps/virt-manager/default.nix +++ b/nixosModules/apps/virt-manager/default.nix @@ -4,11 +4,6 @@ config, ... }: { - options = { - alyraffauf.apps.virt-manager.enable = - lib.mkEnableOption "Enables virt-manager with TPM and EFI support."; - }; - config = lib.mkIf config.alyraffauf.apps.virt-manager.enable { programs.virt-manager.enable = true; diff --git a/nixosModules/containers/nixos/audiobookshelf/default.nix b/nixosModules/containers/nixos/audiobookshelf/default.nix index 9ce18abe..714af8f8 100644 --- a/nixosModules/containers/nixos/audiobookshelf/default.nix +++ b/nixosModules/containers/nixos/audiobookshelf/default.nix @@ -4,23 +4,6 @@ config, ... }: { - options = { - alyraffauf.containers.nixos.audiobookshelf = { - enable = - lib.mkEnableOption "Enable audiobookshelf nixos container."; - mediaDirectory = lib.mkOption { - description = "Media directory for Audiobookshelf."; - default = "/mnt/Media"; - type = lib.types.str; - }; - port = lib.mkOption { - description = "Port for audiobookshelf."; - default = 13378; - type = lib.types.int; - }; - }; - }; - config = lib.mkIf config.alyraffauf.containers.nixos.audiobookshelf.enable { containers.audiobookshelf = { autoStart = true; diff --git a/nixosModules/containers/nixos/navidrome/default.nix b/nixosModules/containers/nixos/navidrome/default.nix index cadcaa59..5f75bfa5 100644 --- a/nixosModules/containers/nixos/navidrome/default.nix +++ b/nixosModules/containers/nixos/navidrome/default.nix @@ -6,21 +6,6 @@ self, ... }: { - options = { - alyraffauf.containers.nixos.navidrome.enable = - lib.mkEnableOption "Enable navidrome nixos container."; - alyraffauf.containers.nixos.navidrome.musicDirectory = lib.mkOption { - description = "Music directory for Navidrome."; - default = "/mnt/Media/Music"; - type = lib.types.str; - }; - alyraffauf.containers.nixos.navidrome.port = lib.mkOption { - description = "Port for Navidrome."; - default = 4533; - type = lib.types.int; - }; - }; - config = lib.mkIf config.alyraffauf.containers.nixos.navidrome.enable { # Spotify secrets aren't exactly safe, because they are world-readable in the nix store. # But they're reasonably disposable and hidden from the public git repo. diff --git a/nixosModules/containers/oci/audiobookshelf/default.nix b/nixosModules/containers/oci/audiobookshelf/default.nix index ce22f149..48cb0b92 100644 --- a/nixosModules/containers/oci/audiobookshelf/default.nix +++ b/nixosModules/containers/oci/audiobookshelf/default.nix @@ -4,21 +4,6 @@ config, ... }: { - options = { - alyraffauf.containers.oci.audiobookshelf.enable = - lib.mkEnableOption "Enable audiobookshelf podcast and audiobook server."; - alyraffauf.containers.oci.audiobookshelf.mediaDirectory = lib.mkOption { - description = "Media directory for audiobookshelf."; - default = "/mnt/Media"; - type = lib.types.str; - }; - alyraffauf.containers.oci.audiobookshelf.port = lib.mkOption { - description = "Port for audiobookshelf."; - default = 13378; - type = lib.types.int; - }; - }; - config = lib.mkIf config.alyraffauf.containers.oci.audiobookshelf.enable { virtualisation.oci-containers.containers = { audiobookshelf = { diff --git a/nixosModules/containers/oci/freshRSS/default.nix b/nixosModules/containers/oci/freshRSS/default.nix index 0c49a9fc..06f07dd7 100644 --- a/nixosModules/containers/oci/freshRSS/default.nix +++ b/nixosModules/containers/oci/freshRSS/default.nix @@ -4,16 +4,6 @@ config, ... }: { - options = { - alyraffauf.containers.oci.freshRSS.enable = - lib.mkEnableOption "Enable FreshRSS news client."; - alyraffauf.containers.oci.freshRSS.port = lib.mkOption { - description = "Port for FreshRSS."; - default = 8080; - type = lib.types.int; - }; - }; - config = lib.mkIf config.alyraffauf.containers.oci.freshRSS.enable { virtualisation.oci-containers.containers = { freshrss = { diff --git a/nixosModules/containers/oci/jellyfin/default.nix b/nixosModules/containers/oci/jellyfin/default.nix index 051d4187..cc247967 100644 --- a/nixosModules/containers/oci/jellyfin/default.nix +++ b/nixosModules/containers/oci/jellyfin/default.nix @@ -4,26 +4,6 @@ config, ... }: { - options = { - alyraffauf.containers.oci.jellyfin.enable = - lib.mkEnableOption "Enable Jellyfin media server."; - alyraffauf.containers.oci.jellyfin.mediaDirectory = lib.mkOption { - description = "Media directory for Jellyfin."; - default = "/mnt/Media"; - type = lib.types.str; - }; - alyraffauf.containers.oci.jellyfin.archiveDirectory = lib.mkOption { - description = "Archive directory for Jellyfin."; - default = "/mnt/Archive"; - type = lib.types.str; - }; - alyraffauf.containers.oci.jellyfin.port = lib.mkOption { - description = "Port for Jellyfin."; - default = 8096; - type = lib.types.int; - }; - }; - config = lib.mkIf config.alyraffauf.containers.oci.jellyfin.enable { virtualisation.oci-containers.containers = { jellyfin = { diff --git a/nixosModules/containers/oci/plexMediaServer/default.nix b/nixosModules/containers/oci/plexMediaServer/default.nix index ecbcd3f2..dd926ea1 100644 --- a/nixosModules/containers/oci/plexMediaServer/default.nix +++ b/nixosModules/containers/oci/plexMediaServer/default.nix @@ -1,29 +1,9 @@ { - pkgs, - lib, config, + lib, + pkgs, ... }: { - options = { - alyraffauf.containers.oci.plexMediaServer.enable = - lib.mkEnableOption "Enable Plex Media Server."; - alyraffauf.containers.oci.plexMediaServer.mediaDirectory = lib.mkOption { - description = "Media directory for Plex Media Server."; - default = "/mnt/Media"; - type = lib.types.str; - }; - alyraffauf.containers.oci.plexMediaServer.archiveDirectory = lib.mkOption { - description = "Archive directory for Plex Media Server."; - default = "/mnt/Archive"; - type = lib.types.str; - }; - alyraffauf.containers.oci.plexMediaServer.port = lib.mkOption { - description = "Port for Plex Media Server."; - default = 32400; - type = lib.types.int; - }; - }; - config = lib.mkIf config.alyraffauf.containers.oci.plexMediaServer.enable { virtualisation.oci-containers.containers = { plexMediaServer = { diff --git a/nixosModules/containers/oci/transmission/default.nix b/nixosModules/containers/oci/transmission/default.nix index 076f142c..4c489ce9 100644 --- a/nixosModules/containers/oci/transmission/default.nix +++ b/nixosModules/containers/oci/transmission/default.nix @@ -4,31 +4,6 @@ config, ... }: { - options = { - alyraffauf.containers.oci.transmission.enable = - lib.mkEnableOption "Enable Transmission Bittorrent server."; - alyraffauf.containers.oci.transmission.mediaDirectory = lib.mkOption { - description = "Media directory for Transmission."; - default = "/mnt/Media"; - type = lib.types.str; - }; - alyraffauf.containers.oci.transmission.archiveDirectory = lib.mkOption { - description = "Archive directory for Transmission."; - default = "/mnt/Archive"; - type = lib.types.str; - }; - alyraffauf.containers.oci.transmission.port = lib.mkOption { - description = "Port for Transmission."; - default = 9091; - type = lib.types.int; - }; - alyraffauf.containers.oci.transmission.bitTorrentPort = lib.mkOption { - description = "Port for BitTorrent p2p services.."; - default = 5143; - type = lib.types.int; - }; - }; - config = lib.mkIf config.alyraffauf.containers.oci.transmission.enable { virtualisation.oci-containers.containers = { transmission = { diff --git a/nixosModules/default.nix b/nixosModules/default.nix index ca5d7947..86c55d12 100644 --- a/nixosModules/default.nix +++ b/nixosModules/default.nix @@ -13,10 +13,11 @@ in { ./apps ./containers ./desktop + ./options.nix ./scripts ./services ./system - ./user + ./users ]; nixpkgs.overlays = [ diff --git a/nixosModules/desktop/cinnamon/default.nix b/nixosModules/desktop/cinnamon/default.nix index cc11eb16..fcb9579d 100644 --- a/nixosModules/desktop/cinnamon/default.nix +++ b/nixosModules/desktop/cinnamon/default.nix @@ -4,11 +4,6 @@ config, ... }: { - options = { - alyraffauf.desktop.cinnamon.enable = - lib.mkEnableOption "Cinnamon desktop session."; - }; - config = lib.mkIf config.alyraffauf.desktop.cinnamon.enable { services = { xserver = { diff --git a/nixosModules/desktop/gnome/default.nix b/nixosModules/desktop/gnome/default.nix index 2929b80e..bac6c286 100644 --- a/nixosModules/desktop/gnome/default.nix +++ b/nixosModules/desktop/gnome/default.nix @@ -23,11 +23,6 @@ in { ./fprintdFix.nix ]; - options = { - alyraffauf.desktop.gnome.enable = - lib.mkEnableOption "Enable GNOME desktop session."; - }; - config = lib.mkIf config.alyraffauf.desktop.gnome.enable { environment.systemPackages = with pkgs; [ diff --git a/nixosModules/desktop/gnome/fprintdFix.nix b/nixosModules/desktop/gnome/fprintdFix.nix index 13476203..92a5862d 100644 --- a/nixosModules/desktop/gnome/fprintdFix.nix +++ b/nixosModules/desktop/gnome/fprintdFix.nix @@ -4,12 +4,6 @@ config, ... }: { - options = { - alyraffauf.desktop.gnome.fprintdFix.enable = - lib.mkEnableOption - "Fix fprintd and pam issues with GNOME Display Manager."; - }; - config = lib.mkIf config.alyraffauf.desktop.gnome.fprintdFix.enable { # Need to change the order pam loads its modules # to get proper fingerprint behavior on GDM and the lockscreen. diff --git a/nixosModules/desktop/greetd/default.nix b/nixosModules/desktop/greetd/default.nix index 219a5952..26e59a54 100644 --- a/nixosModules/desktop/greetd/default.nix +++ b/nixosModules/desktop/greetd/default.nix @@ -4,28 +4,6 @@ pkgs, ... }: { - options = { - alyraffauf.desktop.greetd = { - enable = - lib.mkEnableOption "Enable greetd."; - session = lib.mkOption { - description = "Default command to execute on login."; - default = lib.getExe config.programs.hyprland.package; - type = lib.types.str; - }; - autologin.enable = lib.mkOption { - description = "Whether to enable autologin."; - default = false; - type = lib.types.bool; - }; - autologin.user = lib.mkOption { - description = "User to autologin."; - default = "aly"; - type = lib.types.str; - }; - }; - }; - config = lib.mkIf config.alyraffauf.desktop.greetd.enable { security.pam.services = { greetd.enableKwallet = lib.mkDefault true; diff --git a/nixosModules/desktop/hyprland/default.nix b/nixosModules/desktop/hyprland/default.nix index e87f6f3b..350b56db 100644 --- a/nixosModules/desktop/hyprland/default.nix +++ b/nixosModules/desktop/hyprland/default.nix @@ -4,11 +4,6 @@ pkgs, ... }: { - options = { - alyraffauf.desktop.hyprland.enable = - lib.mkEnableOption "Hyprland wayland compositor."; - }; - config = lib.mkIf config.alyraffauf.desktop.hyprland.enable { alyraffauf.desktop.waylandComp.enable = lib.mkDefault true; diff --git a/nixosModules/desktop/lightdm/default.nix b/nixosModules/desktop/lightdm/default.nix index 016b5af6..9d1f9b83 100644 --- a/nixosModules/desktop/lightdm/default.nix +++ b/nixosModules/desktop/lightdm/default.nix @@ -4,12 +4,6 @@ config, ... }: { - options = { - alyraffauf.desktop.lightdm.enable = - lib.mkEnableOption - "Lightdm and slick greeter with Catppuccin theme."; - }; - config = lib.mkIf config.alyraffauf.desktop.lightdm.enable { security.pam.services.lightdm = { enableGnomeKeyring = true; diff --git a/nixosModules/desktop/plasma/default.nix b/nixosModules/desktop/plasma/default.nix index fb0ffc67..46ac6266 100644 --- a/nixosModules/desktop/plasma/default.nix +++ b/nixosModules/desktop/plasma/default.nix @@ -16,11 +16,6 @@ fi ''; in { - options = { - alyraffauf.desktop.plasma.enable = - lib.mkEnableOption "Enable plasma desktop session."; - }; - config = lib.mkIf config.alyraffauf.desktop.plasma.enable { environment.systemPackages = with pkgs; [ diff --git a/nixosModules/desktop/sway/default.nix b/nixosModules/desktop/sway/default.nix index d5132b83..ecddc778 100644 --- a/nixosModules/desktop/sway/default.nix +++ b/nixosModules/desktop/sway/default.nix @@ -5,11 +5,6 @@ config, ... }: { - options = { - alyraffauf.desktop.sway.enable = - lib.mkEnableOption "Sway wayland compositor."; - }; - config = lib.mkIf config.alyraffauf.desktop.sway.enable { alyraffauf.desktop.waylandComp.enable = lib.mkDefault true; diff --git a/nixosModules/desktop/waylandComp.nix b/nixosModules/desktop/waylandComp.nix index 28e30bd3..f753b580 100644 --- a/nixosModules/desktop/waylandComp.nix +++ b/nixosModules/desktop/waylandComp.nix @@ -5,11 +5,6 @@ config, ... }: { - options = { - alyraffauf.desktop.waylandComp.enable = - lib.mkEnableOption "Shared defaults for wayland compositors."; - }; - config = lib.mkIf config.alyraffauf.desktop.waylandComp.enable { programs = { gnupg.agent.pinentryPackage = lib.mkForce pkgs.pinentry-gnome3; diff --git a/nixosModules/options.nix b/nixosModules/options.nix new file mode 100644 index 00000000..21d318b5 --- /dev/null +++ b/nixosModules/options.nix @@ -0,0 +1,255 @@ +{ + config, + inputs, + lib, + pkgs, + self, + ... +}: { + options = { + alyraffauf = { + apps = { + nicotine-plus.enable = + lib.mkEnableOption "Nicotine+ Soulseek client."; + podman.enable = + lib.mkEnableOption "Podman for OCI container support."; + steam.enable = + lib.mkEnableOption "Valve's Steam for video games."; + virt-manager.enable = + lib.mkEnableOption "Virt-manager with TPM and EFI support."; + }; + containers = { + nixos = { + audiobookshelf = { + enable = + lib.mkEnableOption "audiobookshelf nixos container."; + mediaDirectory = lib.mkOption { + description = "Media directory for audiobookshelf."; + default = "/mnt/Media"; + type = lib.types.str; + }; + port = lib.mkOption { + description = "Port for audiobookshelf."; + default = 13378; + type = lib.types.int; + }; + }; + navidrome = { + enable = + lib.mkEnableOption "navidrome nixos container."; + musicDirectory = lib.mkOption { + description = "Music directory for Navidrome."; + default = "/mnt/Media/Music"; + type = lib.types.str; + }; + port = lib.mkOption { + description = "Port for Navidrome."; + default = 4533; + type = lib.types.int; + }; + }; + }; + oci = { + audiobookshelf = { + enable = + lib.mkEnableOption "audiobookshelf podcast and audiobook server in OCI container."; + mediaDirectory = lib.mkOption { + description = "Media directory for audiobookshelf."; + default = "/mnt/Media"; + type = lib.types.str; + }; + port = lib.mkOption { + description = "Port for audiobookshelf."; + default = 13378; + type = lib.types.int; + }; + }; + freshRSS = { + enable = + lib.mkEnableOption "FreshRSS news client in OCI container."; + port = lib.mkOption { + description = "Port for FreshRSS."; + default = 8080; + type = lib.types.int; + }; + }; + jellyfin = { + enable = + lib.mkEnableOption "Jellyfin media server in OCI container."; + archiveDirectory = lib.mkOption { + description = "Archive directory for Jellyfin."; + default = "/mnt/Archive"; + type = lib.types.str; + }; + mediaDirectory = lib.mkOption { + description = "Media directory for Jellyfin."; + default = "/mnt/Media"; + type = lib.types.str; + }; + port = lib.mkOption { + description = "Port for Jellyfin."; + default = 8096; + type = lib.types.int; + }; + }; + plexMediaServer = { + enable = + lib.mkEnableOption "Plex Media Server in OCI container."; + archiveDirectory = lib.mkOption { + description = "Archive directory for Plex Media Server."; + default = "/mnt/Archive"; + type = lib.types.str; + }; + mediaDirectory = lib.mkOption { + description = "Media directory for Plex Media Server."; + default = "/mnt/Media"; + type = lib.types.str; + }; + port = lib.mkOption { + description = "Port for Plex Media Server."; + default = 32400; + type = lib.types.int; + }; + }; + transmission = { + enable = + lib.mkEnableOption "Transmission Bittorrent client in OCI container."; + archiveDirectory = lib.mkOption { + description = "Archive directory for Transmission."; + default = "/mnt/Archive"; + type = lib.types.str; + }; + bitTorrentPort = lib.mkOption { + description = "Port for BitTorrent p2p services.."; + default = 5143; + type = lib.types.int; + }; + mediaDirectory = lib.mkOption { + description = "Media directory for Transmission."; + default = "/mnt/Media"; + type = lib.types.str; + }; + port = lib.mkOption { + description = "Port for Transmission."; + default = 9091; + type = lib.types.int; + }; + }; + }; + }; + desktop = { + cinnamon.enable = + lib.mkEnableOption "Cinnamon desktop session."; + gnome = { + enable = + lib.mkEnableOption "GNOME desktop session."; + fprintdFix.enable = + lib.mkEnableOption + "Fix fprintd & pam issues with GNOME Display Manager."; + }; + greetd = { + enable = + lib.mkEnableOption "Greetd display manager."; + + autologin = { + enable = lib.mkOption { + description = "Whether to enable autologin."; + default = false; + type = lib.types.bool; + }; + user = lib.mkOption { + description = "User to autologin."; + default = "aly"; + type = lib.types.str; + }; + }; + session = lib.mkOption { + description = "Default command to execute on login."; + default = lib.getExe config.programs.hyprland.package; + type = lib.types.str; + }; + }; + hyprland.enable = + lib.mkEnableOption "Hyprland wayland session."; + lightdm.enable = + lib.mkEnableOption + "Lightdm and slick greeter with Catppuccin theme."; + plasma.enable = + lib.mkEnableOption "Plasma desktop session."; + sway.enable = + lib.mkEnableOption "Sway wayland session."; + waylandComp.enable = + lib.mkEnableOption "Shared defaults for wayland compositors."; + }; + scripts.hoenn.enable = + lib.mkEnableOption "Hoenn system configuration script"; + services = { + binaryCache.enable = lib.mkEnableOption "nixpkgs cache server."; + flatpak.enable = + lib.mkEnableOption "Flatpak support with GUI."; + ollama = { + enable = lib.mkEnableOption "Ollama interface for LLMs."; + listenAddress = lib.mkOption { + description = "Listen Address for Ollama."; + default = "127.0.0.1:11434"; + type = lib.types.str; + }; + gpu = lib.mkOption { + description = "Type of GPU for enabling GPU acceleration."; + default = null; + type = lib.types.str; + }; + }; + syncthing = { + enable = lib.mkEnableOption "Syncthing sync service."; + user = lib.mkOption { + description = "Specify user Syncthing runs as."; + default = "aly"; + type = lib.types.str; + }; + syncMusic = lib.mkOption { + description = "Whether to sync music folder."; + default = true; + type = lib.types.bool; + }; + musicPath = lib.mkOption { + description = "Whether to sync music folder."; + default = "/home/${config.alyraffauf.services.syncthing.user}/music"; + type = lib.types.str; + }; + }; + tailscale.enable = lib.mkEnableOption "Enable Tailscale"; + }; + system = { + plymouth.enable = + lib.mkEnableOption "Plymouth boot screen with catppuccin theme."; + power-profiles-daemon.enable = + lib.mkEnableOption "Power-profiles-daemon."; + zramSwap = { + enable = lib.mkEnableOption "Zram swap."; + size = lib.mkOption { + description = "Percent size of the zram swap."; + default = 50; + type = lib.types.int; + }; + }; + }; + users = { + aly = { + enable = lib.mkEnableOption "Aly's user."; + password = lib.mkOption { + description = "Hashed password for user aly."; + type = lib.types.str; + }; + }; + dustin = { + enable = lib.mkEnableOption "Dustin's user."; + password = lib.mkOption { + description = "Hashed password."; + type = lib.types.str; + }; + }; + }; + }; + }; +} diff --git a/nixosModules/scripts/hoenn/default.nix b/nixosModules/scripts/hoenn/default.nix index 92e5e488..d51c4e21 100644 --- a/nixosModules/scripts/hoenn/default.nix +++ b/nixosModules/scripts/hoenn/default.nix @@ -4,11 +4,6 @@ config, ... }: { - options = { - alyraffauf.scripts.hoenn.enable = - lib.mkEnableOption "Enable hoenn system configuration script"; - }; - config = lib.mkIf config.alyraffauf.scripts.hoenn.enable { environment.systemPackages = [ (pkgs.writeShellScriptBin "hoenn" '' diff --git a/nixosModules/services/binaryCache/default.nix b/nixosModules/services/binaryCache/default.nix index 6940be8c..5db6f55a 100644 --- a/nixosModules/services/binaryCache/default.nix +++ b/nixosModules/services/binaryCache/default.nix @@ -4,10 +4,6 @@ config, ... }: { - options = { - alyraffauf.services.binaryCache.enable = lib.mkEnableOption "Enable nixpkgs cache server."; - }; - config = lib.mkIf config.alyraffauf.services.binaryCache.enable { services.nix-serve = { enable = true; diff --git a/nixosModules/services/flatpak/default.nix b/nixosModules/services/flatpak/default.nix index c0aba67e..84a0b646 100644 --- a/nixosModules/services/flatpak/default.nix +++ b/nixosModules/services/flatpak/default.nix @@ -4,11 +4,6 @@ config, ... }: { - options = { - alyraffauf.services.flatpak.enable = - lib.mkEnableOption "Enables flatpak support with GUI."; - }; - config = lib.mkIf config.alyraffauf.services.flatpak.enable { environment.systemPackages = with pkgs; [gnome.gnome-software]; diff --git a/nixosModules/services/ollama/default.nix b/nixosModules/services/ollama/default.nix index baa140b9..1ba30bd6 100644 --- a/nixosModules/services/ollama/default.nix +++ b/nixosModules/services/ollama/default.nix @@ -4,22 +4,6 @@ config, ... }: { - options = { - alyraffauf.services.ollama = { - enable = lib.mkEnableOption "Enable ollama interface for LLMs."; - listenAddress = lib.mkOption { - description = "Listen Address for Ollama."; - default = "127.0.0.1:11434"; - type = lib.types.str; - }; - gpu = lib.mkOption { - description = "Type of GPU for enabling GPU acceleration."; - default = null; - type = lib.types.str; - }; - }; - }; - config = lib.mkIf config.alyraffauf.services.ollama.enable { services.ollama = { enable = true; diff --git a/nixosModules/services/syncthing/default.nix b/nixosModules/services/syncthing/default.nix index 90a4b94a..6ba580f3 100644 --- a/nixosModules/services/syncthing/default.nix +++ b/nixosModules/services/syncthing/default.nix @@ -6,27 +6,6 @@ }: { imports = [./syncMusic.nix]; - options = { - alyraffauf.services.syncthing = { - enable = lib.mkEnableOption "Enable Syncthing"; - user = lib.mkOption { - description = "Specify user Syncthing runs as."; - default = "aly"; - type = lib.types.str; - }; - syncMusic = lib.mkOption { - description = "Whether to sync music folder."; - default = true; - type = lib.types.bool; - }; - musicPath = lib.mkOption { - description = "Whether to sync music folder."; - default = "/home/${config.alyraffauf.services.syncthing.user}/music"; - type = lib.types.str; - }; - }; - }; - config = lib.mkIf config.alyraffauf.services.syncthing.enable { age.secrets = { syncthingCert.file = ../../../secrets/syncthing + "/${config.networking.hostName}/cert.age"; diff --git a/nixosModules/services/tailscale/default.nix b/nixosModules/services/tailscale/default.nix index ad927417..357794b9 100644 --- a/nixosModules/services/tailscale/default.nix +++ b/nixosModules/services/tailscale/default.nix @@ -4,10 +4,6 @@ config, ... }: { - options = { - alyraffauf.services.tailscale.enable = lib.mkEnableOption "Enable Tailscale"; - }; - config = lib.mkIf config.alyraffauf.services.tailscale.enable { age.secrets.tailscaleAuthKey.file = ../../../secrets/tailscale/authKeyFile.age; services.tailscale = { diff --git a/nixosModules/system/plymouth/default.nix b/nixosModules/system/plymouth/default.nix index 24ef61ff..5ec661dc 100644 --- a/nixosModules/system/plymouth/default.nix +++ b/nixosModules/system/plymouth/default.nix @@ -4,12 +4,6 @@ config, ... }: { - options = { - alyraffauf.system.plymouth.enable = - lib.mkEnableOption - "Enables plymouth boot screen with reduced text verbosity."; - }; - config = lib.mkIf config.alyraffauf.system.plymouth.enable { boot = { consoleLogLevel = 0; diff --git a/nixosModules/system/power-profiles-daemon/default.nix b/nixosModules/system/power-profiles-daemon/default.nix index a430069b..05225608 100644 --- a/nixosModules/system/power-profiles-daemon/default.nix +++ b/nixosModules/system/power-profiles-daemon/default.nix @@ -4,11 +4,6 @@ config, ... }: { - options = { - alyraffauf.system.power-profiles-daemon.enable = - lib.mkEnableOption "Enables power-profiles-daemon."; - }; - config = lib.mkIf config.alyraffauf.system.power-profiles-daemon.enable { services = { power-profiles-daemon.enable = true; diff --git a/nixosModules/system/zramSwap/default.nix b/nixosModules/system/zramSwap/default.nix index 0d6515cd..bcfb6005 100644 --- a/nixosModules/system/zramSwap/default.nix +++ b/nixosModules/system/zramSwap/default.nix @@ -4,17 +4,6 @@ config, ... }: { - options = { - alyraffauf.system.zramSwap = { - enable = lib.mkEnableOption "Enables zram swap."; - size = lib.mkOption { - description = "Percent size of the zram swap."; - default = 50; - type = lib.types.int; - }; - }; - }; - config = lib.mkIf config.alyraffauf.system.zramSwap.enable { zramSwap = { enable = true; diff --git a/nixosModules/user/dustin/default.nix b/nixosModules/user/dustin/default.nix deleted file mode 100644 index 43f0eb76..00000000 --- a/nixosModules/user/dustin/default.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ - inputs, - pkgs, - lib, - config, - ... -}: { - options = { - alyraffauf.user.dustin = { - enable = lib.mkEnableOption "Enables Dustin's user."; - password = lib.mkOption { - description = "Hashed password."; - type = lib.types.str; - }; - }; - }; - - config = lib.mkIf config.alyraffauf.user.dustin.enable { - users.users.dustin = { - description = "Dustin Raffauf"; - extraGroups = ["networkmanager" "wheel" "docker" "libvirtd" "video"]; - hashedPassword = config.alyraffauf.user.dustin.password; - isNormalUser = true; - }; - }; -} diff --git a/nixosModules/user/aly/default.nix b/nixosModules/users/aly/default.nix similarity index 66% rename from nixosModules/user/aly/default.nix rename to nixosModules/users/aly/default.nix index 8ac0bbd8..7982bd86 100644 --- a/nixosModules/user/aly/default.nix +++ b/nixosModules/users/aly/default.nix @@ -5,21 +5,11 @@ config, ... }: { - options = { - alyraffauf.user.aly = { - enable = lib.mkEnableOption "Enables Aly's user."; - password = lib.mkOption { - description = "Hashed password for user aly."; - type = lib.types.str; - }; - }; - }; - - config = lib.mkIf config.alyraffauf.user.aly.enable { + config = lib.mkIf config.alyraffauf.users.aly.enable { users.users.aly = { description = "Aly Raffauf"; extraGroups = ["networkmanager" "wheel" "docker" "libvirtd" "video"]; - hashedPassword = config.alyraffauf.user.aly.password; + hashedPassword = config.alyraffauf.users.aly.password; isNormalUser = true; linger = true; openssh.authorizedKeys.keys = [ diff --git a/nixosModules/user/default.nix b/nixosModules/users/default.nix similarity index 100% rename from nixosModules/user/default.nix rename to nixosModules/users/default.nix diff --git a/nixosModules/users/dustin/default.nix b/nixosModules/users/dustin/default.nix new file mode 100644 index 00000000..572815d6 --- /dev/null +++ b/nixosModules/users/dustin/default.nix @@ -0,0 +1,16 @@ +{ + inputs, + pkgs, + lib, + config, + ... +}: { + config = lib.mkIf config.alyraffauf.users.dustin.enable { + users.users.dustin = { + description = "Dustin Raffauf"; + extraGroups = ["networkmanager" "wheel" "docker" "libvirtd" "video"]; + hashedPassword = config.alyraffauf.users.dustin.password; + isNormalUser = true; + }; + }; +}