diff options
Diffstat (limited to 'modules/desktop')
| -rw-r--r-- | modules/desktop/hjem/programs/firefox.nix | 2 | ||||
| -rw-r--r-- | modules/desktop/hjem/wm/fuzzel.nix | 40 | ||||
| -rw-r--r-- | modules/desktop/nixos/fonts.nix | 3 | ||||
| -rw-r--r-- | modules/desktop/nixos/greeters/greetd.nix | 28 | ||||
| -rw-r--r-- | modules/desktop/options.nix | 132 |
5 files changed, 116 insertions, 89 deletions
diff --git a/modules/desktop/hjem/programs/firefox.nix b/modules/desktop/hjem/programs/firefox.nix index b5ea433..2078e3c 100644 --- a/modules/desktop/hjem/programs/firefox.nix +++ b/modules/desktop/hjem/programs/firefox.nix @@ -27,6 +27,8 @@ in }; }; + ".mozilla/firefox/collin/user.js".source = "${inputs.betterfox}/user.js"; + ".mozilla/firefox/collin/chrome/userChrome.css".text = mkCssHacks ( # (lib.optional (cfg.theme == "adwaita") "window_control_placeholder_support") ++ [ diff --git a/modules/desktop/hjem/wm/fuzzel.nix b/modules/desktop/hjem/wm/fuzzel.nix index 7d61255..f9a9edb 100644 --- a/modules/desktop/hjem/wm/fuzzel.nix +++ b/modules/desktop/hjem/wm/fuzzel.nix @@ -8,34 +8,38 @@ settings = { main = { - prompt = ""; - dpi-aware = false; + prompt = builtins.fromJSON ''"\u200B"''; # https://discourse.nixos.org/t/how-can-i-put-an-nonprintable-character-in-a-nix-expression/47750/7 - font = "Iosevka Nerd Font"; - line-height = 25; + font = "Iosevka Nerd Font:size=9"; + use-bold = true; + line-height = 16; lines = 10; - width = 30; + width = 20; - horizontal-pad = 8; - vertical-pad = 8; + anchor = "bottom-right"; + + horizontal-pad = 0; + vertical-pad = 0; }; border = { radius = 0; width = 3; }; - colors = with config.collinux.palette; { - background = "${base00}99"; - border = "ffffff00"; - input = base05; - match = base13; - placeholder = base03; - text = base01; - prompt = base01; + colors = with config.collinux.palette; let + transparent = "#ffffff00"; + in { + background = transparent; + border = transparent; + input = transparent; + match = "#${base13}ff"; + placeholder = "#${base03}ff"; + text = "#${base04}ff"; + prompt = "#${base05}ff"; - selection = "${base01}5a"; - selection-match = base13; - selection-text = base05; + selection = transparent; + selection-match = "#${base13}ff"; + selection-text = "#${base05}ff"; }; }; in diff --git a/modules/desktop/nixos/fonts.nix b/modules/desktop/nixos/fonts.nix index 3f10d92..5ac17ec 100644 --- a/modules/desktop/nixos/fonts.nix +++ b/modules/desktop/nixos/fonts.nix @@ -1,8 +1,7 @@ {pkgs, ...}: { fonts = { enableDefaultPackages = false; - # fontDir.enable = true; fontconfig.enable = true; - packages = [pkgs.nerd-fonts.iosevka pkgs.ibm-plex]; # for terminal (blackbox or foot) + packages = [pkgs.nerd-fonts.iosevka pkgs.ibm-plex]; # for terminal (blackbox or foot or ghostty) }; } 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 1067d0b..a4ba38d 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,21 +17,13 @@ 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; - 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"; @@ -40,7 +32,6 @@ in { niri.enable = mkEnableOption "niri"; components = { - # waybar = mkProgramOption "waybar"; dunst = mkProgramOption "dunst"; fuzzel = mkProgramOption "fuzzel"; }; @@ -49,54 +40,67 @@ 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 { + options = { + 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 { + options = { + 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 +110,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 +124,7 @@ in { ghostty.enable = mkEnableOption "ghostty"; alacritty.enable = mkEnableOption "alacritty"; - research.enable = mkEnableOption "zathura, Xournal++, Zotero, Zotero Connector"; + research.enable = mkEnableOption "zathura, Xournal++, Zotero"; }; }; }; @@ -133,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"; + } ]; }; } |
