diff options
Diffstat (limited to 'modules/apps')
-rw-r--r-- | modules/apps/alacritty.nix | 99 | ||||
-rw-r--r-- | modules/apps/astal.nix | 47 | ||||
-rw-r--r-- | modules/apps/default.nix | 23 | ||||
-rw-r--r-- | modules/apps/hyprlock.nix | 87 | ||||
-rw-r--r-- | modules/apps/kitty.nix | 81 | ||||
-rw-r--r-- | modules/apps/mako.nix | 35 | ||||
-rw-r--r-- | modules/apps/waybar/default.nix | 87 | ||||
-rw-r--r-- | modules/apps/waybar/style.nix | 107 | ||||
-rw-r--r-- | modules/apps/wofi/default.nix | 29 | ||||
-rw-r--r-- | modules/apps/wofi/style.nix | 73 |
10 files changed, 668 insertions, 0 deletions
diff --git a/modules/apps/alacritty.nix b/modules/apps/alacritty.nix new file mode 100644 index 0000000..b50e142 --- /dev/null +++ b/modules/apps/alacritty.nix @@ -0,0 +1,99 @@ +{ + config, + lib, + ... +}: let + inherit (lib) mkIf; + cfg = config.apps; +in { + config = mkIf cfg.alacritty { + default.terminal = lib.mkDefault "alacritty"; + + home-manager.users.${config.user} = { + programs.alacritty = { + enable = true; + + settings = { + # Font + font = { + size = 11; + bold = { + style = "Bold"; + }; + bold_italic = { + style = "Bold Italic"; + }; + italic = { + style = "Italic"; + }; + normal = { + family = config.theme.font.monospace; + style = "Regular"; + }; + offset = { + x = 0; + y = 0; + }; + }; + + # Window + window = { + decorations = "full"; + dynamic_title = true; + padding = { + x = config.theme.outerGap; + y = config.theme.outerGap; + }; + opacity = config.theme.opacity; + }; + + # Colors + colors = { + normal = lib.attrsets.mapAttrs (name: color: "${color}") { + inherit + (config.theme.colors.normal) + black + red + green + yellow + blue + magenta + cyan + white + ; + }; + + bright = lib.attrsets.mapAttrs (name: color: "${color}") { + inherit + (config.theme.colors.bright) + black + red + green + yellow + blue + magenta + cyan + white + ; + }; + + cursor = { + background = "CellForeground"; + text = "CellBackground"; + }; + + selection = { + background = "CellForeground"; + text = "CellBackground"; + }; + + primary = { + foreground = "#${config.theme.colors.text}"; + background = "#${config.theme.colors.base}"; + }; + }; + }; + }; + }; + }; +} diff --git a/modules/apps/astal.nix b/modules/apps/astal.nix new file mode 100644 index 0000000..e57263e --- /dev/null +++ b/modules/apps/astal.nix @@ -0,0 +1,47 @@ +{ + lib, + config, + pkgs, + inputs, + system, + ... +}: let + astal = inputs.self.packages.${system}; + inherit (lib) mkIf; + cfg = config.apps; +in { + config = mkIf cfg.astal { + default.appLauncher = lib.mkDefault "astal-launcher"; + + home-manager.users.${config.user} = { + home.packages = [ + astal.astal.shell + astal.astal.launcher + ]; + + systemd.user.services.astal = { + Unit = { + Description = "Custom Gtk Lua Shell."; + PartOf = [ + config.default.session + "tray.target" + ]; + After = [config.default.session]; + ConditionEnvironment = "WAYLAND_DISPLAY"; + }; + + Service = { + ExecReload = "${pkgs.coreutils}/bin/kill -SIGUSR2 $MAINPID"; + ExecStart = "${astal.astal.shell}/bin/astal-shell"; + KillMode = "mixed"; + Restart = "on-failure"; + }; + + Install.WantedBy = [ + config.default.session + "tray.target" + ]; + }; + }; + }; +} diff --git a/modules/apps/default.nix b/modules/apps/default.nix new file mode 100644 index 0000000..7100897 --- /dev/null +++ b/modules/apps/default.nix @@ -0,0 +1,23 @@ +{lib, ...}: let + inherit (lib) mkEnableOption; +in { + imports = [ + ./waybar + ./wofi + ./alacritty.nix + ./astal.nix + ./hyprlock.nix + ./kitty.nix + ./mako.nix + ]; + + options.apps = { + alacritty = mkEnableOption "Enable the alacritty terminal."; + astal = mkEnableOption "Enable the astal gtk shell."; + kitty = mkEnableOption "Enable the kitty terminal."; + mako = mkEnableOption "Enable the mako notification daemon."; + hyprlock = mkEnableOption "Enable the hyprlock lockscreen."; + waybar = mkEnableOption "Enable the waybar bar."; + wofi = mkEnableOption "Enable the wofi launcher."; + }; +} diff --git a/modules/apps/hyprlock.nix b/modules/apps/hyprlock.nix new file mode 100644 index 0000000..4a844e3 --- /dev/null +++ b/modules/apps/hyprlock.nix @@ -0,0 +1,87 @@ +{ + config, + lib, + ... +}: let + text = "rgb(${config.theme.colors.text})"; + base = "rgb(${config.theme.colors.base})"; + error = "rgb(${config.theme.colors.error})"; + trans = "rgba(0,0,0,0)"; + + inherit (lib) mkIf; + cfg = config.apps; +in { + config = mkIf cfg.hyprlock { + default.lockScreen = lib.mkDefault "hyprlock"; + + home-manager.users.${config.user} = { + programs.hyprlock = { + enable = true; + + settings = { + background = { + path = config.theme.lockscreen; + color = base; + blur_passes = 0; + blur_size = 2; + noise = 0; + contrast = 0; + brightness = 0; + vibrancy = 0; + vibrancy_darkness = 0.0; + }; + + # Password Input + input-field = { + size = "300, 50"; + outline_thickness = 0; + dots_size = 0.25; + dots_spacing = 0.55; + dots_center = true; + dots_rounding = -1; + outer_color = trans; + inner_color = trans; + font_color = text; + fade_on_empty = false; + placeholder_text = "Enter Password"; + hide_input = false; + check_color = error; + fail_color = error; + capslock_color = -1; + numlock_color = -1; + bothlock_color = -1; + invert_numlock = false; + swap_font_color = false; + font_family = config.theme.font.regular; + position = "0, 50"; + halign = "center"; + valign = "bottom"; + }; + + label = [ + # Date + { + text = "cmd[update:1000] echo \"$(date +\"%A, %B %d\")\""; + color = text; + font_size = 20; + font_family = config.theme.font.header; + position = "0, -100"; + halign = "center"; + valign = "top"; + } + # Clock + { + text = "cmd[update:1000] echo \"$(date +\"%k:%M:%S\")\""; + color = text; + font_size = 90; + font_family = config.theme.font.header; + position = "0, -130"; + halign = "center"; + valign = "top"; + } + ]; + }; + }; + }; + }; +} diff --git a/modules/apps/kitty.nix b/modules/apps/kitty.nix new file mode 100644 index 0000000..03f981a --- /dev/null +++ b/modules/apps/kitty.nix @@ -0,0 +1,81 @@ +{ + config, + lib, + ... +}: let + inherit (lib) mkIf; + cfg = config.apps; +in { + config = mkIf cfg.kitty { + default.terminal = lib.mkDefault "kitty"; + + home-manager.users.${config.user} = { + programs.kitty = { + enable = true; + environment = {}; + extraConfig = ""; + + settings = { + # Font + font_family = config.theme.font.monospace; + font_size = 11; + bold_font = "auto"; + italic_font = "auto"; + bold_italic_font = "auto"; + + # Scrollback + scrollback_lines = 10000; + scrollback_pager_history_size = 300; # MB + + # Urls + detect_urls = true; + show_hyperlink_targets = false; + + # Window + window_padding_width = config.theme.outerGap; + window_border_width = 0; + draw_minimal_borders = true; + background_opacity = config.theme.opacity; + + # Disable audio + enable_audio_bell = false; + + # Disable close prompt + confirm_os_window_close = 0; + + # selection + selection_background = "#${config.theme.colors.surface}"; + selection_foreground = "none"; + + # cursor + url_color = "#${config.theme.colors.bright.yellow}"; + cursor = "#${config.theme.colors.text}"; + + # colors + background = "#${config.theme.colors.base}"; + foreground = "#${config.theme.colors.text}"; + + # normal + color0 = "#${config.theme.colors.normal.black}"; + color1 = "#${config.theme.colors.normal.red}"; + color2 = "#${config.theme.colors.normal.green}"; + color3 = "#${config.theme.colors.normal.yellow}"; + color4 = "#${config.theme.colors.normal.blue}"; + color5 = "#${config.theme.colors.normal.magenta}"; + color6 = "#${config.theme.colors.normal.cyan}"; + color7 = "#${config.theme.colors.normal.white}"; + + # bright + color8 = "#${config.theme.colors.bright.black}"; + color9 = "#${config.theme.colors.bright.red}"; + color10 = "#${config.theme.colors.bright.green}"; + color11 = "#${config.theme.colors.bright.yellow}"; + color12 = "#${config.theme.colors.bright.blue}"; + color13 = "#${config.theme.colors.bright.magenta}"; + color14 = "#${config.theme.colors.bright.cyan}"; + color15 = "#${config.theme.colors.bright.white}"; + }; + }; + }; + }; +} diff --git a/modules/apps/mako.nix b/modules/apps/mako.nix new file mode 100644 index 0000000..62e5712 --- /dev/null +++ b/modules/apps/mako.nix @@ -0,0 +1,35 @@ +{ + config, + lib, + ... +}: let + inherit (lib) mkIf; + cfg = config.apps; +in { + config = mkIf cfg.mako { + home-manager.users.${config.user} = { + services.mako = { + enable = false; # now using astal + + settings = { + font = "${config.theme.font.monospace} 11"; + + margin = toString config.theme.outerGap; + padding = toString config.theme.innerGap; + + background-color = "#${config.theme.colors.base}"; + progress-color = "#${config.theme.colors.primary}"; + text-color = "#${config.theme.colors.text}"; + + border-color = "#${config.theme.colors.text}"; + border-size = config.theme.borderWidth; + border-radius = config.theme.outerRadius; + + default-timeout = 5000; + layer = "overlay"; + icons = true; + }; + }; + }; + }; +} diff --git a/modules/apps/waybar/default.nix b/modules/apps/waybar/default.nix new file mode 100644 index 0000000..ecbbcd4 --- /dev/null +++ b/modules/apps/waybar/default.nix @@ -0,0 +1,87 @@ +{ + config, + lib, + ... +}: let + inherit (lib) mkIf; + cfg = config.apps; +in { + config = mkIf cfg.waybar { + home-manager.users.${config.user} = { + programs.waybar = { + enable = false; # using astal now + + settings = [ + { + height = 24; + layer = "top"; + position = "top"; + spacing = 4; + + modules-left = [ + "hyprland/workspaces" + ]; + modules-center = [ + "clock" + ]; + modules-right = [ + "battery" + "wireplumber" + "network" + "tray" + ]; + + "hyprland/workspaces" = { + disable-scroll = true; + all-outputs = true; + format = "{name}"; + }; + + battery = { + interval = 1; + states = { + warning = 30; + critical = 15; + }; + format = " {capacity}%"; + format-charging = " {capacity}%"; + format-plugged = " {capacity}%"; + format-full = " {capacity}%"; + format-warning = " {capacity}%"; + format-critical = " {capacity}%"; + }; + + wireplumber = { + format = " {volume}%"; + format-bluetooth = " {volume}%"; + format-muted = " muted"; + scroll-step = 1; + on-click = "pavucontrol"; + ignored-sinks = ["Easy Effects Sink"]; + }; + + network = { + format = " disconnected"; + format-wifi = " {essid}"; + format-ethernet = " {ipaddr}/{cidr}"; + format-disconnected = " disconnected"; + max-length = 50; + on-click = "nm-connection-editor"; + }; + + clock = { + interval = 1; + format = "{:%Y-%m-%d %a %H:%M:%S}"; + }; + + tray = { + spacing = config.theme.outerGap; + }; + } + ]; + + style = import ./style.nix {theme = config.theme;}; + }; + }; + }; +} diff --git a/modules/apps/waybar/style.nix b/modules/apps/waybar/style.nix new file mode 100644 index 0000000..21a8de5 --- /dev/null +++ b/modules/apps/waybar/style.nix @@ -0,0 +1,107 @@ +{theme}: let + text = "#${theme.colors.text}"; + base = "#${theme.colors.base}"; + surface = "#${theme.colors.surface}"; + primary = "#${theme.colors.primary}"; + success = "#${theme.colors.success}"; + warning = "#${theme.colors.warning}"; + error = "#${theme.colors.error}"; + fontSize = "${toString theme.font.size}px"; + outerGap = "${toString theme.outerGap}px"; + innerGap = "${toString theme.innerGap}px"; + outerRadius = "${toString theme.outerRadius}px"; + innerRadius = "${toString theme.innerRadius}px"; + borderWidth = "${toString theme.borderWidth}px"; +in '' + /** Base */ + + * { + all: unset; + } + + window#waybar { + font-family: "${theme.font.regular}", "${theme.font.icon}", "${theme.font.monospace}"; + font-size: ${fontSize}; + color: ${text}; + background-color: ${base}; + } + + /** Workspaces */ + + #workspaces { + margin-left: ${outerGap}; + } + + #workspaces button { + border-radius: ${innerRadius}; + margin: 4px 2px; + padding: 0px 7px; + background: ${surface}; + color: ${text}; + } + + #workspaces button.focused, + #workspaces button.active { + background: ${primary}; + color: ${base}; + } + + #workspaces button.urgent { + background: ${error}; + } + + /** Tray */ + + #tray { + border: none; + margin-right: ${outerGap}; + } + + #tray > .passive { + -gtk-icon-effect: dim; + } + + #tray > .needs-attention { + -gtk-icon-effect: highlight; + } + + /** Right modules */ + + #battery, + #wireplumber, + #network { + padding: 0 ${outerGap}; + } + + /** Battery */ + + #battery.charging { + color: ${success}; + } + + #battery.warning:not(.charging) { + color: ${warning}; + } + + #battery.critical:not(.charging) { + color: ${error}; + } + + /** Wireplumber */ + + #wireplumber.muted { + color: ${error}; + } + + /** Network */ + + #network.wifi, + #network.ethernet { + color: ${success}; + } + + #network.disconnected { + color: ${error}; + } + +'' diff --git a/modules/apps/wofi/default.nix b/modules/apps/wofi/default.nix new file mode 100644 index 0000000..6036dd1 --- /dev/null +++ b/modules/apps/wofi/default.nix @@ -0,0 +1,29 @@ +{ + config, + lib, + ... +}: let + inherit (lib) mkIf; + cfg = config.apps; +in { + config = mkIf cfg.wofi { + default.appLauncher = lib.mkDefault "wofi --show drun --prompt 'Seach Programs'"; + + home-manager.users.${config.user} = { + programs.wofi = { + enable = true; + + settings = { + key_expand = "Tab"; + term = "kitty"; + matching = "multi-contains"; + insensitive = true; + gtk_dark = true; + hide_scroll = true; + }; + + style = import ./style.nix {theme = config.theme;}; + }; + }; + }; +} diff --git a/modules/apps/wofi/style.nix b/modules/apps/wofi/style.nix new file mode 100644 index 0000000..75a0a21 --- /dev/null +++ b/modules/apps/wofi/style.nix @@ -0,0 +1,73 @@ +{theme}: let + text = "#${theme.colors.text}"; + base = "#${theme.colors.base}"; + surface = "#${theme.colors.surface}"; + primary = "#${theme.colors.primary}"; + fontSize = "${toString theme.font.size}px"; + outerGap = "${toString theme.outerGap}px"; + innerGap = "${toString theme.innerGap}px"; + outerRadius = "${toString theme.outerRadius}px"; + innerRadius = "${toString theme.innerRadius}px"; + borderWidth = "${toString theme.borderWidth}px"; +in '' + * { + font-family: ${theme.font.monospace}; + font-size: ${fontSize}; + } + + /* Window */ + window { + margin: 0px; + border: ${borderWidth} solid ${primary}; + border-radius: ${outerRadius}; + background-color: ${base}; + } + + /* Outer Box */ + #outer-box { + padding: ${outerGap}; + } + + /* Scroll */ + #scroll { + margin: 0px; + padding: ${innerGap}; + border: none; + } + + /* Input */ + #input { + margin: ${innerGap}; + padding: ${innerGap}; + border: none; + color: ${text}; + background-color: ${surface}; + border-radius: ${outerRadius}; + } + + #input:focus, + #input:active { + border: ${borderWidth} solid ${primary}; + box-shadow: none; + outline: none; + } + + /* Text */ + #text { + margin: ${innerGap}; + padding: ${innerGap}; + border: none; + color: ${text}; + } + + /* Selected Entry */ + #entry:selected { + background-color: ${primary}; + border-radius: ${outerRadius}; + } + + #entry:selected #text { + color: ${base}; + } + +'' |