diff --git a/config/hosts/athame/services/matrix.nix b/config/hosts/athame/services/matrix.nix index 65edf88b..14b6685f 100644 --- a/config/hosts/athame/services/matrix.nix +++ b/config/hosts/athame/services/matrix.nix @@ -2,10 +2,8 @@ let secrets = (import ../secrets.nix); in { - environment.systemPackages = [ - pkgs.arc.pkgs.mx-puppet-discord - pkgs.mautrix-whatsapp - ]; + environment.systemPackages = + [ pkgs.arc.pkgs.mx-puppet-discord pkgs.mautrix-whatsapp ]; services.matrix-synapse = { enable = true; @@ -46,9 +44,7 @@ in { }; bridge = { relaybot.authless_portals = false; - permissions = { - "@kat:kittywit.ch" = "admin"; - }; + permissions = { "@kat:kittywit.ch" = "admin"; }; }; }; environmentFile = "/etc/secrets/mautrix-telegram.env"; @@ -57,11 +53,12 @@ in { serviceConfig = { Type = "simple"; Restart = "always"; - ExecStart = "${pkgs.arc.pkgs.mx-puppet-discord}/bin/mx-puppet-discord -c /var/lib/mx-puppet-discord/config.yaml -f /var/lib/mx-puppet-discord/discord-registration.yaml"; + ExecStart = + "${pkgs.arc.pkgs.mx-puppet-discord}/bin/mx-puppet-discord -c /var/lib/mx-puppet-discord/config.yaml -f /var/lib/mx-puppet-discord/discord-registration.yaml"; WorkingDirectory = "/var/lib/mx-puppet-discord"; DynamicUser = true; StateDirectory = "mx-puppet-discord"; - UMask = 0027; + UMask = 27; PrivateTmp = true; ProtectSystem = "strict"; ProtectHome = true; @@ -73,15 +70,16 @@ in { wantedBy = [ "multi-user.target" ]; after = [ "network.target" ]; }; - systemd.services.mautrix-whatsapp = { + systemd.services.mautrix-whatsapp = { serviceConfig = { Type = "simple"; Restart = "always"; - ExecStart = "${pkgs.mautrix-whatsapp}/bin/mautrix-whatsapp -c /var/lib/mautrix-whatsapp/config.yaml -r /var/lib/mautrix-whatsapp/registration.yaml"; + ExecStart = + "${pkgs.mautrix-whatsapp}/bin/mautrix-whatsapp -c /var/lib/mautrix-whatsapp/config.yaml -r /var/lib/mautrix-whatsapp/registration.yaml"; WorkingDirectory = "/var/lib/mautrix-whatsapp"; DynamicUser = true; StateDirectory = "mautrix-whatsapp"; - UMask = 0027; + UMask = 27; PrivateTmp = true; ProtectSystem = "strict"; ProtectHome = true; diff --git a/config/hosts/athame/services/nginx.nix b/config/hosts/athame/services/nginx.nix index 4677cc1f..26d5c1cf 100644 --- a/config/hosts/athame/services/nginx.nix +++ b/config/hosts/athame/services/nginx.nix @@ -52,34 +52,34 @@ in { */ } // common; "kittywit.ch" = { - locations = { - "/_matrix" = { - proxyPass = "http://[::1]:8008"; - }; - "= /.well-known/matrix/server".extraConfig = - let server = { "m.server" = "kittywit.ch:443"; }; in '' - add_header Content-Type application/json; - return 200 '${builtins.toJSON server}'; - ''; - "= /.well-known/matrix/client".extraConfig = - let client = { - "m.homeserver" = { "base_url" = "https://kittywit.ch"; }; - "m.identity_server" = { "base_url" = "https://vector.im"; }; - }; in '' - add_header Content-Type application/json; - add_header Access-Control-Allow-Origin *; - return 200 '${builtins.toJSON client}'; - ''; - }; + locations = { + "/_matrix" = { proxyPass = "http://[::1]:8008"; }; + "= /.well-known/matrix/server".extraConfig = + let server = { "m.server" = "kittywit.ch:443"; }; + in '' + add_header Content-Type application/json; + return 200 '${builtins.toJSON server}'; + ''; + "= /.well-known/matrix/client".extraConfig = let + client = { + "m.homeserver" = { "base_url" = "https://kittywit.ch"; }; + "m.identity_server" = { "base_url" = "https://vector.im"; }; + }; + in '' + add_header Content-Type application/json; + add_header Access-Control-Allow-Origin *; + return 200 '${builtins.toJSON client}'; + ''; + }; } // common; "vault.kittywit.ch" = { - locations = { - "/".proxyPass = "http://127.0.0.1:4000"; - "/notifications/hub".proxyPass = "http://127.0.0.1:3012"; - "/notifications/hub/negotiate".proxyPass = "http://127.0.0.1:80"; - }; + locations = { + "/".proxyPass = "http://127.0.0.1:4000"; + "/notifications/hub".proxyPass = "http://127.0.0.1:3012"; + "/notifications/hub/negotiate".proxyPass = "http://127.0.0.1:80"; + }; } // common; - /* "git.dork.dev" = { + /* "git.dork.dev" = { locations = { "/".proxyPass = "http://127.0.0.1:3000"; }; diff --git a/config/profiles/common/default.nix b/config/profiles/common/default.nix index 250c613a..dcad103e 100644 --- a/config/profiles/common/default.nix +++ b/config/profiles/common/default.nix @@ -7,11 +7,9 @@ in { imports = [ ../../../modules ../../users - ../desktop ../development ../gaming ../network - ../sway ../yubikey (sources.home-manager + "/nixos") ]; diff --git a/config/profiles/sway/colors.nix b/config/profiles/sway/colors.nix deleted file mode 100644 index 421c02f9..00000000 --- a/config/profiles/sway/colors.nix +++ /dev/null @@ -1,55 +0,0 @@ -rec { - base16 = { - color0 = "#2e3440"; - color1 = "#bf616a"; - color2 = "#a3be8c"; - color3 = "#ebcb8b"; - color4 = "#81a1c1"; - color5 = "#b48ead"; - color6 = "#88c0d0"; - color7 = "#e5e9f0"; - - color8 = "#4c566a"; - color9 = "#d08770"; - color10 = "#3b4252"; - color11 = "#434c5e"; - color12 = "#d8dee9"; - color13 = "#eceff4"; - color14 = "#5e81ac"; - color15 = "#8fbcbb"; - - color16 = "#fd971f"; - color17 = "#cc6633"; - color18 = "#383830"; - color19 = "#49483e"; - color20 = "#a59f85"; - color21 = "#f5f4f1"; - }; - - black = base16.color0; - red = base16.color1; - green = base16.color2; - yellow = base16.color3; - blue = base16.color4; - purple = base16.color5; - cyan = base16.color6; - white = base16.color7; - - normal.black = base16.color0; - normal.red = base16.color1; - normal.green = base16.color2; - normal.yellow = base16.color3; - normal.blue = base16.color4; - normal.purple = base16.color5; - normal.cyan = base16.color6; - normal.white = base16.color7; - - bright.black = base16.color8; - bright.red = base16.color9; - bright.green = base16.color10; - bright.yellow = base16.color11; - bright.blue = base16.color12; - bright.purple = base16.color13; - bright.cyan = base16.color14; - bright.white = base16.color15; -} diff --git a/config/profiles/sway/waybar.css.nix b/config/profiles/sway/waybar.css.nix deleted file mode 100644 index 062602b1..00000000 --- a/config/profiles/sway/waybar.css.nix +++ /dev/null @@ -1,68 +0,0 @@ -{ hextorgba, colors }: - -'' - * { - border: none; - border-radius: 0; - font-family: "Hack Nerd Font"; - font-size: 12px; - min-height: 14px - } - - #clock, #memory, #cpu, #temperature, #pulseaudio, #network, #mpd, #backlight, #battery, #custom-weather { - margin-left: 8px; - margin-right: 8px; - padding-left: 8px; - padding-right: 8px; - transition: none; - border-bottom: 2px solid ${colors.base16.color7}; - color: ${colors.base16.color7} - } - - window#waybar { background: ${hextorgba colors.base16.color0} } - - #window { - color: ${colors.base16.color7}; - padding-left: 16px; - padding-right: 16px - } - - #workspaces { padding: 0px 4px 0px 4px } - - #workspaces button { - color: ${colors.base16.color7}; - background: ${hextorgba colors.base16.color11}; - font-size: 16px; - margin: 0px 4px 0px 4px; - border-bottom: 2px solid transparent; - border-left: 1px solid ${colors.base16.color7}; - border-right: 1px solid ${colors.base16.color7} - } - - #workspaces button:last-child { margin-right: 0px } - - #workspaces button.focused { - color: ${colors.base16.color5}; - border-bottom-color: ${colors.base16.color5} - } - - #workspaces button:hover { - transition: none; - box-shadow: inherit; - text-shadow: inherit; - color: ${colors.base16.color2}; - border-bottom-color: ${colors.base16.color2} - } - - #mpd { border-color: #5af78e } - #mpd.disconnected, #mpd.stopped { border-color: #282a36 } - #network { border-color: ${colors.base16.color3} } - #custom-weather { border-color: ${colors.base16.color15} } - #pulseaudio { border-color: ${colors.base16.color2} } - #temperature { border-color: ${colors.base16.color4} } - #battery { border-color: ${colors.base16.color6} } - #backlight { border-color: ${colors.base16.color9} } - #cpu { border-color: ${colors.base16.color5} } - #memory { border-color: ${colors.base16.color17} } - #clock { border-color: ${colors.base16.color7} } -'' diff --git a/config/users/kat/default.nix b/config/users/kat/default.nix index 110a3c94..49cb184c 100644 --- a/config/users/kat/default.nix +++ b/config/users/kat/default.nix @@ -1,7 +1,7 @@ { config, pkgs, ... }: { - imports = [ ./emacs.nix ]; + imports = [ ./desktop.nix ./sway.nix ./waybar.nix ./kitty.nix ./emacs.nix ]; users.users.kat = { uid = 1000; @@ -67,35 +67,36 @@ programs.bat.enable = true; programs.tmux = { enable = true; - extraConfig = " -# modes -setw -g clock-mode-colour colour5 -setw -g mode-style 'fg=colour1 bg=colour18 bold' + extraConfig = '' -# panes -set -g pane-border-style 'fg=colour19 bg=colour0' -set -g pane-active-border-style 'bg=colour0 fg=colour9' + # modes + setw -g clock-mode-colour colour5 + setw -g mode-style 'fg=colour1 bg=colour18 bold' -# statusbar -set -g status-position bottom -set -g status-justify left -set -g status-style 'bg=colour18 fg=colour137 dim' -set -g status-left '' -set -g status-right '#[fg=colour233,bg=colour19] %F #[fg=colour233,bg=colour8] %H:%M:%S %Z' -set -g status-right-length 50 -set -g status-left-length 20 + # panes + set -g pane-border-style 'fg=colour19 bg=colour0' + set -g pane-active-border-style 'bg=colour0 fg=colour9' -setw -g window-status-current-style 'fg=colour1 bg=colour19 bold' -setw -g window-status-current-format ' #I#[fg=colour249]:#[fg=colour255]#W#[fg=colour249]#F ' + # statusbar + set -g status-position bottom + set -g status-justify left + set -g status-style 'bg=colour18 fg=colour137 dim' + set -g status-left ''' + set -g status-right '#[fg=colour233,bg=colour19] %F #[fg=colour233,bg=colour8] %H:%M:%S %Z' + set -g status-right-length 50 + set -g status-left-length 20 -setw -g window-status-style 'fg=colour9 bg=colour18' -setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F ' + setw -g window-status-current-style 'fg=colour1 bg=colour19 bold' + setw -g window-status-current-format ' #I#[fg=colour249]:#[fg=colour255]#W#[fg=colour249]#F ' -setw -g window-status-bell-style 'fg=colour255 bg=colour1 bold' + setw -g window-status-style 'fg=colour9 bg=colour18' + setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F ' -# messages -set -g message-style 'fg=colour232 bg=colour16 bold' - "; + setw -g window-status-bell-style 'fg=colour255 bg=colour1 bold' + + # messages + set -g message-style 'fg=colour232 bg=colour16 bold' + ''; }; }; } diff --git a/config/profiles/desktop/default.nix b/config/users/kat/desktop.nix similarity index 98% rename from config/profiles/desktop/default.nix rename to config/users/kat/desktop.nix index f4a2d22e..f933a01d 100644 --- a/config/profiles/desktop/default.nix +++ b/config/users/kat/desktop.nix @@ -16,6 +16,7 @@ in { services.xserver.enable = true; services.xserver.displayManager.lightdm.enable = true; programs.light.enable = true; + services.tumbler.enable = true; home-manager.users.kat = { home.packages = [ @@ -27,7 +28,6 @@ in { pkgs.obs-studio pkgs.xfce.ristretto pkgs.avidemux - pkgs.gnome3.networkmanagerapplet pkgs.vlc pkgs.ffmpeg-full unstable.syncplay diff --git a/config/users/kat/kitty.nix b/config/users/kat/kitty.nix new file mode 100644 index 00000000..f213f9fd --- /dev/null +++ b/config/users/kat/kitty.nix @@ -0,0 +1,28 @@ +{ config, lib, pkgs, ... }: + +let style = import ./style.nix; in { + config = lib.mkIf (lib.elem "desktop" config.meta.deploy.profiles) { + + home-manager.users.kat = { + programs.kitty = { + enable = true; + font.name = style.font.name; + settings = { + font_size = style.font.size; + background = style.base16.color0; + background_opacity = "0.7"; + foreground = style.base16.color7; + selection_background = style.base16.color7; + selection_foreground = style.base16.color0; + url_color = style.base16.color3; + cursor = style.base16.color7; + active_border_color = "#75715e"; + active_tab_background = "#9900ff"; + active_tab_foreground = style.base16.color7; + inactive_tab_background = "#3a3a3a"; + inactive_tab_foreground = "#665577"; + } // style.base16; + }; + }; + }; +} diff --git a/config/users/kat/style.nix b/config/users/kat/style.nix new file mode 100644 index 00000000..bc836792 --- /dev/null +++ b/config/users/kat/style.nix @@ -0,0 +1,34 @@ +rec { + base16 = { + color0 = "#2e3440"; + color1 = "#bf616a"; + color2 = "#a3be8c"; + color3 = "#ebcb8b"; + color4 = "#81a1c1"; + color5 = "#b48ead"; + color6 = "#88c0d0"; + color7 = "#e5e9f0"; + + color8 = "#4c566a"; + color9 = "#d08770"; + color10 = "#3b4252"; + color11 = "#434c5e"; + color12 = "#d8dee9"; + color13 = "#eceff4"; + color14 = "#5e81ac"; + color15 = "#8fbcbb"; + + color16 = "#fd971f"; + color17 = "#cc6633"; + color18 = "#383830"; + color19 = "#49483e"; + color20 = "#a59f85"; + color21 = "#f5f4f1"; + }; + + font = { + name = "Hack Nerd Font"; + size = "10"; + size_css = "12px"; + }; +} diff --git a/config/profiles/sway/default.nix b/config/users/kat/sway.nix similarity index 60% rename from config/profiles/sway/default.nix rename to config/users/kat/sway.nix index e40b6ff7..439db403 100644 --- a/config/profiles/sway/default.nix +++ b/config/users/kat/sway.nix @@ -1,7 +1,8 @@ { config, pkgs, lib, ... }: -let colors = import ./colors.nix; -secrets = import ../../../secrets.nix; +let + style = import ./style.nix; + secrets = import ../../../secrets.nix; in { config = lib.mkIf (lib.elem "sway" config.meta.deploy.profiles) { fonts.fonts = with pkgs; [ @@ -10,8 +11,9 @@ in { iosevka emacs-all-the-icons-fonts ]; - users.users.kat.packages = with pkgs; [ grim slurp ]; + programs.sway.enable = true; + users.users.kat.packages = with pkgs; [ grim slurp ]; systemd.user.services.mako = { serviceConfig.ExecStart = "${pkgs.mako}/bin/mako"; @@ -19,43 +21,41 @@ in { [ config.home-manager.users.kat.xdg.configFile."mako/config".source ]; }; - services.tumbler.enable = true; - home-manager.users.kat = { programs.kitty = { enable = true; - font.name = "Hack Nerd Font"; + font.name = style.font.name; settings = { - font_size = "10.0"; - background = colors.black; + font_size = style.font.size; + background = style.base16.color0; background_opacity = "0.7"; - foreground = colors.white; - selection_background = colors.white; - selection_foreground = colors.black; - url_color = colors.yellow; - cursor = colors.white; + foreground = style.base16.color7; + selection_background = style.base16.color7; + selection_foreground = style.base16.color0; + url_color = style.base16.color3; + cursor = style.base16.color7; active_border_color = "#75715e"; active_tab_background = "#9900ff"; - active_tab_foreground = colors.white; + active_tab_foreground = style.base16.color7; inactive_tab_background = "#3a3a3a"; inactive_tab_foreground = "#665577"; - } // colors.base16; + } // style.base16; }; programs.mako = { enable = true; defaultTimeout = 3000; - borderColor = colors.white; - backgroundColor = "${colors.black}70"; - textColor = colors.white; + borderColor = style.base16.color7; + backgroundColor = "${style.base16.color0}70"; + textColor = style.base16.color7; }; wayland.windowManager.sway = { enable = true; config = let dmenu = - "${pkgs.bemenu}/bin/bemenu --fn 'Iosevka 12' --nb '${colors.black}' --nf '${colors.white}' --sb '${colors.red}' --sf '${colors.white}' -l 5 -m -1 -i"; - lockCommand = "swaylock -i ${./middle.jpg} -s fill"; + "${pkgs.bemenu}/bin/bemenu --fn 'Iosevka 12' --nb '${style.base16.color0}' --nf '${style.base16.color7}' --sb '${style.base16.color1}' --sf '${style.base16.color7}' -l 5 -m -1 -i"; + lockCommand = "swaylock -i ${./wallpapers/middle.jpg} -s fill"; cfg = config.home-manager.users.kat.wayland.windowManager.sway.config; in { bars = [{ command = "${pkgs.waybar}/bin/waybar"; }]; @@ -64,22 +64,22 @@ in { left = { res = "1920x1080"; pos = "0 0"; - bg = "${./left.jpg} fill"; + bg = "${./wallpapers/left.jpg} fill"; }; middle = { res = "1920x1080"; pos = "1920 0"; - bg = "${./middle.jpg} fill"; + bg = "${./wallpapers/middle.jpg} fill"; }; right = { res = "1920x1080"; pos = "3840 0"; - bg = "${./right.jpg} fill"; + bg = "${./wallpapers/right.jpg} fill"; }; laptop = { res = "1920x1080"; pos = "0 0"; - bg = "${./laptop.jpg} fill"; + bg = "${./wallpapers/laptop.jpg} fill"; }; in { "DP-1" = left; @@ -103,7 +103,7 @@ in { }; }; - fonts = [ "Hack Nerd Font 10" ]; + fonts = [ "${style.font.name} ${style.font.size}" ]; terminal = "${pkgs.kitty}/bin/kitty"; # TODO: replace with wofi menu = @@ -174,8 +174,6 @@ in { "exec pactl set-source-mute $(pacmd list-sources |awk '/* index:/{print $3}') toggle"; "XF86MonBrightnessDown" = "exec ${pkgs.light}/bin/light -U 5"; "XF86MonBrightnessUp" = "exec ${pkgs.light}/bin/light -A 5"; - "${cfg.modifier}+Print" = - "exec ${pkgs.bash}/bin/bash -c '~/.local/bin/elixiremanager.sh -w'"; "${cfg.modifier}+d" = "exec ${cfg.menu}"; "${cfg.modifier}+x" = "exec ${lockCommand}"; @@ -197,11 +195,6 @@ in { mode "System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown"''; }; - # keycodebindings = { - # "--no-repeat 107" = "exec dbus-send --session --type=method_call --dest=net.sourceforge.mumble.mumble / net.sourceforge.mumble.Mumble.startTalking"; - # "--release 107" = "exec dbus-send --session --type=method_call --dest=net.sourceforge.mumble.mumble / net.sourceforge.mumble.Mumble.stopTalking"; - # }; - modes = { "System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown" = { @@ -218,32 +211,32 @@ in { colors = { focused = { - border = colors.bright.black; - background = colors.base16.color4; - text = colors.black; - indicator = colors.green; - childBorder = colors.bright.black; + border = style.base16.color8; + background = style.base16.color4; + text = style.base16.color0; + indicator = style.base16.color2; + childBorder = style.base16.color8; }; focusedInactive = { - border = colors.base16.color0; - background = colors.base16.color11; - text = colors.base16.color12; - indicator = colors.green; - childBorder = colors.bright.black; + border = style.base16.color0; + background = style.base16.color11; + text = style.base16.color12; + indicator = style.base16.color2; + childBorder = style.base16.color8; }; unfocused = { - border = colors.base16.color0; - background = colors.base16.color8; - text = colors.base16.color12; - indicator = colors.bright.black; - childBorder = colors.bright.black; + border = style.base16.color0; + background = style.base16.color8; + text = style.base16.color12; + indicator = style.base16.color8; + childBorder = style.base16.color8; }; urgent = { - border = colors.bright.black; - background = colors.bright.red; - text = colors.black; - indicator = colors.red; - childBorder = colors.bright.black; + border = style.base16.color8; + background = style.base16.color9; + text = style.base16.color0; + indicator = style.base16.color1; + childBorder = style.base16.color8; }; }; }; @@ -253,69 +246,6 @@ in { ''; }; - programs.waybar = { - enable = true; - style = import ./waybar.css.nix { - inherit colors; - hextorgba = pkgs.colorhelpers.hextorgba; - }; - settings = [{ - modules-left = [ "sway/workspaces" "sway/mode" "sway/window" ]; - modules-center = [ "clock" ]; - modules-right = [ - "pulseaudio" - "network" - "custom/weather" - "cpu" - "memory" - "temperature" - "backlight" - "battery" - "tray" - ]; - - modules = { - "custom/weather" = { - format = "{}"; - interval = 3600; - exec = "nix-shell --command 'python ${../../../scripts/weather.py} ${secrets.profiles.sway.city} ${secrets.profiles.sway.api_key}' ${../../../scripts/weather.nix}"; - }; - cpu = { format = " {usage}%"; }; - memory = { format = " {percentage}%"; }; - temperature = { format = "﨎 {temperatureC}°C"; }; - backlight = { - format = "{icon} {percent}%"; - format-icons = [ "" "" ]; - on-scroll-up = "${pkgs.light}/bin/light -A 1"; - on-scroll-down = "${pkgs.light}/bin/light -U 1"; - }; - battery = { - states = { - good = 90; - warning = 30; - critical = 15; - }; - format = "{icon} {capacity}%"; - format-charging = " {capacity}%"; - format-plugged = " {capacity}%"; - format-alt = "{icon} {time}"; - format-icons = [ "" "" "" "" "" ]; - }; - pulseaudio = { - format = " {volume}%"; - on-click = "pavucontrol"; - }; - network = { - format-wifi = " {essid} ({signalStrength}%)"; - format-ethernet = " {ifname}: {ipaddr}/{cidr}"; - format-linked = " {ifname} (No IP)"; - format-disconnected = " Disconnected "; - format-alt = " {ifname}: {ipaddr}/{cidr}"; - }; - clock = { format = " {:%A, %F %T %Z}"; }; - }; - }]; - }; }; }; } diff --git a/config/profiles/sway/laptop.jpg b/config/users/kat/wallpapers/laptop.jpg similarity index 100% rename from config/profiles/sway/laptop.jpg rename to config/users/kat/wallpapers/laptop.jpg diff --git a/config/profiles/sway/left.jpg b/config/users/kat/wallpapers/left.jpg similarity index 100% rename from config/profiles/sway/left.jpg rename to config/users/kat/wallpapers/left.jpg diff --git a/config/profiles/sway/middle.jpg b/config/users/kat/wallpapers/middle.jpg similarity index 100% rename from config/profiles/sway/middle.jpg rename to config/users/kat/wallpapers/middle.jpg diff --git a/config/profiles/sway/right.jpg b/config/users/kat/wallpapers/right.jpg similarity index 100% rename from config/profiles/sway/right.jpg rename to config/users/kat/wallpapers/right.jpg diff --git a/config/users/kat/waybar.css.nix b/config/users/kat/waybar.css.nix new file mode 100644 index 00000000..1dee1a49 --- /dev/null +++ b/config/users/kat/waybar.css.nix @@ -0,0 +1,68 @@ +{ hextorgba, style }: + +'' + * { + border: none; + border-radius: 0; + font-family: "${style.font.name}"; + font-size: ${style.font.size_css}; + min-height: 14px + } + + #clock, #memory, #cpu, #temperature, #pulseaudio, #network, #mpd, #backlight, #battery, #custom-weather { + margin-left: 8px; + margin-right: 8px; + padding-left: 8px; + padding-right: 8px; + transition: none; + border-bottom: 2px solid ${style.base16.color7}; + color: ${style.base16.color7} + } + + window#waybar { background: ${hextorgba style.base16.color0} } + + #window { + color: ${style.base16.color7}; + padding-left: 16px; + padding-right: 16px + } + + #workspaces { padding: 0px 4px 0px 4px } + + #workspaces button { + color: ${style.base16.color7}; + background: ${hextorgba style.base16.color11}; + font-size: 16px; + margin: 0px 4px 0px 4px; + border-bottom: 2px solid transparent; + border-left: 1px solid ${style.base16.color7}; + border-right: 1px solid ${style.base16.color7} + } + + #workspaces button:last-child { margin-right: 0px } + + #workspaces button.focused { + color: ${style.base16.color5}; + border-bottom-color: ${style.base16.color5} + } + + #workspaces button:hover { + transition: none; + box-shadow: inherit; + text-shadow: inherit; + color: ${style.base16.color2}; + border-bottom-color: ${style.base16.color2} + } + + #mpd { border-color: #5af78e } + #mpd.disconnected, #mpd.stopped { border-color: #282a36 } + #network { border-color: ${style.base16.color3} } + #custom-weather { border-color: ${style.base16.color15} } + #pulseaudio { border-color: ${style.base16.color2} } + #temperature { border-color: ${style.base16.color4} } + #battery { border-color: ${style.base16.color6} } + #backlight { border-color: ${style.base16.color9} } + #cpu { border-color: ${style.base16.color5} } + #memory { border-color: ${style.base16.color17} } + #clock { border-color: ${style.base16.color7} } +'' diff --git a/config/users/kat/waybar.nix b/config/users/kat/waybar.nix new file mode 100644 index 00000000..f08be943 --- /dev/null +++ b/config/users/kat/waybar.nix @@ -0,0 +1,77 @@ +{ config, lib, pkgs, ... }: + +let + style = import ./style.nix; + secrets = import ../../../secrets.nix; +in { + config = lib.mkIf (lib.elem "sway" config.meta.deploy.profiles) { + home-manager.users.kat = { + programs.waybar = { + enable = true; + style = import ./waybar.css.nix { + inherit style; + hextorgba = pkgs.colorhelpers.hextorgba; + }; + settings = [{ + modules-left = [ "sway/workspaces" "sway/mode" "sway/window" ]; + modules-center = [ "clock" "custom/weather" ]; + modules-right = [ + "pulseaudio" + "network" + "cpu" + "memory" + "temperature" + "backlight" + "battery" + "tray" + ]; + + modules = { + "custom/weather" = { + format = "{}"; + interval = 3600; + exec = "nix-shell --command 'python ${ + ../../../scripts/weather.py + } ${secrets.profiles.sway.city} ${secrets.profiles.sway.api_key}' ${ + ../../../scripts/weather.nix + }"; + }; + cpu = { format = " {usage}%"; }; + memory = { format = " {percentage}%"; }; + temperature = { format = "﨎 {temperatureC}°C"; }; + backlight = { + format = "{icon} {percent}%"; + format-icons = [ "" "" ]; + on-scroll-up = "${pkgs.light}/bin/light -A 1"; + on-scroll-down = "${pkgs.light}/bin/light -U 1"; + }; + battery = { + states = { + good = 90; + warning = 30; + critical = 15; + }; + format = "{icon} {capacity}%"; + format-charging = " {capacity}%"; + format-plugged = " {capacity}%"; + format-alt = "{icon} {time}"; + format-icons = [ "" "" "" "" "" ]; + }; + pulseaudio = { + format = " {volume}%"; + on-click = "pavucontrol"; + }; + network = { + format-wifi = " {essid} ({signalStrength}%)"; + format-ethernet = " {ifname}: {ipaddr}/{cidr}"; + format-linked = " {ifname} (No IP)"; + format-disconnected = " Disconnected "; + format-alt = " {ifname}: {ipaddr}/{cidr}"; + }; + clock = { format = " {:%A, %F %T %Z}"; }; + }; + }]; + }; + }; + }; +} diff --git a/scripts/weather.nix b/scripts/weather.nix index 01ee3c61..82e708ec 100644 --- a/scripts/weather.nix +++ b/scripts/weather.nix @@ -1,13 +1,10 @@ -{ pkgs ? import {} }: +{ pkgs ? import { } }: with pkgs; mkShell { - buildInputs = [ - pkgs.python3 - pkgs.python3.pkgs.requests - ]; - shellHook = '' + buildInputs = [ pkgs.python3 pkgs.python3.pkgs.requests ]; + shellHook = '' # Tells pip to put packages into $PIP_PREFIX instead of the usual locations. # See https://pip.pypa.io/en/stable/user_guide/#environment-variables. export PIP_PREFIX=$(pwd)/_build/pip_packages