diff --git a/assets/lockscreen.png b/assets/lockscreen.png index 9501e27..6cd61d2 100644 Binary files a/assets/lockscreen.png and b/assets/lockscreen.png differ diff --git a/flake.lock b/flake.lock index 912c647..e904118 100644 --- a/flake.lock +++ b/flake.lock @@ -355,11 +355,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1755424351, - "narHash": "sha256-xcorYLNdtLpb0wH5CPlUcpmYQUxeK95j1X855xQw+DY=", + "lastModified": 1748847346, + "narHash": "sha256-ohJbvwSyyGGmC29+Uxt9BEH0fSzFZVJmmped9px5ocU=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "9aa137af01f05386e5bb5050e983750017007a66", + "rev": "a36d9f210d5731382f205259425b41406aa78ff7", "type": "github" }, "original": { @@ -371,16 +371,16 @@ "niri-stable": { "flake": false, "locked": { - "lastModified": 1748151941, - "narHash": "sha256-z4viQZLgC2bIJ3VrzQnR+q2F3gAOEQpU1H5xHtX/2fs=", + "lastModified": 1740117926, + "narHash": "sha256-mTTHA0RAaQcdYe+9A3Jx77cmmyLFHmRoZdd8RpWa+m8=", "owner": "YaLTeR", "repo": "niri", - "rev": "8ba57fcf25d2fc9565131684a839d58703f1dae7", + "rev": "b94a5db8790339cf9134873d8b490be69e02ac71", "type": "github" }, "original": { "owner": "YaLTeR", - "ref": "v25.05.1", + "ref": "v25.02", "repo": "niri", "type": "github" } @@ -388,11 +388,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1755419373, - "narHash": "sha256-EFH3zbpyLYjEboNV2Lmkxf9joEuFCmeYX+MMLRPStpg=", + "lastModified": 1748794937, + "narHash": "sha256-LQfI1BlFm+JeZGjg0MPKdsmyupETu/9HzGmxVd0G4fw=", "owner": "YaLTeR", "repo": "niri", - "rev": "a6febb86aa5af0df7bf2792ca027ef95a503d599", + "rev": "1911cf3f55ac3d9d24c8692434a93214dcbde9ba", "type": "github" }, "original": { @@ -453,11 +453,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1755274400, - "narHash": "sha256-rTInmnp/xYrfcMZyFMH3kc8oko5zYfxsowaLv1LVobY=", + "lastModified": 1748708770, + "narHash": "sha256-q8jG2HJWgooWa9H0iatZqBPF3bp0504e05MevFmnFLY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ad7196ae55c295f53a7d1ec39e4a06d922f3b899", + "rev": "a59eb7800787c926045d51b70982ae285faa2346", "type": "github" }, "original": { @@ -485,11 +485,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1755186698, - "narHash": "sha256-wNO3+Ks2jZJ4nTHMuks+cxAiVBGNuEBXsT29Bz6HASo=", + "lastModified": 1748693115, + "narHash": "sha256-StSrWhklmDuXT93yc3GrTlb0cKSS0agTAxMGjLKAsY8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "fbcf476f790d8a217c3eab4e12033dc4a0f6d23c", + "rev": "910796cabe436259a29a72e8d3f5e180fc6dfacc", "type": "github" }, "original": { @@ -595,16 +595,16 @@ "xwayland-satellite-stable": { "flake": false, "locked": { - "lastModified": 1748488455, - "narHash": "sha256-IiLr1alzKFIy5tGGpDlabQbe6LV1c9ABvkH6T5WmyRI=", + "lastModified": 1739246919, + "narHash": "sha256-/hBM43/Gd0/tW+egrhlWgOIISeJxEs2uAOIYVpfDKeU=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "3ba30b149f9eb2bbf42cf4758d2158ca8cceef73", + "rev": "44590a416d4a3e8220e19e29e0b6efe64a80315d", "type": "github" }, "original": { "owner": "Supreeeme", - "ref": "v0.6", + "ref": "v0.5.1", "repo": "xwayland-satellite", "type": "github" } @@ -612,11 +612,11 @@ "xwayland-satellite-unstable": { "flake": false, "locked": { - "lastModified": 1755219541, - "narHash": "sha256-yKV6xHaPbEbh5RPxAJnb9yTs1wypr7do86hFFGQm1w8=", + "lastModified": 1748488455, + "narHash": "sha256-IiLr1alzKFIy5tGGpDlabQbe6LV1c9ABvkH6T5WmyRI=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "5a184d435927c3423f0ad189ea2b490578450fb7", + "rev": "3ba30b149f9eb2bbf42cf4758d2158ca8cceef73", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 799cde9..8ac9e34 100644 --- a/flake.nix +++ b/flake.nix @@ -12,6 +12,7 @@ niri.url = "github:sodiboo/niri-flake"; + # input override due to mesa version mismatch hyprlock.url = "github:hyprwm/hyprlock"; hyprlock.inputs.nixpkgs.follows = "nixpkgs"; hypridle.url = "github:hyprwm/hypridle"; diff --git a/hosts/goopnet-interface/default.nix b/hosts/goopnet-interface/default.nix index db03b77..d16be47 100755 --- a/hosts/goopnet-interface/default.nix +++ b/hosts/goopnet-interface/default.nix @@ -9,7 +9,7 @@ # archives zip xz unzip p7zip zstd # utils - ffmpeg ripgrep ripgrep-all jq libqalculate imagemagick pandoc + ffmpeg ripgrep jq libqalculate imagemagick # dev sqlitebrowser sqlite-analyzer # nix @@ -64,6 +64,7 @@ wob.enable = true; gammastep.enable = true; cliphist.enable = true; + xwayland-satellite.enable = true; wl-clip-persist.enable = true; # display manager diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 4d0e019..2a3bdff 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -34,7 +34,7 @@ in { # magic environment variables that improve wayland compat NIXOS_OZONE_WL = "1"; _JAVA_AWT_WM_NONEREPARENTING = "1"; - GDK_BACKEND = "wayland"; + GDK_BACKEND = "wayland,x11"; ANKI_WAYLAND = "1"; MOZ_ENABLE_WAYLAND = "1"; ELECTRON_OZONE_PLATFORM_HINT = "wayland"; diff --git a/modules/desktop/fuzzel.nix b/modules/desktop/fuzzel.nix index 46e9613..32d0414 100644 --- a/modules/desktop/fuzzel.nix +++ b/modules/desktop/fuzzel.nix @@ -18,7 +18,7 @@ in { settings = { main = { terminal = "wezterm start"; - font = with config.modules.desktop.fonts.fonts.monospace; "${family}:pixelsize=${toString size}"; + font = with config.modules.desktop.fonts.fonts; "${monospace.family}:pixelsize=${toString monospace.size}"; prompt = "> "; dpi-aware = "no"; lines = 20; @@ -27,10 +27,6 @@ in { horizontal-pad = 32; vertical-pad = 8; }; - border = { - width = 1; - radius = config.modules.desktop.fonts.fonts.monospace.size; - }; }; }; }; diff --git a/modules/desktop/hyprlock.nix b/modules/desktop/hyprlock.nix index 325db53..eaf4a56 100644 --- a/modules/desktop/hyprlock.nix +++ b/modules/desktop/hyprlock.nix @@ -23,12 +23,14 @@ in { settings = with config.colorScheme.palette; { general = { hide_cursor = false; + no_fade_in = true; + no_fade_out = true; text_trim = true; immediate_render = true; }; background = [ { - path = "${config.modules.desktop.swww.lastWallpaperSym}"; + path = "${../../assets/lockscreen.png}"; color = "rgb(${base00})"; blur_passes = 3; blur_size = 6; diff --git a/modules/desktop/monitors.nix b/modules/desktop/monitors.nix index 3e35a9f..8a25053 100644 --- a/modules/desktop/monitors.nix +++ b/modules/desktop/monitors.nix @@ -5,7 +5,7 @@ let cfg = config.modules.desktop.monitors; in { options.modules.desktop.monitors = { - enable = mkEnableOption "manually configure monitor settings, use if manual configuration is needed"; + enable = mkEnableOption "Manually configure monitor settings, use if manual configuration is needed"; monitors = mkOption { type = types.listOf types.attrs; description = '' @@ -26,6 +26,7 @@ in { name = monitor.name; value = { scale = monitor.scale; + background-color = config.modules.desktop.themes.niri.background; }; }) cfg.monitors); }; diff --git a/modules/desktop/niri.nix b/modules/desktop/niri.nix index 00b1ed3..56b2c56 100644 --- a/modules/desktop/niri.nix +++ b/modules/desktop/niri.nix @@ -55,22 +55,17 @@ in { size = config.modules.desktop.themes.cursorTheme.size; }; - prefer-no-csd = true; - - # xwayland stuff - xwayland-satellite.enable = true; - xwayland-satellite.path = lib.getExe pkgs.xwayland-satellite-unstable; environment = { DISPLAY = ":0"; }; + prefer-no-csd = true; + layout = { gaps = 6; center-focused-column = "on-overflow"; - background-color = config.modules.desktop.themes.niri.background; - focus-ring = { enable = false; width = 1; @@ -85,69 +80,33 @@ in { inactive.color = config.modules.desktop.themes.niri.inactive; }; - insert-hint = { - enable = true; - display.color = config.modules.desktop.themes.niri.accent; - }; - shadow = { enable = true; - draw-behind-window = false; + # TODO: remove this? + # this is a way to make the shadow appear on rounded corners + # see: https://github.com/YaLTeR/niri/blob/e251ca7340bc71870c3a81a7ffc3d9bde58e685a/resources/default-config.kdl#L201 + draw-behind-window = true; offset.x = 0; offset.y = 0; softness = 30; spread = 2; color = config.modules.desktop.themes.niri.shadow; }; + + insert-hint.enable = false; }; overview = { backdrop-color = config.modules.desktop.themes.niri.background; - workspace-shadow = { - enable = true; - offset.x = 0; - offset.y = 0; - softness = 30; - spread = 2; - color = config.modules.desktop.themes.niri.shadow; - }; }; hotkey-overlay.skip-at-startup = true; - screenshot-path = "${replaceString "$HOME" "~" config.hm.xdg.userDirs.extraConfig.screenshots}/%Y-%m-%d %H-%M-%S.png"; + screenshot-path = null; animations = { - window-open = { - kind.spring = { - damping-ratio = 0.8; - stiffness = 300; - epsilon = 0.001; - }; - custom-shader = '' - vec4 default_open(vec3 coords_curr_geo, vec3 size_curr_geo) { - // Scale up the window. - float scale = max(0.0, (niri_progress / 2.0 + 0.5)); - coords_curr_geo = vec3((coords_curr_geo.xy - vec2(0.5)) / scale + vec2(0.5), 1.0); - - // Get color from the window texture. - vec3 coords_tex = niri_geo_to_tex * coords_curr_geo; - vec4 color = texture2D(niri_tex, coords_tex.st); - - // Make the window opaque. - color *= niri_clamped_progress; - - return color; - } - - vec4 open_color(vec3 coords_curr_geo, vec3 size_curr_geo) { - return default_open(coords_curr_geo, size_curr_geo); - } - ''; - }; - - window-resize.custom-shader = '' - vec4 stretch_or_crop_next(vec3 coords_curr_geo, vec3 size_curr_geo) { + shaders.window-resize = '' + vec4 resize_color(vec3 coords_curr_geo, vec3 size_curr_geo) { vec3 coords_next_geo = niri_curr_geo_to_next_geo * coords_curr_geo; vec3 coords_stretch = niri_geo_to_tex_next * coords_curr_geo; @@ -182,40 +141,36 @@ in { return color; } - - vec4 resize_color(vec3 coords_curr_geo, vec3 size_curr_geo) { - return stretch_or_crop_next(coords_curr_geo, size_curr_geo); - } ''; window-close = { - kind.easing = { + easing = { curve = "linear"; duration-ms = 600; }; - custom-shader = '' - vec4 fall_and_rotate(vec3 coords_geo, vec3 size_geo) { - float progress = niri_clamped_progress * niri_clamped_progress; - vec2 coords = (coords_geo.xy - vec2(0.5, 1.0)) * size_geo.xy; - coords.y -= progress * 1440.0; - float random = (niri_random_seed - 0.5) / 2.0; - random = sign(random) - random; - float max_angle = 0.5 * random; - float angle = progress * max_angle; - mat2 rotate = mat2(cos(angle), -sin(angle), sin(angle), cos(angle)); - coords = rotate * coords; - coords_geo = vec3(coords / size_geo.xy + vec2(0.5, 1.0), 1.0); - vec3 coords_tex = niri_geo_to_tex * coords_geo; - vec4 color = texture2D(niri_tex, coords_tex.st); - - return color; - } - - vec4 close_color(vec3 coords_geo, vec3 size_geo) { - return fall_and_rotate(coords_geo, size_geo); - } - ''; }; + shaders.window-close = '' + vec4 fall_and_rotate(vec3 coords_geo, vec3 size_geo) { + float progress = niri_clamped_progress * niri_clamped_progress; + vec2 coords = (coords_geo.xy - vec2(0.5, 1.0)) * size_geo.xy; + coords.y -= progress * 1440.0; + float random = (niri_random_seed - 0.5) / 2.0; + random = sign(random) - random; + float max_angle = 0.5 * random; + float angle = progress * max_angle; + mat2 rotate = mat2(cos(angle), -sin(angle), sin(angle), cos(angle)); + coords = rotate * coords; + coords_geo = vec3(coords / size_geo.xy + vec2(0.5, 1.0), 1.0); + vec3 coords_tex = niri_geo_to_tex * coords_geo; + vec4 color = texture2D(niri_tex, coords_tex.st); + + return color; + } + + vec4 close_color(vec3 coords_geo, vec3 size_geo) { + return fall_and_rotate(coords_geo, size_geo); + } + ''; }; window-rules = [ @@ -314,24 +269,13 @@ in { enable = true; }; } - # special rounded corner cases. gah!! - # also for some reason int literals aren't accepted - # so multiply by 1.0 to make it a float { - matches = [ { namespace = "^rofi$"; } ]; - geometry-corner-radius = allCorners (config.modules.desktop.fonts.fonts.monospace.size * 1.0); # its 1em, so - } - { - matches = [ { namespace = "^launcher$"; } ]; - geometry-corner-radius = allCorners (config.hm.programs.fuzzel.settings.border.radius * 1.0); - } - { - matches = [ { namespace = "^notifications$"; } ]; - geometry-corner-radius = allCorners (config.hm.services.dunst.settings.global.corner_radius * 1.0); - } - { - matches = [ { namespace = "^waybar$"; } ]; - geometry-corner-radius = allCorners (config.modules.desktop.fonts.fonts.monospace.size * 1.0); # its 1em, so + matches = [ + { namespace = "^launcher$"; } + { namespace = "^wob$"; } + ]; + # see earlier shadow config; this is here because it's a transparent window, special case + shadow.draw-behind-window = false; } ]; @@ -386,16 +330,17 @@ in { "Mod+8".action = focus-workspace 8; "Mod+9".action = focus-workspace 9; "Mod+0".action = focus-workspace 10; - "Mod+Shift+1".action.move-column-to-workspace = 1; - "Mod+Shift+2".action.move-column-to-workspace = 2; - "Mod+Shift+3".action.move-column-to-workspace = 3; - "Mod+Shift+4".action.move-column-to-workspace = 4; - "Mod+Shift+5".action.move-column-to-workspace = 5; - "Mod+Shift+6".action.move-column-to-workspace = 6; - "Mod+Shift+7".action.move-column-to-workspace = 7; - "Mod+Shift+8".action.move-column-to-workspace = 8; - "Mod+Shift+9".action.move-column-to-workspace = 9; - "Mod+Shift+0".action.move-column-to-workspace = 10; + # no clue why, this got removed!! TODO: find an alternative + # "Mod+Shift+1".action = move-column-to-workspace 1; + # "Mod+Shift+2".action = move-column-to-workspace 2; + # "Mod+Shift+3".action = move-column-to-workspace 3; + # "Mod+Shift+4".action = move-column-to-workspace 4; + # "Mod+Shift+5".action = move-column-to-workspace 5; + # "Mod+Shift+6".action = move-column-to-workspace 6; + # "Mod+Shift+7".action = move-column-to-workspace 7; + # "Mod+Shift+8".action = move-column-to-workspace 8; + # "Mod+Shift+9".action = move-column-to-workspace 9; + # "Mod+Shift+0".action = move-column-to-workspace 10; "Mod+Comma".action = consume-window-into-column; "Mod+Period".action = expel-window-from-column; @@ -416,7 +361,7 @@ in { "Mod+Shift+Minus".action = set-window-height "-10%"; "Mod+Shift+Equal".action = set-window-height "+10%"; - "Print".action = screenshot { show-pointer = false; }; + "Print".action = screenshot; "Mod+Grave".action = toggle-overview; @@ -425,12 +370,12 @@ in { "XF86AudioMicMute".action = spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; "XF86AudioMicMute".allow-when-locked = true; - "XF86LaunchA".action = screenshot { show-pointer = false; }; + "XF86LaunchA".action = screenshot; "XF86LaunchB".action = sh "${lib.getExe pkgs.rofi-rbw-wayland} -a copy -t password --clear-after 20"; "XF86ScreenSaver".action = sh "${pkgs.systemd}/bin/loginctl lock-session"; # substitutions for when not on laptop - "Mod+Shift+S".action = screenshot { show-pointer = false; }; + "Mod+Shift+S".action = screenshot; "Mod+Shift+P".action = sh "${lib.getExe pkgs.rofi-rbw-wayland} -a copy -t password --clear-after 20"; "Mod+L".action = sh "${pkgs.systemd}/bin/loginctl lock-session"; diff --git a/modules/desktop/swww.nix b/modules/desktop/swww.nix index 71886fa..49de68c 100644 --- a/modules/desktop/swww.nix +++ b/modules/desktop/swww.nix @@ -4,11 +4,8 @@ with lib; let cfg = config.modules.desktop.swww; - # TODO: this whole thing is a little silly, but i cant find a better way to ref it in the scripts - # maybe we can reference the config in the scripts? in a let of course :) wallpapersFolder = "${pkgs.my.wallpapers}/share/backgrounds"; lastWallpaper = "$XDG_DATA_HOME/swww-last-wallpaper"; - lastWallpaperSym = "$XDG_DATA_HOME/swww-last-wallpaper-sym"; in { options.modules.desktop.swww = { enable = mkEnableOption "Enable swww, a Solution to your Wayland Wallpaper Woes"; @@ -17,21 +14,6 @@ in { default = pkgs.swww; example = "pkgs.swww"; }; - wallpapersFolder = mkOption { - type = types.str; - default = wallpapersFolder; - example = "$XDG_PICTURES_DIR/wallpapers"; - }; - lastWallpaper = mkOption { - type = types.str; - default = lastWallpaper; - example = "$XDG_DATA_HOME/swww-last-wallpaper"; - }; - lastWallpaperSym = mkOption { - type = types.str; - default = lastWallpaperSym; - example = "$XDG_DATA_HOME/swww-last-wallpaper-sym"; - }; setScript = mkOption { type = types.package; default = pkgs.writeShellScript "swww-set" '' @@ -41,7 +23,6 @@ in { echo "$(ls ${wallpapersFolder} | shuf -n 1)" > "${lastWallpaper}" fi - ln -sf "${wallpapersFolder}/$(cat ${lastWallpaper})" "${lastWallpaperSym}" # in case the hash of the pkg changes ${lib.getExe cfg.package} img "${wallpapersFolder}/$(cat ${lastWallpaper})" --transition-type none ''; }; @@ -57,7 +38,6 @@ in { ${lib.getExe cfg.package} img "$wallpaper" --transition-type grow --transition-fps 60 --transition-pos 1.0,1.0 --transition-duration 1.5 - ln -sf "$wallpaper" "${lastWallpaperSym}" echo "$file" > "${lastWallpaper}" ''; }; diff --git a/modules/desktop/xwayland-satellite.nix b/modules/desktop/xwayland-satellite.nix new file mode 100644 index 0000000..d6c6341 --- /dev/null +++ b/modules/desktop/xwayland-satellite.nix @@ -0,0 +1,35 @@ +{ lib, config, pkgs, ... }: + +with lib; +let + cfg = config.modules.desktop.xwayland-satellite; +in { + options.modules.desktop.xwayland-satellite = { + enable = mkEnableOption "Enable xwayland-satellite, xwayland outside your wayland"; + package = mkOption { + type = types.package; + default = pkgs.xwayland-satellite-unstable; + }; + }; + + config = mkIf cfg.enable { + hm.systemd.user.services.xwayland-satellite = { + Unit = { + Description = "xwayland-satellite, xwayland outside your wayland"; + After = [ "graphical-session-pre.target" ]; + PartOf = [ "graphical-session.target" ]; + }; + + Install = { + WantedBy = [ "graphical-session.target" ]; + }; + + Service = { + Type = "simple"; + ExecStart = "${lib.getExe cfg.package}"; + Restart = "on-failure"; + RestartSec = 5; + }; + }; + }; +} diff --git a/modules/software/editors/vscode.nix b/modules/software/editors/vscode.nix index 0c0a9e8..b1db04c 100644 --- a/modules/software/editors/vscode.nix +++ b/modules/software/editors/vscode.nix @@ -17,6 +17,9 @@ in { enableUpdateCheck = false; extensions = with pkgs.vscode-extensions; [ + # nix is *the* language here + jnoortheen.nix-ide + # general extensions oderwat.indent-rainbow usernamehw.errorlens @@ -26,36 +29,22 @@ in { ms-vscode.hexeditor tamasfe.even-better-toml github.copilot - leonardssh.vscord # language specific - # nix - jnoortheen.nix-ide - # javascript/typescript + # js/ts dbaeumer.vscode-eslint astro-build.astro-vscode - # rust + # rs rust-lang.rust-analyzer # lua sumneko.lua - # qml - ] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [ - # language specific - # qml + # general extensions { - name = "qt-qml"; - publisher = "TheQtCompany"; - version = "1.4.0"; - sha256 = "sha256-9C0EC4vnulg0OjGNU0SfMA2R6+OaHVCqDsipY2TAqxo="; - } - # libraries - # qt core - { - name = "qt-core"; - publisher = "TheQtCompany"; - version = "1.4.0"; - sha256 = "sha256-QiZc6WNh4Q67beyFuiSqkG5G4zRMNmyjuZhWW7ZATO0="; + name = "discord-vscode"; + publisher = "icrawl"; + version = "5.8.0"; + sha256 = "sha256-IU/looiu6tluAp8u6MeSNCd7B8SSMZ6CEZ64mMsTNmU="; } ]; @@ -81,11 +70,6 @@ in { "nix.enableLanguageServer" = true; "nix.serverPath" = "${lib.getExe pkgs.nil}"; - "qt-qml.qmlls.enabled" = true; - "qt-qml.qmlls.customExePath" = "${pkgs.qt6.qtdeclarative}/bin/qmlls"; - "qt-qml.qmlls.useQmlImportPathEnvVar" = true; - "qt-qml.doNotAskForQmllsDownload" = true; - "security.workspace.trust.enabled" = "false"; "explorer.compactFolders" = false; diff --git a/modules/xdg.nix b/modules/xdg.nix index cc9c8a1..10f9786 100644 --- a/modules/xdg.nix +++ b/modules/xdg.nix @@ -2,7 +2,7 @@ { config = { hm.xdg.enable = true; - hm.xdg.userDirs = rec { + hm.xdg.userDirs = { enable = true; createDirectories = true; @@ -14,10 +14,6 @@ publicShare = "$HOME/public"; templates = "$HOME/templates"; videos = "$HOME/videos"; - - extraConfig = { - screenshots = "${pictures}/screenshots"; - }; }; }; }