From afc6ef3e56f5afea42844daa85b5b79e5b481690 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 31 May 2024 00:17:16 +0100 Subject: [PATCH] fonts & waybar --- home/common/core/default.nix | 16 +- home/common/core/fonts.nix | 10 ++ home/common/optional/desktop/waybar.nix | 208 +++++++++++++++++++++++- home/semita.nix | 11 +- home/users/sam/default.nix | 15 +- hosts/common/users/sam/default.nix | 4 +- hosts/semita/default.nix | 5 +- modules/home-manager/default.nix | 6 - 8 files changed, 247 insertions(+), 28 deletions(-) create mode 100644 home/common/core/fonts.nix diff --git a/home/common/core/default.nix b/home/common/core/default.nix index c6b039b..bbb9e43 100644 --- a/home/common/core/default.nix +++ b/home/common/core/default.nix @@ -3,10 +3,20 @@ imports = [ ./zsh.nix ./nixvim.nix + ./fonts.nix ] ; - home.packages = [ - pkgs.ripgrep - ]; + + # Global home packages without config go here (for all hosts and users) + home.packages = builtins.attrValues { + inherit (pkgs) + ripgrep + fzf + eza + pciutils + tree + jq + coreutils + ;}; home.stateVersion = "23.11"; } diff --git a/home/common/core/fonts.nix b/home/common/core/fonts.nix new file mode 100644 index 0000000..2ee9f38 --- /dev/null +++ b/home/common/core/fonts.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: +{ + fonts.fontconfig.enable = true; + home.packages = [ + pkgs.noto-fonts + pkgs.nerdfonts # loads the complete collection. look into overide for FiraMono or potentially mononoki + pkgs.meslo-lgs-nf + ]; + +} diff --git a/home/common/optional/desktop/waybar.nix b/home/common/optional/desktop/waybar.nix index 22b2100..f0175b6 100644 --- a/home/common/optional/desktop/waybar.nix +++ b/home/common/optional/desktop/waybar.nix @@ -10,7 +10,211 @@ }; programs.waybar = { enable = true; - #package = ""; systemd.enable = true; - }; + + settings = { + primary = { + mode = "dock"; + height = 30; + margin = "6"; + spacing = 5; + modules-left = [ + "custom/menu" + "wlr/workspaces"]; + modules-center = [ + "clock" + ]; + modules-right = [ + "cpu" + "memory" + "network" + "pulseaudio" + "battery" + "tray" + "custom/exit" + "custom/hostname" + ]; + "wlr/workspaces" = { + "format" = "{icon}"; + "on-click" = "activate"; + "format-icons"= { + "1" = ""; + "2" = ""; + "3" = ""; + "4" = ""; + "5" = ""; + "urgent" = ""; + "active" = ""; + "default" = ""; + }; + }; + "clock" = { + "format" = "{:%m/%d %H:%M}"; + "tooltip-format" = "{:%B %Y}\n{calendar}"; + "on-click" = "calendar"; + }; + "cpu"= { + "interval" = 10; + "format" = " {}%"; + "max-length" = 10; + "on-click" = ""; + }; + "memory" = { + "interval" = 30; + "format" = " {}%"; + "format-alt" = " {used:0.1f}G"; + "max-length" = 10; + }; + + "network" = { + "format-wifi" = "直 {signalStrength}%"; + "format-ethernet" = " wired"; + "format-disconnected" = "睊"; + "on-click" = "bash ~/.config/waybar/scripts/rofi-wifi-menu.sh"; + }; + + "battery" = { + "bat" = "BAT0"; + "adapter" = "ADP0"; + "interval" = 60; + "states" = { + "warning" = 30; + "critical" = 15; + }; + "max-length" = 20; + "format" = "{icon} {capacity}%"; + "format-warning" = "{icon} {capacity}%"; + "format-critical" = "{icon} {capacity}%"; + "format-charging" = " {capacity}%"; + "format-plugged" = " {capacity}%"; + "format-alt" = "{icon} {time}"; + "format-full" = " {capacity}%"; + "format-icons" = [" " " " " " " " " "]; + }; + + "tray" = { + "spacing" = 10; + }; + + "custom/menu" = { + "format" = ""; + "on-click" = "rofi -show drun"; + }; + + "custom/hostname" = { + "exec" = "echo $USER@$(hostname)"; + "on-click" = "alacritty"; + }; + + "custom/exit" = { + "format" = ""; + "on-click" = "wlogout"; + }; + + "pulseaudio" = { + "format" = "{icon} {volume}%"; + "format-muted" = " 0%"; + "format-icons" = { + "headphone" = ""; + "headset" = ""; + "portable" = ""; + "default" = [ "" "" "" ]; + }; + "on-click" = "pavucontrol"; + }; + + }; + }; + + style = '' + * { + font-family: JetBrainsMono Nerd Font; + font-size: 12pt; + padding: 0 8px; + } + .modules-right { + margin-right: -15px; + } + .modules-left { + margin-left: -15px; + } + window#waybar { + color: white; + background-color: #002635; + opacity: 0.95; + padding: 0; + border-radius: 10px; + } + window#waybar.bottom { + opacity: 0.90; + background-color: #002635; + border: 2px solid #14747e; + border-radius: 10px; + } + + #workspaces button { + padding: 0 5px; + color: #7984A4; + background-color: transparent; + box-shadow: inset 0 -3px transparent; + border: none; + border-radius: 0; + } + #workspaces button.hidden { + background-color: #002635; + color: #869696; + } + #workspaces button.focused { + color: #bf616a; + } + + #workspaces button.active { + color: #6a92d7; + } + + #workspaces button.urgent { + background-color: #eb4d4b; + } + + #clock { + padding-left: 15px; + padding-right: 15px; + margin-top: 0; + margin-bottom: 0; + border-radius: 10px; + } + + #tray { + color: #a1a19a; + } + + #custom-hostname { + background-color: white; + color: #002635; + padding-left: 15px; + padding-right: 18px; + margin-right: 0; + margin-top: 0; + margin-bottom: 0; + border-radius: 10px; + } + + + #custom-menu { + font-size: 16pt; + background-color: white; + color: #002635; + padding-left: 15px; + padding-right: 22px; + margin-left: 0; + margin-right: 10px; + margin-top: 0; + margin-bottom: 0; + border-radius: 10px; + } + + ''; + }; + + } diff --git a/home/semita.nix b/home/semita.nix index 682d7d0..65063c4 100644 --- a/home/semita.nix +++ b/home/semita.nix @@ -19,7 +19,14 @@ ./common/optional/desktop/waybar.nix ]; -monitors = [ + + home.packages = [ + pkgs.kitty + pkgs.zathura + pkgs.xfce.thunar + ]; + + monitors = [ { name = "Virtual-1"; width = 2048; @@ -35,5 +42,5 @@ monitors = [ refreshRate = 60; x = 2048; } - ]; + ]; } diff --git a/home/users/sam/default.nix b/home/users/sam/default.nix index ac76ea7..cc9684a 100644 --- a/home/users/sam/default.nix +++ b/home/users/sam/default.nix @@ -3,17 +3,11 @@ { home.username = "sam"; home.homeDirectory = "/home/sam"; - home.stateVersion = "23.11"; + home.stateVersion = "23.11"; imports = [ ] ++ (builtins.attrValues outputs.homeManagerModules); # import all homeManagerModules? - home.packages = [ - pkgs.kitty - pkgs.zathura - pkgs.xfce.thunar - ]; - home.file = { ".icons/bibata".source = "${pkgs.bibata-cursors}/share/icons/Bibata-Modern-Classic"; }; @@ -32,13 +26,13 @@ ]; gtk.enable = true; - + gtk.cursorTheme.package = pkgs.bibata-cursors; gtk.cursorTheme.name = "Bibata-Modern-Ice"; - + gtk.theme.package = pkgs.gruvbox-gtk-theme; gtk.theme.name = "Gruvbox-Dark-B"; - + gtk.iconTheme.package = pkgs.gruvbox-plus-icons; gtk.iconTheme.name = "GruvboxPlus"; @@ -56,4 +50,3 @@ }; } - diff --git a/hosts/common/users/sam/default.nix b/hosts/common/users/sam/default.nix index 8df74e0..c2f3672 100644 --- a/hosts/common/users/sam/default.nix +++ b/hosts/common/users/sam/default.nix @@ -6,7 +6,7 @@ let secretsDirectory = builtins.toString inputs.nix-secrets; secretsFile = "${secretsDirectory}/secrets.yaml"; username = "sam"; -in +in { users.users.${username} = { isNormalUser = true; @@ -47,5 +47,5 @@ in }; environment.systemPackages = [ - ]; + ]; } diff --git a/hosts/semita/default.nix b/hosts/semita/default.nix index 256bdf8..8321d80 100644 --- a/hosts/semita/default.nix +++ b/hosts/semita/default.nix @@ -5,12 +5,13 @@ let dev = "/dev/vda"; # depends on target hardware encrypted = true; # currrently only applies to btrfs btrfsMountDevice = if encrypted then "/dev/mapper/crypted" else "/dev/root_vg/root"; + user = "sam"; in { imports = [ # Create users for this host - ../common/users/sam + ../common/users/${user} # Disk configuration inputs.disko.nixosModules.disko @@ -43,7 +44,7 @@ in environment.persistence."/persist" = { hideMounts = true; - users.sam= { + users.${user} = { directories = [ "Sync" "Keep" diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 663c636..d1eb0f1 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -1,10 +1,4 @@ { #fonts = import ./fonts.nix; monitors = import ./monitors.nix; -# pass-secret-service = import ./pass-secret-service.nix; -# rgbdaemon = import ./rgbdaemon.nix; -# shellcolor = import ./shellcolor.nix; -# wallpaper = import ./wallpaper.nix; -# xpo = import ./xpo.nix; -# colors = import ./colors.nix; }