From dbc5cb478c7fad1c1750421486252f0a5d98ef9c Mon Sep 17 00:00:00 2001 From: Collin Williams <96917990+bluedragon1221@users.noreply.github.com> Date: Sun, 11 Jan 2026 13:36:45 -0600 Subject: now there's docs --- modules/desktop/options.nix | 112 ++++++++++++++++++++++++-------------------- 1 file changed, 60 insertions(+), 52 deletions(-) (limited to 'modules/desktop/options.nix') diff --git a/modules/desktop/options.nix b/modules/desktop/options.nix index 1067d0b..e59ed68 100644 --- a/modules/desktop/options.nix +++ b/modules/desktop/options.nix @@ -6,7 +6,7 @@ ... }: let inherit (lib) mkOption mkEnableOption types; - inherit (my-lib.options {inherit lib config;}) mkProgramOption; + inherit (my-lib.options {inherit lib config;}) mkProgramOption mkThemeOption; in { options = { collinux.desktop = { @@ -17,12 +17,14 @@ in { wallpaper_cmd = mkOption { type = types.str; default = "${lib.getExe pkgs.wbg} -s ${config.collinux.desktop.wallpaper}"; + internal = true; }; greetd = { enable = mkEnableOption "greetd greeter"; command = mkOption { type = lib.types.str; + internal = true; default = let cfg = config.collinux.desktop; in @@ -40,7 +42,6 @@ in { niri.enable = mkEnableOption "niri"; components = { - # waybar = mkProgramOption "waybar"; dunst = mkProgramOption "dunst"; fuzzel = mkProgramOption "fuzzel"; }; @@ -49,54 +50,63 @@ in { gtk = { enable = mkEnableOption "gtk theming"; - theme = mkOption { - type = types.enum ["catppuccin" "adwaita" "kanagawa"]; - default = config.collinux.theme; - }; - cursor_data = { - package = mkOption { - type = lib.types.package; - default = - if (config.collinux.desktop.gtk.theme == "catppuccin") - then pkgs.catppuccin-cursors.mochaDark - else if (config.collinux.desktop.gtk.theme == "adwaita") - then pkgs.vanilla-dmz - else null; - }; - name = mkOption { - type = lib.types.str; - default = - if (config.collinux.desktop.gtk.theme == "catppuccin") - then "catppuccin-mocha-dark-cursors" - else if (config.collinux.desktop.gtk.theme == "adwaita") - then "Vanilla-DMZ" - else null; + theme = mkThemeOption "gtk"; + + cursor_data = mkOption { + internal = true; + type = lib.types.submodule { + package = mkOption { + internal = true; + type = lib.types.package; + }; + name = mkOption { + internal = true; + type = lib.types.str; + }; }; + default = + if config.collinux.desktop.gtk.theme == "catppuccin" + then { + name = "catppuccin-mocha-dark-cursors"; + package = pkgs.catppuccin-cursors.mochaDark; + } + else if config.collinux.gtk.theme == "adwaita" + then { + name = "Vanilla-DMZ"; + package = pkgs.vanilla-dmz; + } + else null; }; - theme_data = { - package = mkOption { - type = lib.types.package; - default = - if (config.collinux.desktop.gtk.theme == "catppuccin") - then - (pkgs.catppuccin-gtk.override { - variant = "mocha"; - accents = ["blue"]; - size = "standard"; - }) - else if (config.collinux.desktop.gtk.theme == "adwaita") - then pkgs.adw-gtk3 - else ""; - }; - name = mkOption { - type = lib.types.str; - default = - if (config.collinux.desktop.gtk.theme == "catppuccin") - then "catppuccin-mocha-blue-standard" - else if (config.collinux.desktop.gtk.theme == "adwaita") - then "adw-gtk3" - else ""; + + theme_data = mkOption { + internal = true; + type = lib.types.submodule { + package = mkOption { + internal = true; + type = lib.types.package; + }; + name = mkOption { + internal = true; + type = lib.types.str; + }; }; + + default = + if config.collinux.desktop.gtk.theme == "catppuccin" + then { + package = pkgs.catppuccin-gtk.override { + variant = "mocha"; + accents = ["blue"]; + size = "standard"; + }; + name = "catppuccin-mocha-blue-standard"; + } + else if config.collinux.desktop.gtk.theme == "adwaita" + then { + package = pkgs.adw-gtk3; + name = "adw-gtk3"; + } + else null; }; }; @@ -106,11 +116,9 @@ in { profileName = mkOption { type = types.str; default = config.collinux.user.name; + internal = true; }; - theme = mkOption { - type = types.enum ["none" "catppuccin" "adwaita" "kanagawa"]; - default = config.collinux.theme; - }; + theme = mkThemeOption "firefox"; extensions.zotero.enable = mkOption { description = "install Zotero Connector for Firefox"; default = config.collinux.desktop.programs.research.enable; @@ -122,7 +130,7 @@ in { ghostty.enable = mkEnableOption "ghostty"; alacritty.enable = mkEnableOption "alacritty"; - research.enable = mkEnableOption "zathura, Xournal++, Zotero, Zotero Connector"; + research.enable = mkEnableOption "zathura, Xournal++, Zotero"; }; }; }; -- cgit v1.3.1 From bd5c9fd6ecb52095e463a2edc0d3ee32f43c849d Mon Sep 17 00:00:00 2001 From: Collin Williams <96917990+bluedragon1221@users.noreply.github.com> Date: Wed, 14 Jan 2026 13:34:55 -0600 Subject: configurable greeter for greetd --- hosts/mercury/config.nix | 9 ++++-- modules/desktop/nixos/greeters/greetd.nix | 28 +++++++++++++---- modules/desktop/options.nix | 50 +++++++++++++++---------------- 3 files changed, 53 insertions(+), 34 deletions(-) (limited to 'modules/desktop/options.nix') diff --git a/hosts/mercury/config.nix b/hosts/mercury/config.nix index 3427a2e..657c4e5 100644 --- a/hosts/mercury/config.nix +++ b/hosts/mercury/config.nix @@ -6,10 +6,15 @@ desktop = { wallpaper = ./wallpaper.jpg; gtk.enable = true; - greetd.enable = true; + greetd = { + enable = true; + autologin.enable = true; + }; wm = { - niri.enable = true; + # niri.enable = true; + sway.enable = true; + components = { fuzzel.enable = true; dunst.enable = true; diff --git a/modules/desktop/nixos/greeters/greetd.nix b/modules/desktop/nixos/greeters/greetd.nix index b612c86..02af31f 100644 --- a/modules/desktop/nixos/greeters/greetd.nix +++ b/modules/desktop/nixos/greeters/greetd.nix @@ -1,19 +1,35 @@ { + pkgs, config, lib, ... }: let cfg = config.collinux.desktop.greetd; + + session = + if cfg.cosmic-greeter.enable + then { + command = "${pkgs.cosmic-greeter}/bin/cosmic-greeter-start"; + user = config.collinux.user.name; + } + else if cfg.autologin.enable + then { + user = config.collinux.user.name; + command = with config.collinux.desktop; + if (wm.sway.enable && !gnome.enable && !wm.niri.enable) + then lib.getExe pkgs.sway + else if (wm.niri.enable && !gnome.enable && !wm.sway.enable) + then "${pkgs.niri}/bin/niri-session" + else null; + } + else {}; in lib.mkIf cfg.enable { services.greetd = { enable = true; - settings = rec { - initial_session = { - command = cfg.command; - user = config.collinux.user.name; - }; - default_session = initial_session; + settings = { + initial_session = session; + default_session = session; }; }; } diff --git a/modules/desktop/options.nix b/modules/desktop/options.nix index e59ed68..a4ba38d 100644 --- a/modules/desktop/options.nix +++ b/modules/desktop/options.nix @@ -22,18 +22,8 @@ in { greetd = { enable = mkEnableOption "greetd greeter"; - command = mkOption { - type = lib.types.str; - internal = true; - default = let - cfg = config.collinux.desktop; - in - if (cfg.wm.sway.enable && !cfg.gnome.enable && !cfg.wm.niri.enable) - then lib.getExe pkgs.sway - else if (cfg.wm.niri.enable && !cfg.gnome.enable && !cfg.wm.sway.enable) - then "${pkgs.niri}/bin/niri-session" - else null; - }; + autologin.enable = mkEnableOption "autologin"; + cosmic-greeter.enable = mkEnableOption "cosmic-greeter"; }; gdm.enable = mkEnableOption "gdm display manager"; @@ -55,13 +45,15 @@ in { cursor_data = mkOption { internal = true; type = lib.types.submodule { - package = mkOption { - internal = true; - type = lib.types.package; - }; - name = mkOption { - internal = true; - type = lib.types.str; + options = { + package = mkOption { + internal = true; + type = lib.types.package; + }; + name = mkOption { + internal = true; + type = lib.types.str; + }; }; }; default = @@ -81,13 +73,15 @@ in { theme_data = mkOption { internal = true; type = lib.types.submodule { - package = mkOption { - internal = true; - type = lib.types.package; - }; - name = mkOption { - internal = true; - type = lib.types.str; + options = { + package = mkOption { + internal = true; + type = lib.types.package; + }; + name = mkOption { + internal = true; + type = lib.types.str; + }; }; }; @@ -141,6 +135,10 @@ in { assertion = with config.collinux.desktop; !(gdm.enable && greetd.enable); message = "Can't enable gdm and greetd at the same time"; } + { + assertion = with config.collinux.desktop.greetd; enable && !(autologin.enable && cosmic-greeter.enable); + message = "Can't use autologin and cosmic-greeter at the same time"; + } ]; }; } -- cgit v1.3.1