From 151180b02f25421a33b381dd5a6c00eda4d373c0 Mon Sep 17 00:00:00 2001 From: Lucy Hochkamp Date: Sat, 22 Feb 2025 12:22:23 +0100 Subject: [PATCH] meow --- hosts/ds9/containers.nix | 43 ++++- hosts/ds9/default.nix | 4 + hosts/theseus/default.nix | 2 + hosts/theseus/mako.nix | 30 +++ hosts/theseus/niri.nix | 39 ++++ hosts/theseus/river.nix | 35 ++-- hosts/theseus/waybar.nix | 381 ++++++++++++++++++++++++++++++++++++++ 7 files changed, 515 insertions(+), 19 deletions(-) create mode 100644 hosts/theseus/mako.nix create mode 100644 hosts/theseus/niri.nix create mode 100644 hosts/theseus/waybar.nix diff --git a/hosts/ds9/containers.nix b/hosts/ds9/containers.nix index 93ec129d..422556a3 100644 --- a/hosts/ds9/containers.nix +++ b/hosts/ds9/containers.nix @@ -214,14 +214,14 @@ in SEARCH_BACKEND_HOST_NAME = "archivebox_sonic"; SEARCH_BACKEND_PASSWORD = "SomeSecretPassword"; }; - extraOptions = [ "--network=archivebox-net" "--network=podman"]; + extraOptions = [ "--network=archivebox-net" "--network=podman" ]; volumes = [ "/data/media/archivebox:/data" ]; }; virtualisation.oci-containers.containers.archivebox_scheduler = { image = "archivebox/archivebox:latest"; - cmd = ["schedule" "--foreground" "--update" "--every=day"]; + cmd = [ "schedule" "--foreground" "--update" "--every=day" ]; environment = { TIMEOUT = "120"; ALLOWED_HOSTS = "*"; # set this to the hostname(s) you're going to serve the site from! @@ -233,7 +233,7 @@ in SEARCH_BACKEND_HOST_NAME = "archivebox_sonic"; SEARCH_BACKEND_PASSWORD = "SomeSecretPassword"; }; - extraOptions = [ "--network=archivebox-net" "--network=podman"]; + extraOptions = [ "--network=archivebox-net" "--network=podman" ]; volumes = [ "/data/media/archivebox:/data" ]; @@ -243,11 +243,46 @@ in environment = { SEARCH_BACKEND_PASSWORD = "SomeSecretPassword"; }; - extraOptions = [ "--network=archivebox-net"]; + extraOptions = [ "--network=archivebox-net" ]; volumes = [ "archivebox-sonic:/data" ]; }; + # printer + virtualisation.oci-containers.containers.labello = { + image = "telegnom/labello:latest"; + environment = { + LAB_PRINTER_DEVICE = "tcp://10.0.10.240:9100"; + LABELLO_DOWNLOAD_FONT = "yes"; + }; + extraOptions = [ "--network=podman" ]; + volumes = + let + fonts = pkgs.symlinkJoin { + name = "labello-fonts"; + paths = with pkgs; [ + # nerdfonts.override { fonts = ["b612"]} + noto-fonts + # noto-fonts-cjk-sans + noto-fonts-emoji + liberation_ttf + fira-code + fira-code-symbols + # dina-font + # proggyfonts + b612 + source-sans + source-serif + source-code-pro + corefonts + ]; + }; + in + [ + # "${fonts}:/opt/labelo/fonts" + # "/nix/store:/nix/store" + ]; + }; diff --git a/hosts/ds9/default.nix b/hosts/ds9/default.nix index 9beb70af..d0af41f7 100644 --- a/hosts/ds9/default.nix +++ b/hosts/ds9/default.nix @@ -197,6 +197,10 @@ in handle @node-red { import podmanRedir http://node-red:1880 } + @labello host labello.hailsatan.eu + handle @labello { + import podmanRedir http://labello:4242 + } # @bzzt-api host bzzt-api.hailsatan.eu diff --git a/hosts/theseus/default.nix b/hosts/theseus/default.nix index f7e05216..955c60f7 100644 --- a/hosts/theseus/default.nix +++ b/hosts/theseus/default.nix @@ -89,6 +89,8 @@ openFirewall = true; }; services.printing.enable = true; + services.printing.logLevel = "debug"; + diff --git a/hosts/theseus/mako.nix b/hosts/theseus/mako.nix new file mode 100644 index 00000000..1acf4f7b --- /dev/null +++ b/hosts/theseus/mako.nix @@ -0,0 +1,30 @@ +{ pkgs, config, lib, ... }: +let + cfg = config.xyno.desktop.mako; + makoConf = pkgs.writeText "mako.conf" '' + font=Source Sans Pro Nerd Font 11 + background-color=#1d2021ff + border-color=#3c3836FF + text-color=#ebdbb2ff + progress-color=over #928374FF + ''; +in +{ + options.xyno.desktop.mako.enable = lib.mkEnableOption "enable mako notification daemon"; + options.xyno.desktop.mako.wantedBy = lib.mkOption { + type = lib.types.str; + default = "niri.service"; + }; + options.xyno.desktop.mako.package = lib.mkOption { + type = lib.types.package; + default = pkgs.mako; + }; + config = lib.mkIf cfg.enable { + systemd.user.services.mako = { + wantedBy = [ cfg.wantedBy ]; + script = "${cfg.package}/bin/mako -c ${makoConf}"; + restartTrigers = makoConf; + }; + + }; +} diff --git a/hosts/theseus/niri.nix b/hosts/theseus/niri.nix new file mode 100644 index 00000000..08854a2d --- /dev/null +++ b/hosts/theseus/niri.nix @@ -0,0 +1,39 @@ +{ pkgs, config, lib, ... }: +let + floatingAppids = [ + "floating-alacritty" + "org.pulseaudio.pavucontrol" + "KeePassXC" + "org.gnome.NautilusPreviewer" + ]; + matchFloat = lib.concatStringSep "\n" (map (x: '' + window-rule { + match app-id="${x}" + open-floating true + open-focused true + } + '') floatingAppids); +in +{ + imports = [ + ./waybar.nix + ./mako.nix + ]; + xyno.desktop = { + waybar.enable = true; + mako.enable = true; + }; + programs.niri.enable = true; + environment.etc."niri/config.kdl".text = '' + screenshot-path "~/Pictures/screenshots/screenshot-%Y-%m-%d %H-%M-%S.png" + input { + workspace-auto-back-and-forth + focus-follows-mouse max-scroll-amount="10%" + touchpad { + tap + } + } + // autogenerated from here on + ${matchFloat} + ''; +} diff --git a/hosts/theseus/river.nix b/hosts/theseus/river.nix index 45db6887..b71bd198 100644 --- a/hosts/theseus/river.nix +++ b/hosts/theseus/river.nix @@ -26,7 +26,8 @@ in pwvucontrol # networkmanagerapplet mako - iwgtk + impala + # iwgtk libnotify ]; @@ -54,10 +55,11 @@ in qt = { enable = true; - platformTheme.name = "Adwaita-dark"; + # platformTheme.name = "Adwaita-dark"; + platformTheme.name = "Fusion"; style = { - name = "Adwaita-dark"; - package = pkgs.adwaita-qt; + name = "Fusion"; + # package = pkgs.adwaita-qt; }; }; @@ -333,7 +335,8 @@ label:focus { wireplumber = { "format" = "{icon} {volume}%"; "format-muted" = " MUTE"; - "on-click" = "${pkgs.pwvucontrol}/bin/pwvucontrol"; + # "on-click" = "${pkgs.pwvucontrol}/bin/pwvucontrol"; + "on-click" = "${pkgs.pavucontrol}/bin/pavucontrol"; "on-click-right" = "${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; "format-icons" = [ "" "" "" ]; }; @@ -401,16 +404,17 @@ label:focus { unit = "GB"; path = "/persistent"; }; - "custom/tailscale" = { - exec = pkgs.writeScript "tailscaleWaybar.sh" '' - #!${pkgs.bash}/bin/bash - TAILNET=$(${pkgs.tailscale}/bin/tailscale status --json | ${pkgs.jq}/bin/jq -j '.MagicDNSSuffix') + # "custom/tailscale" = { + # exec = pkgs.writeScript "tailscaleWaybar.sh" '' + # #!${pkgs.bash}/bin/bash + # TAILNET=$(${pkgs.tailscale}/bin/tailscale status --json | ${pkgs.jq}/bin/jq -j '.MagicDNSSuffix') - echo "''${''${TAILNET%.ts.net}:(-15)}" - ''; - interval = 30; - }; + # echo "''${''${TAILNET%.ts.net}:(-15)}" + # ''; + # interval = 30; + # }; "network" = { + "on-click" = "${pkgs.alacritty}/bin/alacritty --class floating-alacritty -e ${pkgs.impala}/bin/impala"; "format" = "{ifname}"; "format-wifi" = "󰖩 {essid}"; "format-ethernet" = "󰈀 {ifname}"; @@ -564,7 +568,8 @@ label:focus { spawn-tagmask = "4293918719"; # (( ((1 << 32) - 1) ^ (1 << 20) )) all but scratch tag rule-add = { "-title 'Picture-in-Picture'" = "float"; - "-app-id 'com.saivert.pwvucontrol'" = "float"; + "-app-id 'floating-alacritty'" = "float"; + "-app-id 'org.pulseaudio.pavucontrol'" = "float"; "-app-id 'KeePassXC'" = "float"; "-app-id 'org.gnome.NautilusPreviewer'" = "float"; "-app-id 'Signal'" = "tags ${tag 9}"; # signal @@ -587,7 +592,7 @@ label:focus { shikane & ${pkgs.mako}/bin/mako & # iwgtk likes to crash when restarting iwd - (while true; do iwgtk -i; sleep 10; done) & + # (while true; do iwgtk -i; sleep 10; done) & # now autostarting stuff thats always open anyways obsidian & signal-desktop & diff --git a/hosts/theseus/waybar.nix b/hosts/theseus/waybar.nix new file mode 100644 index 00000000..decfbcce --- /dev/null +++ b/hosts/theseus/waybar.nix @@ -0,0 +1,381 @@ +{ pkgs, config, lib, ... }: +let + cfg = config.xyno.desktop.waybar; + waybarConf = pkgs.writeText "waybar.conf" '' + font=Source Sans Pro Nerd Font + background-color=#1d2021ff + border-color=#3c3836FF + text-color=#ebdbb2ff + progress-color=over #928374FF + ''; +in +{ + options.xyno.desktop.waybar.enable = lib.mkEnableOption "enable mako notification daemon"; + options.xyno.desktop.waybar.wantedBy = lib.mkOption { + type = lib.types.str; + default = "niri.service"; + }; + options.xyno.desktop.waybar.package = lib.mkOption { + type = lib.types.package; + default = pkgs.waybar; + }; + options.xyno.desktop.waybar.mode = lib.mkOption { + type = lib.types.str; + default = "niri"; + }; + config = lib.mkIf cfg.enable { + programs.waybar.enable = true; + environment.etc."xdg/waybar/config".text = builtins.toJSON { + mainBar = { + layer = "top"; + position = "top"; + height = 15; + modules-left = (lib.mkIf (cfg.mode == "river") [ "river/tags" "river/layout" "river/window" ]) + ++ (lib.mkIf (cfg.mode == "niri") [ "niri/workspaces" "niri/window" ]); + modules-right = [ "tray" "power_profiles_daemon" "idle_inhibitor" "wireplumber" "battery" "backlight" "cpu" "temperature" "memory" "disk" "custom/tailscale" "network" "clock" ]; + "river/window" = { + max-length = 40; + }; + wireplumber = { + "format" = "{icon} {volume}%"; + "format-muted" = " MUTE"; + # "on-click" = "${pkgs.pwvucontrol}/bin/pwvucontrol"; + "on-click" = "${pkgs.pavucontrol}/bin/pavucontrol"; + "on-click-right" = "${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; + "format-icons" = [ "" "" "" ]; + }; + "backlight" = { + "device" = "amdgpu_bl1"; + "format" = "{icon} {percent}%"; + "format-icons" = [ "󰃚" "󰃛" "󰃜" "󰃝" "󰃞" "󰃟" "󰃠" ]; + "on-scroll-up" = "${pkgs.brightnessctl}/bin/brightnessctl s +10"; + "on-scroll-down" = "${pkgs.brightnessctl}/bin/brightnessctl s 10-"; + }; + "idle_inhibitor" = { + format = "{icon} "; + format-icons = { + "activated" = "󰅶"; + "deactivated" = "󰾪"; + }; + }; + battery = { + "states" = { + "warning" = 30; + "critical" = 15; + }; + "format" = "{icon} {capacity}%"; + "format-icons" = [ "" "" "" "" "" ]; + "tooltip-format" = "Capacity: {capacity}%\nPower Draw: {power:0.2f}W\n{timeTo}\nCycles: {cycles}"; + "max-length" = 25; + }; + "cpu" = { + "interval" = 10; + "format" = " {:0.0f}%"; + "max-length" = 10; + }; + "temperature" = { + "format" = " {temperatureC}°C"; + }; + memory = { + interval = 30; + format = " {used:0.0f}/{total:0.0f}GB"; + }; + clock = { + interval = 1; + format = "{:%Y-%m-%dT%H:%M:%S%z}"; + "tooltip-format" = "{calendar}"; + "calendar" = { + "mode" = "year"; + "mode-mon-col" = 3; + "weeks-pos" = "right"; + "on-scroll" = 1; + "format" = { + "months" = "{}"; + "days" = "{}"; + "weeks" = "W{}"; + "weekdays" = "{}"; + "today" = "{}"; + }; + }; + "actions" = { + "on-click-right" = "mode"; + "on-scroll-up" = "shift_up"; + "on-scroll-down" = "shift_down"; + }; + }; + disk = { + format = "󰋊 {specific_used:0.0f}/{specific_total:0.0f}GB"; + unit = "GB"; + path = "/persistent"; + }; + "network" = { + "on-click" = "${pkgs.alacritty}/bin/alacritty --class floating-alacritty -e ${pkgs.impala}/bin/impala"; + "format" = "{ifname}"; + "format-wifi" = "󰖩 {essid}"; + "format-ethernet" = "󰈀 {ifname}"; + "format-disconnected" = "󰖪"; + "tooltip-format" = "{ifname} via {gwaddr}\n{ipaddr}/{cidr}"; + "tooltip-format-wifi" = "{essid} ({signaldBm} dBm) {frequency} GHz\n{ipaddr}/{cidr}"; + "tooltip-format-ethernet" = "{ifname}\n{ipaddr}/{cidr}"; + "tooltip-format-disconnected" = "Disconnected"; + "max-length" = 50; + }; + }; + }; + environment.etc."xdg/waybar/style.css".text = '' + * { + /* `otf-font-awesome` is required to be installed for icons */ + font-family: "Source Sans Pro Nerd Font"; + font-size: 12px; + } + + window#waybar { + /* background-color: rgba(43, 48, 59, 0.5); + border-bottom: 3px solid rgba(100, 114, 125, 0.5);*/ + color: #a89984; + background-color: #1d2021; + /* transition-property: background-color; + transition-duration: .5s;*/ + } + + window#waybar.hidden { + opacity: 0.2; + } + + /* + window#waybar.empty { + background-color: transparent; + } + window#waybar.solo { + background-color: #FFFFFF; + } + */ + + /*window#waybar.termite { + background-color: #3F3F3F; + } + + window#waybar.chromium { + background-color: #000000; + border: none; + }*/ + + #tags button { + padding: 0 2px; + background-color: #1d2021; + color: #ebdbb2; + /* Use box-shadow instead of border so the text isn't offset */ + box-shadow: inset 0 -3px transparent; + /* Avoid rounded borders under each workspace name */ + border: none; + border-radius: 0; + } + + /* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ + #tags button:hover { + background: rgba(0, 0, 0, 0.2); + /* box-shadow: inset 0 -3px #fbf1c7; + */ + background-color: #3c3836; + } + + #tags button.focused { + /* box-shadow: inset 0 -3px #fbf1c7; + */ + background-color: #3c3836; + color: #ebdbb2; + } + + #tags button.occupied { + color: #d3869b; + } + #tags button.urgent { + background-color: #cc241d; + color: #ebdbb2; + } + + #mode { + background-color: #64727D; + border-bottom: 3px solid #fbf1c7; + } + + #clock, + #battery, + #cpu, + #memory, + #disk, + #temperature, + #backlight, + #network, + #pulseaudio, + #custom-media, + #tray, + #mode, + #idle_inhibitor, + #custom-poweroff, + #custom-suspend, + #mpd { + padding: 0 2px; + background-color: #1d2021; + color: #ebdbb2; + } + + #window, + #workspaces, + #tags { + margin: 0 2px; + } + + /* If workspaces is the leftmost module, omit left margin */ + .modules-left > widget:first-child > #workspaces { + margin-left: 0; + } + + /* If workspaces is the rightmost module, omit right margin */ + .modules-right > widget:last-child > #workspaces { + margin-right: 0; + } + + + #battery { + color: #d3869b; + } + + #battery.charging, #battery.plugged { + color: #98971a; + } + + @keyframes blink { + to { + background-color: #fbf1c7; + color: #df3f71; + } + } + + #battery.critical:not(.charging) { + background-color: #1d2021; + color: #d3869b; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; + } + + label:focus { + background-color: #000000; + } + + #backlight { + color: #458588; + } + + #temperature { + color: #fabd2f; + } + + #temperature.critical { + background-color: #fbf1c7; + color: #b57614; + } + + #memory { + color: #FCF434; /* enby yellow */ + } + #disk { + color: #FFFFFF; /* enby white */ + } + #network { + color: #b8bb26; /* enby green */ + } + #clock { + color: #9C59D1; /* enby purple */ + /*color: #2C2C2C; enby black */ + } + + + #network.disconnected { + background-color: #fbf1c7; + color: #9d0006; + } + + + #wireplumber { + color: #fe8019; + } + + #tray { + } + + #tray > .needs-attention { + background-color: #fbf1c7; + color: #3c3836; + } + + #idle_inhibitor { + background-color: #1d2021; + color: #ebdbb2; + } + + #idle_inhibitor.activated { + background-color: #fbf1c7; + color: #3c3836; + } + + #custom-media { + background-color: #66cc99; + color: #2a5c45; + min-width: 100px; + } + + #custom-media.custom-spotify { + background-color: #66cc99; + } + + #custom-media.custom-vlc { + background-color: #ffa000; + } + + #mpd { + background-color: #66cc99; + color: #2a5c45; + } + + #mpd.disconnected { + background-color: #f53c3c; + } + + #mpd.stopped { + background-color: #90b1b1; + } + + #mpd.paused { + background-color: #51a37a; + } + + #language { + background: #00b093; + color: #740864; + padding: 0 5px; + margin: 0 5px; + min-width: 16px; + } + + #keyboard-state { + background: #97e1ad; + color: #000000; + padding: 0 0px; + margin: 0 5px; + min-width: 16px; + } + + #keyboard-state > label { + padding: 0 5px; + } + + #keyboard-state > label.locked { + background: rgba(0, 0, 0, 0.2); + } + ''; + }; +}