diff --git a/flake.lock b/flake.lock index 29dc015..6771af6 100644 --- a/flake.lock +++ b/flake.lock @@ -65,11 +65,11 @@ ] }, "locked": { - "lastModified": 1758287904, - "narHash": "sha256-IGmaEf3Do8o5Cwp1kXBN1wQmZwQN3NLfq5t4nHtVtcU=", + "lastModified": 1760701190, + "narHash": "sha256-y7UhnWlER8r776JsySqsbTUh2Txf7K30smfHlqdaIQw=", "owner": "nix-community", "repo": "disko", - "rev": "67ff9807dd148e704baadbd4fd783b54282ca627", + "rev": "3a9450b26e69dcb6f8de6e2b07b3fc1c288d85f5", "type": "github" }, "original": { @@ -243,11 +243,11 @@ ] }, "locked": { - "lastModified": 1756047880, - "narHash": "sha256-JeuGh9kA1SPL70fnvpLxkIkCWpTjtoPaus3jzvdna0k=", + "lastModified": 1759991118, + "narHash": "sha256-pDyrtUQyeP1lVTMIYqJtftzDtsXEZaJjYy9ZQ/SGhL8=", "owner": "nix-community", "repo": "gomod2nix", - "rev": "47d628dc3b506bd28632e47280c6b89d3496909d", + "rev": "7f8d7438f5870eb167abaf2c39eea3d2302019d1", "type": "github" }, "original": { @@ -386,11 +386,11 @@ ] }, "locked": { - "lastModified": 1759523803, - "narHash": "sha256-PTod9NG+i3XbbnBKMl/e5uHDBYpwIWivQ3gOWSEuIEM=", + "lastModified": 1760663237, + "narHash": "sha256-BflA6U4AM1bzuRMR8QqzPXqh8sWVCNDzOdsxXEguJIc=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "cfc9f7bb163ad8542029d303e599c0f7eee09835", + "rev": "ca5b894d3e3e151ffc1db040b6ce4dcc75d31c37", "type": "github" }, "original": { @@ -402,11 +402,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1759582739, - "narHash": "sha256-spZegilADH0q5OngM86u6NmXxduCNv5eX9vCiUPhOYc=", + "lastModified": 1760958188, + "narHash": "sha256-2m1S4jl+GEDtlt2QqeHil8Ny456dcGSKJAM7q3j/BFU=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "3441b5242af7577230a78ffb03542add264179ab", + "rev": "d6645c340ef7d821602fd2cd199e8d1eed10afbc", "type": "github" }, "original": { @@ -418,11 +418,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1759580034, - "narHash": "sha256-YWo57PL7mGZU7D4WeKFMiW4ex/O6ZolUS6UNBHTZfkI=", + "lastModified": 1761468971, + "narHash": "sha256-vY2OLVg5ZTobdroQKQQSipSIkHlxOTrIF1fsMzPh8w8=", "owner": "nixos", "repo": "nixpkgs", - "rev": "3bcc93c5f7a4b30335d31f21e2f1281cba68c318", + "rev": "78e34d1667d32d8a0ffc3eba4591ff256e80576e", "type": "github" }, "original": { @@ -450,11 +450,11 @@ }, "nixpkgsMaster": { "locked": { - "lastModified": 1759699079, - "narHash": "sha256-Fvh/nZ7x/msSPPPJXfEoCqgW9NIUQLSCJCCLr8bVMos=", + "lastModified": 1761601585, + "narHash": "sha256-rIne9pcxSoaLCxcyICguhH3SUzE9lep464L7zRGBbZk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f0a05ce889294b1c1e02377b086b9931554f5bf3", + "rev": "8865b77677eb576ce1dbcb90b7a1ae95a774a6cd", "type": "github" }, "original": { @@ -482,11 +482,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1759381078, - "narHash": "sha256-gTrEEp5gEspIcCOx9PD8kMaF1iEmfBcTbO0Jag2QhQs=", + "lastModified": 1761373498, + "narHash": "sha256-Q/uhWNvd7V7k1H1ZPMy/vkx3F8C13ZcdrKjO7Jv7v0c=", "owner": "nixos", "repo": "nixpkgs", - "rev": "7df7ff7d8e00218376575f0acdcc5d66741351ee", + "rev": "6a08e6bb4e46ff7fcbb53d409b253f6bad8a28ce", "type": "github" }, "original": { @@ -518,11 +518,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1759696599, - "narHash": "sha256-GkGJdNkR9gnVQt9OXwhGrD72EpK185jNVT7qoCh/3q4=", + "lastModified": 1761601325, + "narHash": "sha256-0UtnyehKLys0HWhctZEjKN7zDe+ML0HCDdqdfHk221o=", "owner": "nix-community", "repo": "NUR", - "rev": "dce08ba6904fcaad93c17ab65cf6b3e5dfc2d301", + "rev": "378c5c7b0b2471b59b71e42b229ea5e68050235d", "type": "github" }, "original": { @@ -634,11 +634,11 @@ ] }, "locked": { - "lastModified": 1759635238, - "narHash": "sha256-UvzKi02LMFP74csFfwLPAZ0mrE7k6EiYaKecplyX9Qk=", + "lastModified": 1760998189, + "narHash": "sha256-ee2e1/AeGL5X8oy/HXsZQvZnae6XfEVdstGopKucYLY=", "owner": "Mic92", "repo": "sops-nix", - "rev": "6e5a38e08a2c31ae687504196a230ae00ea95133", + "rev": "5a7d18b5c55642df5c432aadb757140edfeb70b3", "type": "github" }, "original": { @@ -729,11 +729,11 @@ "treefmt-nix": "treefmt-nix_2" }, "locked": { - "lastModified": 1759670864, - "narHash": "sha256-v7P+2TVd0ZU6LFlBM0hg75bSRvnneefJZJ+AmzCf4Uk=", + "lastModified": 1760697314, + "narHash": "sha256-+vk8SRGknwg5Q8y/R4oHkiLxe2SDQDYGj8jK7Xaeu6c=", "owner": "vedderb", "repo": "vesc_tool", - "rev": "1f32af09ac21bd2bbb2e3a8b4148d1892636f8d9", + "rev": "8a6de0dda75e62681e7252a1512f34a5f4e70640", "type": "github" }, "original": { diff --git a/hosts/iron/configuration.nix b/hosts/iron/configuration.nix index cdf307b..57a422a 100644 --- a/hosts/iron/configuration.nix +++ b/hosts/iron/configuration.nix @@ -218,7 +218,15 @@ with lib; { }; }; - hardware.enableRedistributableFirmware = true; + hardware = { + enableRedistributableFirmware = true; + graphics = { + enable = true; + extraPackages = [ + pkgs.intel-vaapi-driver + ]; + }; + }; virtualisation.containers.storage.settings = { storage = { diff --git a/hosts/iron/services/jellyfin/broflix.svg b/hosts/iron/services/jellyfin/broflix.svg new file mode 100644 index 0000000..7653de9 --- /dev/null +++ b/hosts/iron/services/jellyfin/broflix.svg @@ -0,0 +1,57 @@ + + + + + + + + + unrar and chill + + diff --git a/hosts/iron/services/jellyfin/default.nix b/hosts/iron/services/jellyfin/default.nix index 1da1106..eb4e918 100644 --- a/hosts/iron/services/jellyfin/default.nix +++ b/hosts/iron/services/jellyfin/default.nix @@ -1,6 +1,20 @@ -{ config, lib, ... }: +{ config, lib, pkgs, ... }: let inherit (config.networking) ports; + logoPng = pkgs.stdenvNoCC.mkDerivation { + name = "broflix.png"; + src = ./broflix.svg; + dontBuild = true; + dontUnpack = true; + installPhase = '' + export PATH="$PATH:${pkgs.lib.makeBinPath [pkgs.imagemagick]}" + convert \ + -background transparent \ + $src \ + -resize 1302x \ + $out + ''; + }; in { imports = [ @@ -10,10 +24,12 @@ in services.jellyfin = { enable = true; }; + systemd.services.jellyfin = { serviceConfig = { ###MemoryDenyWriteExecute = true; BindPaths = [ + "/dev/dri/renderD128" "/var/cache/jellyfin" "/var/lib/jellyfin" ]; @@ -24,13 +40,15 @@ in "/filebitch/pub/Filme" "/filebitch/pub/Serien" "/nix/store" + "/run/opengl-driver" "/var/lib/qBittorrent/downloads" ]; CapabilityBoundingSet = ""; + DeviceAllow = "/dev/dri/renderD128 rw"; #IPAddressAllow = "localhost"; #IPAddressDeny = "any"; LockPersonality = true; - PrivateDevices = lib.mkForce true; + PrivateDevices = false; PrivateUsers = true; ProtectClock = true; ProtectControlGroups = true; @@ -76,6 +94,15 @@ in proxy_set_header X-Forwarded-Host $http_host; proxy_buffering off; } + location = /web/broflix.svg { + alias ${./broflix.svg}; + } + location = /web/assets/img/banner-light.png { + alias ${logoPng}; + } + location = /web/assets/img/banner-dark.png { + alias ${logoPng}; + } location = /web/ { proxy_pass http://127.0.0.1:${toString ports.jellyfin.tcp}/web/index.html; proxy_set_header Host $host; diff --git a/hosts/iron/services/snapcast/alsa.nix b/hosts/iron/services/snapcast/alsa.nix deleted file mode 100644 index 1b8566e..0000000 --- a/hosts/iron/services/snapcast/alsa.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - boot.kernelModules = [ "snd-aloop" ]; - boot.extraModprobeConfig = '' - options snd-aloop id=ledfx,bluetooth enable=1,1 pcm_substreams=2,2 - ''; -} diff --git a/hosts/iron/services/snapcast/bluetooth-sink.nix b/hosts/iron/services/snapcast/bluetooth-sink.nix index 38cf8e3..43db142 100644 --- a/hosts/iron/services/snapcast/bluetooth-sink.nix +++ b/hosts/iron/services/snapcast/bluetooth-sink.nix @@ -1,7 +1,11 @@ { pkgs, ... }: { environment.systemPackages = with pkgs; [ - bluez-alsa + #bluez-alsa + bluez + bluez-tools + pipewire + wireplumber ]; hardware.bluetooth = { @@ -18,11 +22,17 @@ FastConnectable = "true"; # Allow repairing of existing devices JustWorksRepairing = "always"; + # to show battery state + Experimental = true; }; }; }; - services.blueman.enable = true; + services = { + blueman.enable = true; + ofono.enable = true; + upower.enable = true; + }; systemd.services = { bluetooth-auto-pair = { @@ -45,7 +55,8 @@ Restart = "on-failure"; }; }; - bluealsa-aplay = { + /* + bluealsa-aplay = { wantedBy = [ "multi-user.target" ]; serviceConfig = { DynamicUser = true; @@ -54,14 +65,15 @@ Restart = "on-failure"; SupplementaryGroups = [ "audio" ]; }; - }; - bluealsa-a2dp = { + }; + bluealsa-a2dp = { wantedBy = [ "multi-user.target" ]; serviceConfig = { Type = "simple"; ExecStart = "${pkgs.bluez-alsa}/bin/bluealsa -p a2dp-sink"; Restart = "on-failure"; }; - }; + }; + */ }; } diff --git a/hosts/iron/services/snapcast/default.nix b/hosts/iron/services/snapcast/default.nix index 803531e..496bb63 100644 --- a/hosts/iron/services/snapcast/default.nix +++ b/hosts/iron/services/snapcast/default.nix @@ -1,10 +1,23 @@ +{ pkgs, ... }: + { imports = [ - ./alsa.nix ./bluetooth-sink.nix ./ledfx.nix ./mopidy.nix ./snapclient.nix ./snapserver.nix ]; + + services.pipewire = { + enable = true; + systemWide = true; + audio.enable = true; + pulse.enable = true; + alsa.enable = true; + }; + + environment.systemPackages = [ pkgs.pulseaudio ]; + + users.users.jalr.extraGroups = [ "pipewire" ]; } diff --git a/hosts/iron/services/snapcast/ledfx.nix b/hosts/iron/services/snapcast/ledfx.nix index 4a4a3d6..d7db19d 100644 --- a/hosts/iron/services/snapcast/ledfx.nix +++ b/hosts/iron/services/snapcast/ledfx.nix @@ -7,6 +7,29 @@ in 8888 ]; + + services.pipewire.extraConfig.pipewire."10-ledfx-loop" = { + "context.modules" = [ + { + name = "libpipewire-module-loopback"; + args = { + "audio.position" = [ "FL,FR" ]; + "capture.props" = { + "media.class" = "Audio/Sink"; + "node.name" = "ledfx.input"; + "node.description" = "ledfx capture"; + }; + "playback.props" = { + "media.class" = "Audio/Source"; + "node.name" = "ledfx.output"; + "node.passive" = true; + }; + }; + } + ]; + }; + + systemd.services.snapclient-ledfx = { enable = true; description = "Snapcast client"; @@ -15,8 +38,8 @@ in wantedBy = [ "multi-user.target" ]; serviceConfig = { DynamicUser = "yes"; - ExecStart = "${pkgs.snapcast}/bin/snapclient --host 127.0.0.1 --hostID ledfx -i 2 --player alsa -s ledfx"; - Group = "audio"; + ExecStart = "${pkgs.snapcast}/bin/snapclient --host 127.0.0.1 --hostID ledfx -i 2 --player pulse -s ledfx.input"; + Group = "pipewire"; NoNewPrivileges = true; ProtectControlGroups = true; ProtectHome = true; @@ -37,7 +60,7 @@ in serviceConfig = { DynamicUser = "yes"; ExecStart = "${pkgs.ledfx}/bin/ledfx --host 0.0.0.0 -p 8888 -c %S/ledfx"; - Group = "audio"; + Group = "pipewire"; NoNewPrivileges = true; ProtectControlGroups = true; ProtectHome = true; diff --git a/hosts/iron/services/snapcast/snapclient.nix b/hosts/iron/services/snapcast/snapclient.nix index 27bb202..b0c4687 100644 --- a/hosts/iron/services/snapcast/snapclient.nix +++ b/hosts/iron/services/snapcast/snapclient.nix @@ -7,10 +7,11 @@ wants = [ "network.target" "sound.target" ]; after = [ "network.target" "sound.target" ]; wantedBy = [ "multi-user.target" ]; + environment.PULSE_SERVER = "unix:/run/pulse/native"; serviceConfig = { DynamicUser = "yes"; - ExecStart = "${pkgs.snapcast}/bin/snapclient --host 127.0.0.1 -s DAC"; - Group = "audio"; + ExecStart = "${pkgs.snapcast}/bin/snapclient --host 127.0.0.1 --player pulse -s alsa_output.usb-Burr-Brown_from_TI_USB_Audio_DAC-00.analog-stereo"; + Group = "pipewire"; NoNewPrivileges = true; ProtectControlGroups = true; ProtectHome = true; diff --git a/pkgs/pomodoro-timer/default.nix b/pkgs/pomodoro-timer/default.nix index 4af648b..a3638f8 100644 --- a/pkgs/pomodoro-timer/default.nix +++ b/pkgs/pomodoro-timer/default.nix @@ -2,7 +2,6 @@ , stdenv , yad , uair -, gnused , writeShellScript , makeDesktopItem , imagemagick @@ -10,7 +9,7 @@ let pomodoroTimer = writeShellScript "pomodoro-timer" '' - export PATH=${lib.makeBinPath [yad uair gnused]} + export PATH=${lib.makeBinPath [yad uair]} uairctl listen -o yad \ | yad \ --title="Pomodoro" \ diff --git a/users/jalr/modules/default.nix b/users/jalr/modules/default.nix index 30ed808..f97916b 100644 --- a/users/jalr/modules/default.nix +++ b/users/jalr/modules/default.nix @@ -14,6 +14,7 @@ ./firefox ./fish.nix ./fpv.nix + ./freetube.nix ./git.nix ./gnuradio.nix ./graphics @@ -21,6 +22,7 @@ ./jameica.nix ./kicad.nix ./lsd + ./mixxc ./mpv.nix ./mute-indicator.nix ./mycli diff --git a/users/jalr/modules/freetube.nix b/users/jalr/modules/freetube.nix new file mode 100644 index 0000000..3c45d96 --- /dev/null +++ b/users/jalr/modules/freetube.nix @@ -0,0 +1,7 @@ +{ nixosConfig, ... }: + +{ + programs.freetube = { + inherit (nixosConfig.jalr.gui) enable; + }; +} diff --git a/users/jalr/modules/jameica.nix b/users/jalr/modules/jameica.nix index d9472e0..e50c86e 100644 --- a/users/jalr/modules/jameica.nix +++ b/users/jalr/modules/jameica.nix @@ -1,6 +1,16 @@ { nixosConfig, lib, pkgs, ... }: lib.mkIf nixosConfig.jalr.gui.enable { - home.packages = with pkgs; [ - jameica + home.packages = [ + ( + pkgs.jameica.overrideAttrs (_: { + version = "2.11.0-nightly"; + src = pkgs.fetchFromGitHub { + owner = "willuhn"; + repo = "jameica"; + rev = "e51bffc0e42907cbd802a644ab52810e0a36fff8"; + hash = "sha256-0KcT52dh/tJSX6q+uKkRybz33jKnYRTNDo1BftwJLAc="; + }; + }) + ) ]; } diff --git a/users/jalr/modules/mixxc/default.nix b/users/jalr/modules/mixxc/default.nix new file mode 100644 index 0000000..efde8d1 --- /dev/null +++ b/users/jalr/modules/mixxc/default.nix @@ -0,0 +1,10 @@ +{ nixosConfig, lib, pkgs, ... }: + +lib.mkIf nixosConfig.jalr.gui.enable { + home.packages = with pkgs; [ + mixxc + ]; + xdg.configFile = { + "mixxc/style.css".source = ./style.css; + }; +} diff --git a/users/jalr/modules/mixxc/style.css b/users/jalr/modules/mixxc/style.css new file mode 100644 index 0000000..33dbf39 --- /dev/null +++ b/users/jalr/modules/mixxc/style.css @@ -0,0 +1,224 @@ +.side { + $hide: false; + + .output { + transition: background 750ms; + padding: 5px; + + &.master { + transition: background 0ms; + } + + &.master:hover { + } + + .icon { + -gtk-icon-style: symbolic; + -gtk-icon-size: 16px; + } + } + + @if $hide { + min-height: 0; + min-width: 0; + + .output { + padding: 0; + + .icon { + -gtk-icon-style: symbolic; + -gtk-icon-size: 0; + } + } + } +} + +.main { + margin: 20px; +} + +.client { + $hide-name: false; + $hide-description: false; + + font-family: 'Iosevka Nerd Font'; + font-size: 1.2em; + + .icon { + -gtk-icon-style: symbolic; + } + + @if $hide-name { + .name { + font-size: 0; + } + } + + @if $hide-description { + .description { + font-size: 0; + } + } + + scale { + trough { + /* Slider Bar */ + border-radius: 10px; + + slider { + /* Slider Knob */ + padding: 0; + + border: none; + border-radius: 2px; + + transition-duration: 400ms; + } + + highlight { + /* Slider Bar Filled */ + border: none; + border-radius: 10px; + + margin: 2px; + + transition: background-image 300ms; + } + + fill { + /* Slider Peak */ + background: none; + + border-radius: 10px; + + margin: 0px; + } + } + } + + scale:active { + trough slider { + /* Slider Knob */ + transform: scale(1.1); + } + } +} + +.client.horizontal { + &.new { + animation: client-add-horizontal 300ms ease; + } + + &.removed { + animation: client-remove-horizontal 300ms ease; + } + + .icon { + padding-right: 13px; + + -gtk-icon-size: 16px; + } + + .volume { + /* Numeric Volume Level */ + padding-left: 22px; + padding-bottom: 3px; + } + + scale { + trough { + /* Slider Bar */ + min-height: 6px; + + slider { + /* Slider Knob */ + min-height: 21px; + min-width: 9px; + + margin-top: -7px; + margin-bottom: -7px; + } + } + } + +} + +@keyframes client-add-horizontal { + from { + transform: translateX(-200px); + opacity: 0; + } + to { + opacity: 1; + } +} + +@keyframes client-remove-horizontal { + from { + opacity: 1; + } + to { + transform: translateX(-200px); + opacity: 0; + } +} + +.client.vertical { + &.new { + animation: client-add-vertical 300ms ease; + } + + &.removed { + animation: client-remove-vertical 300ms ease; + } + + .icon { + padding-bottom: 5px; + + -gtk-icon-size: 20px; + } + + .volume { + /* Numeric Volume Level */ + padding-top: 10px; + } + + scale { + trough { + /* Slider Bar */ + min-width: 4px; + + margin-top: 10px; + + slider { + /* Slider Knob */ + margin-left: -7px; + margin-right: -7px; + + min-height: 6px; + min-width: 14px; + } + } + } +} + +@keyframes client-add-vertical { + from { + transform: translateY(200px); + opacity: 0; + } + to { + opacity: 1; + } +} + +@keyframes client-remove-vertical { + from { + opacity: 1; + } + to { + transform: translateY(200px); + opacity: 0; + } +} + diff --git a/users/jalr/modules/mycli/default.nix b/users/jalr/modules/mycli/default.nix index e023039..844102b 100644 --- a/users/jalr/modules/mycli/default.nix +++ b/users/jalr/modules/mycli/default.nix @@ -105,39 +105,43 @@ let }; }; - colors = { - common = { - "output.header" = "bold ${solarized.green.hex}"; - "sql.datatype" = "nobold ${solarized.yellow.hex}"; - "sql.function" = "bold ${solarized.violet.hex}"; - "sql.keyword" = solarized.green.hex; - "sql.literal" = solarized.green.hex; - "sql.number" = solarized.cyan.hex; - "sql.string" = solarized.cyan.hex; - "sql.variable" = solarized.red.hex; - "sql.quoted-schema-object" = solarized.blue.hex; + colors = + let + c = solarized.colors; + in + { + common = { + "output.header" = "bold ${c.green}"; + "sql.datatype" = "nobold ${c.yellow}"; + "sql.function" = "bold ${c.violet}"; + "sql.keyword" = c.green; + "sql.literal" = c.green; + "sql.number" = c.cyan; + "sql.string" = c.cyan; + "sql.variable" = c.red; + "sql.quoted-schema-object" = c.blue; + }; + light = { + "prompt" = "bg:${c.blue} ${c.base02}"; + "selected" = "bg:${c.base2} ${c.base00}"; + "output.odd-row" = "${c.base01}"; + "output.even-row" = "${c.base01} bg:${c.base2}"; + "sql.comment" = "italic ${c.base1}"; + "sql.operator" = "bold ${c.base02}"; + "sql.punctuation" = "bold ${c.base01}"; + "sql.symbol" = "${c.base01}"; + }; + dark = { + "prompt" = "bg:${c.blue} ${c.base2}"; + "selected" = "bg:${c.base02} ${c.base0}"; + "output.odd-row" = "${c.base1}"; + "output.even-row" = "${c.base1} bg:${c.base02}"; + "sql.comment" = "italic ${c.base01}"; + "sql.operator" = "bold ${c.base2}"; + "sql.punctuation" = "bold ${c.base1}"; + "sql.symbol" = "${c.base1}"; + }; }; - light = { - "prompt" = "bg:${solarized.blue.hex} ${solarized.base02.hex}"; - "selected" = "bg:${solarized.base2.hex} ${solarized.base00.hex}"; - "output.odd-row" = "${solarized.base01.hex}"; - "output.even-row" = "${solarized.base01.hex} bg:${solarized.base2.hex}"; - "sql.comment" = "italic ${solarized.base1.hex}"; - "sql.operator" = "bold ${solarized.base02.hex}"; - "sql.punctuation" = "bold ${solarized.base01.hex}"; - "sql.symbol" = "${solarized.base01.hex}"; - }; - dark = { - "prompt" = "bg:${solarized.blue.hex} ${solarized.base2.hex}"; - "selected" = "bg:${solarized.base02.hex} ${solarized.base0.hex}"; - "output.odd-row" = "${solarized.base1.hex}"; - "output.even-row" = "${solarized.base1.hex} bg:${solarized.base02.hex}"; - "sql.comment" = "italic ${solarized.base01.hex}"; - "sql.operator" = "bold ${solarized.base2.hex}"; - "sql.punctuation" = "bold ${solarized.base1.hex}"; - "sql.symbol" = "${solarized.base1.hex}"; - }; - }; in { home.packages = [ diff --git a/users/jalr/modules/solarized.nix b/users/jalr/modules/solarized.nix index 5390a31..baa2547 100644 --- a/users/jalr/modules/solarized.nix +++ b/users/jalr/modules/solarized.nix @@ -1,23 +1,68 @@ -builtins.mapAttrs - (_: hex: { - inherit hex; - rgb = builtins.concatStringsSep "," (map (f: toString (builtins.fromTOML "i = 0x${f hex}").i) (map (pos: builtins.substring pos 2) [ 1 3 5 ])); - }) +let + colors = { + base00 = "#657b83"; + base01 = "#586e75"; + base02 = "#073642"; + base03 = "#002b36"; + base0 = "#839496"; + base1 = "#93a1a1"; + base2 = "#eee8d5"; + base3 = "#fdf6e3"; + blue = "#268bd2"; + cyan = "#2aa198"; + green = "#859900"; + magenta = "#d33682"; + orange = "#cb4b16"; + red = "#dc322f"; + violet = "#6c71c4"; + yellow = "#b58900"; + }; + common = { + base08 = colors.red; + base09 = colors.orange; + base0A = colors.yellow; + base0B = colors.green; + base0C = colors.cyan; + base0D = colors.blue; + base0E = colors.violet; + base0F = colors.magenta; + }; + light = common // { + base00 = colors.base3; + base01 = colors.base2; + base02 = colors.base1; + base03 = colors.base0; + base04 = colors.base00; + base05 = colors.base01; + base06 = colors.base02; + base07 = colors.base03; + }; + dark = common // { + base00 = colors.base03; + base01 = colors.base02; + base02 = colors.base01; + base03 = colors.base00; + base04 = colors.base0; + base05 = colors.base1; + base06 = colors.base2; + base07 = colors.base3; + }; + toRgb = hex: builtins.concatStringsSep "," ( + map + ( + f: toString (builtins.fromTOML "i = 0x${f hex}").i + ) + ( + map (pos: builtins.substring pos 2) [ 1 3 5 ] + ) + ); + makeScheme = colors: { + hex = colors; + rgb = builtins.mapAttrs (_: hex: (toRgb hex)) colors; + }; +in { - base00 = "#657b83"; - base01 = "#586e75"; - base02 = "#073642"; - base03 = "#002b36"; - base0 = "#839496"; - base1 = "#93a1a1"; - base2 = "#eee8d5"; - base3 = "#fdf6e3"; - blue = "#268bd2"; - cyan = "#2aa198"; - green = "#859900"; - magenta = "#d33682"; - orange = "#cb4b16"; - red = "#dc322f"; - violet = "#6c71c4"; - yellow = "#b58900"; + inherit colors; + light = makeScheme light; + dark = makeScheme dark; } diff --git a/users/jalr/modules/sway/default.nix b/users/jalr/modules/sway/default.nix index 2202b71..7e4e764 100644 --- a/users/jalr/modules/sway/default.nix +++ b/users/jalr/modules/sway/default.nix @@ -234,6 +234,7 @@ in "XF86AudioMute" = "exec pactl set-source-mute alsa_input.usb-BEHRINGER_UMC202HD_192k-00.HiFi__umc202hd_mono_in_U192k_0_1__source toggle"; "${cfg.modifier}+l" = "exec ${lockScreen}"; + "${cfg.modifier}+v" = "exec GSK_RENDERER=cairo GTK_USE_PORTAL=0 ${pkgs.mixxc}/bin/mixxc -A"; }; bars = [ ]; # managed as systemd user unit @@ -363,40 +364,39 @@ in }; }; - xdg.configFile = { - "sway/light-theme".text = with solarized; '' - client.focused ${base01.hex} ${blue.hex} ${base3.hex} ${blue.hex} ${blue.hex} - client.focused_inactive ${base2.hex} ${base2.hex} ${base01.hex} ${base0.hex} ${base2.hex} - client.unfocused ${base2.hex} ${base3.hex} ${base01.hex} ${base2.hex} ${base2.hex} - client.urgent ${red.hex} ${red.hex} ${base3.hex} ${red.hex} ${red.hex} - ''; - "sway/dark-theme".text = with solarized; '' - client.focused ${base1.hex} ${blue.hex} ${base03.hex} ${blue.hex} ${blue.hex} - client.focused_inactive ${base02.hex} ${base02.hex} ${base1.hex} ${base03.hex} ${base02.hex} - client.unfocused ${base02.hex} ${base03.hex} ${base1.hex} ${base02.hex} ${base02.hex} - client.urgent ${red.hex} ${red.hex} ${base03.hex} ${red.hex} ${red.hex} - ''; - "swaynag/config".text = - let - # adding it to the header doesn’t work since the defaults overwrite it - commonConfig = /* ini */ '' - background=${lib.substring 1 6 solarized.base3.hex} - border-bottom=${lib.substring 1 6 solarized.base2.hex} - border=${lib.substring 1 6 solarized.base2.hex} - button-background=${lib.substring 1 6 solarized.base3.hex} - button-text=${lib.substring 1 6 solarized.base00.hex} - ''; - in - /* ini */ '' - font=Monospace 12 - - [warning] - text=${lib.substring 1 6 solarized.yellow.hex} - ${commonConfig} - - [error] - text=${lib.substring 1 6 solarized.red.hex} - ${commonConfig} + xdg.configFile = + let + makeTheme = scheme: '' + client.focused ${scheme.base05} ${scheme.base0D} ${scheme.base00} ${scheme.base0D} ${scheme.base0D} + client.focused_inactive ${scheme.base01} ${scheme.base01} ${scheme.base05} ${scheme.base03} ${scheme.base01} + client.unfocused ${scheme.base01} ${scheme.base00} ${scheme.base05} ${scheme.base01} ${scheme.base01} + client.urgent ${scheme.base08} ${scheme.base08} ${scheme.base00} ${scheme.base08} ${scheme.base08} ''; - }; + in + { + "sway/light-theme".text = makeTheme solarized.light.hex; + "sway/dark-theme".text = makeTheme solarized.dark.hex; + "swaynag/config".text = + let + # adding it to the header doesn’t work since the defaults overwrite it + commonConfig = /* ini */ '' + background=${lib.substring 1 6 solarized.colors.base3} + border-bottom=${lib.substring 1 6 solarized.colors.base2} + border=${lib.substring 1 6 solarized.colors.base2} + button-background=${lib.substring 1 6 solarized.colors.base3} + button-text=${lib.substring 1 6 solarized.colors.base00} + ''; + in + /* ini */ '' + font=Monospace 12 + + [warning] + text=${lib.substring 1 6 solarized.colors.yellow} + ${commonConfig} + + [error] + text=${lib.substring 1 6 solarized.colors.red} + ${commonConfig} + ''; + }; }) diff --git a/users/jalr/modules/sway/waybar.nix b/users/jalr/modules/sway/waybar.nix index 628e3e8..c507ce9 100644 --- a/users/jalr/modules/sway/waybar.nix +++ b/users/jalr/modules/sway/waybar.nix @@ -18,7 +18,11 @@ let thinsp = " "; solarized = import ../solarized.nix; - solarizedColors = as: lib.strings.concatLines (lib.attrsets.mapAttrsToList (name: value: let color = solarized."${value}".hex; in "@define-color ${name} ${color};") as); + solarizedColors = lib.attrsets.mapAttrsToList (name: color: "@define-color ${name} ${color};"); + themeCss = { + light = lib.strings.concatLines (solarizedColors solarized.light.hex); + dark = lib.strings.concatLines (solarizedColors solarized.dark.hex); + }; in { # home-manager’s waybar module performs additional checks that are overly strict @@ -148,8 +152,8 @@ in backlight = { format = "{percent}% {icon}"; format-icons = [ "󰛩" "󱩎" "󱩏" "󱩐" "󱩑" "󱩒" "󱩓" "󱩔" "󱩕" "󱩖" "󰛨" ]; - on-scroll-up = "${pkgs.brightnessctl}/bin/brightnessctl -q set +5%"; - on-scroll-down = "${pkgs.brightnessctl}/bin/brightnessctl -q set 5%-"; + on-scroll-up = "${pkgs.brightnessctl}/bin/brightnessctl -q set +1%"; + on-scroll-down = "${pkgs.brightnessctl}/bin/brightnessctl -q set 1%-"; }; pulseaudio = { format = "{volume}% {icon} {format_source}"; @@ -167,7 +171,7 @@ in phone = "󰏲"; portable = "󰏲"; }; - on-click-right = "${pkgs.pavucontrol}/bin/pavucontrol"; + on-click-right = "GSK_RENDERER=cairo GTK_USE_PORTAL=0 ${pkgs.mixxc}/bin/mixxc -A -a t -a r"; }; network = { format-wifi = "{essid} ({signalStrength}%) 󰖩 "; @@ -253,42 +257,8 @@ in }; xdg.configFile = { - "waybar/theme-light.css".text = solarizedColors { - base00 = "base3"; - base01 = "base2"; - base02 = "base1"; - base03 = "base0"; - base04 = "base00"; - base05 = "base01"; - base06 = "base02"; - base07 = "base03"; - base08 = "red"; - base09 = "orange"; - base0A = "yellow"; - base0B = "green"; - base0C = "cyan"; - base0D = "blue"; - base0E = "violet"; - base0F = "magenta"; - }; - "waybar/theme-dark.css".text = solarizedColors { - base00 = "base03"; - base01 = "base02"; - base02 = "base01"; - base03 = "base00"; - base04 = "base0"; - base05 = "base1"; - base06 = "base2"; - base07 = "base3"; - base08 = "red"; - base09 = "orange"; - base0A = "yellow"; - base0B = "green"; - base0C = "cyan"; - base0D = "blue"; - base0E = "violet"; - base0F = "magenta"; - }; + "waybar/theme-light.css".text = themeCss.light; + "waybar/theme-dark.css".text = themeCss.dark; "waybar/style.css".text = '' @import "theme.css"; diff --git a/users/jalr/modules/sway/wofi.nix b/users/jalr/modules/sway/wofi.nix index ca8eb9a..44d2914 100644 --- a/users/jalr/modules/sway/wofi.nix +++ b/users/jalr/modules/sway/wofi.nix @@ -1,91 +1,92 @@ { lib, ... }: let - solarized = import ../solarized.nix; + inherit (import ../solarized.nix) colors; in { - xdg.configFile = { - "wofi/color-light".text = lib.strings.concatLines (map (c: solarized."${c}".hex) [ - "base3" - "base2" - "base1" - "base0" - "base00" - "base01" - "base02" - "base03" - "red" - "orange" - "yellow" - "green" - "cyan" - "blue" - "violet" - "magenta" - ]); - "wofi/color-dark".text = lib.strings.concatLines (map (c: solarized."${c}".hex) [ - "base03" - "base02" - "base01" - "base00" - "base0" - "base1" - "base2" - "base3" - "red" - "orange" - "yellow" - "green" - "cyan" - "blue" - "violet" - "magenta" - ]); - "wofi/style.css".text = '' - window { - margin: 0px; - border: 3px solid --wofi-color1; - border-radius: 8px; - background-color: rgba(--wofi-rgb-color0,0.8); - } + xdg.configFile = + let + commonColors = with colors; [ + red + orange + yellow + green + cyan + blue + violet + magenta + ]; + in + { + "wofi/color-light".text = with colors; lib.strings.concatLines ( + [ + base3 + base2 + base1 + base0 + base00 + base01 + base02 + base03 + ] ++ commonColors + ); + "wofi/color-dark".text = with colors; lib.strings.concatLines ( + with colors; [ + base03 + base02 + base01 + base00 + base0 + base1 + base2 + base3 + ] ++ commonColors + ); + "wofi/style.css".text = '' + window { + margin: 0px; + border: 3px solid --wofi-color1; + border-radius: 8px; + background-color: rgba(--wofi-rgb-color0,0.8); + } - #input { - margin: 5px; - border: none; - color: --wofi-color4; - background-color: rgba(--wofi-rgb-color1,0.8); - } + #input { + margin: 5px; + border: none; + color: --wofi-color4; + background-color: rgba(--wofi-rgb-color1,0.8); + } - #inner-box { - margin: 5px; - border: none; - background: none; - } + #inner-box { + margin: 5px; + border: none; + background: none; + } - #outer-box { - margin: 5px; - border: none; - background: none; - } + #outer-box { + margin: 5px; + border: none; + background: none; + } - #scroll { - margin: 0px; - border: none; - } + #scroll { + margin: 0px; + border: none; + } - #text { - margin: 5px; - border: none; - color: --wofi-color4; - } + #text { + margin: 5px; + border: none; + color: --wofi-color4; + } - #entry:selected { - background-color: rgba(--wofi-rgb-color1,0.8); - } + #entry:selected { + background-color: rgba(--wofi-rgb-color1,0.8); + } - #entry:selected #text{ - color: --wofi-color11; - } - ''; - }; + #entry:selected #text{ + color: --wofi-color11; + } + ''; + }; }