niri comin along

This commit is contained in:
William 2025-05-23 07:16:03 -03:00
parent b500c0a4cc
commit 95e23247b0
9 changed files with 88 additions and 545 deletions

View file

@ -113,7 +113,6 @@
}; };
workstationOverlay = final: prev: { workstationOverlay = final: prev: {
plasticity = nixpkgs.legacyPackages."x86_64-linux".callPackage ./packages/plasticity.nix { }; plasticity = nixpkgs.legacyPackages."x86_64-linux".callPackage ./packages/plasticity.nix { };
niri = nixpkgs.legacyPackages."x86_64-linux".callPackage ./packages/niri.nix { };
}; };
serverOverlay = final: prev: { serverOverlay = final: prev: {
}; };

View file

@ -38,6 +38,8 @@
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
anyrun anyrun
foot foot
swaybg
swww
xwayland-satellite xwayland-satellite
]; ];
@ -55,7 +57,6 @@
enable = true; enable = true;
xdgOpenUsePortal = true; xdgOpenUsePortal = true;
extraPortals = with pkgs; [ extraPortals = with pkgs; [
# kdePackages.xdg-desktop-portal-kde
xdg-desktop-portal-gtk xdg-desktop-portal-gtk
xdg-desktop-portal-gnome xdg-desktop-portal-gnome
]; ];

View file

@ -1,5 +1,6 @@
{ {
hostType, hostType,
inputs,
lib, lib,
pkgs, pkgs,
... ...
@ -44,12 +45,6 @@
# Workstation specific configuration # Workstation specific configuration
(lib.mkIf hostType.isWorkstation ( (lib.mkIf hostType.isWorkstation (
let let
kdepkgs = with pkgs.kdePackages; [
ark
dolphin
dolphin-plugins
kolourpaint
];
kwrite = pkgs.symlinkJoin { kwrite = pkgs.symlinkJoin {
name = "kwrite"; name = "kwrite";
paths = [ pkgs.kdePackages.kate ]; paths = [ pkgs.kdePackages.kate ];
@ -65,69 +60,66 @@
}; };
in in
{ {
environment.systemPackages = environment.systemPackages = with pkgs; [
with pkgs; ### Dev Tools ###
[ bat
### Dev Tools ### deploy-rs
bat fd
deploy-rs fzf
fd nixfmt-rfc-style
fzf nix-init
nixfmt-rfc-style nix-output-monitor
nix-init ripgrep
nix-output-monitor ### Internet Browsers & Communication ###
ripgrep beeper
### Internet Browsers & Communication ### brave
beeper nextcloud-client
brave tor-browser
microsoft-edge vesktop
nextcloud-client ### Office & Productivity ###
tor-browser aspell
vesktop aspellDicts.de
### Office & Productivity ### aspellDicts.en
aspell aspellDicts.en-computers
aspellDicts.de aspellDicts.pt_BR
aspellDicts.en kwrite
aspellDicts.en-computers libreoffice-qt
aspellDicts.pt_BR obsidian
kwrite (octaveFull.withPackages (octavePackages: with octavePackages; [ signal ]))
libreoffice-qt onlyoffice-desktopeditors
obsidian rnote
(octaveFull.withPackages (octavePackages: with octavePackages; [ signal ])) ### Graphics & Design ###
onlyoffice-desktopeditors gimp
rnote inkscape
### Graphics & Design ### orca-slicer
gimp plasticity
inkscape ### Gaming & Entertainment ###
orca-slicer clonehero
plasticity heroic
### Gaming & Entertainment ### mangohud
clonehero prismlauncher
heroic protonup
mangohud ### System Utilities ###
prismlauncher adwaita-icon-theme
protonup junction
### System Utilities ### kara
adwaita-icon-theme kde-rounded-corners
junction libfido2
kara morewaita-icon-theme
kde-rounded-corners nautilus
libfido2 mission-center
# lilipod BROKEN p7zip
mission-center qbittorrent
p7zip quickemu
qbittorrent quickgui
quickemu rustdesk
quickgui steam-run
rustdesk unrar
steam-run ### Media ###
unrar mpv
### Media ### obs-studio
mpv qview
obs-studio ];
qview
]
++ kdepkgs;
programs = { programs = {
adb.enable = true; adb.enable = true;

View file

@ -1,129 +0,0 @@
{
lib,
dbus,
eudev,
fetchFromGitHub,
libdisplay-info,
libglvnd,
libinput,
libxkbcommon,
libgbm,
versionCheckHook,
nix-update-script,
pango,
pipewire,
pkg-config,
rustPlatform,
seatd,
systemd,
wayland,
withDbus ? true,
withDinit ? false,
withScreencastSupport ? true,
withSystemd ? true,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "niri";
version = "25.05";
src = fetchFromGitHub {
owner = "YaLTeR";
repo = "niri";
tag = "v${finalAttrs.version}";
hash = "sha256-ngQ+iTHmBJkEbsjYfCWTJdV8gHhOCTkV8K0at6Y+YHI=";
};
postPatch = ''
patchShebangs resources/niri-session
substituteInPlace resources/niri.service \
--replace-fail '/usr/bin' "$out/bin"
'';
useFetchCargoVendor = true;
cargoHash = "sha256-tZp7AhhddEhKWzEUTgosxXMEzALbv6FxqnJEb9MBhzc=";
strictDeps = true;
nativeBuildInputs = [
pkg-config
rustPlatform.bindgenHook
];
buildInputs =
[
libdisplay-info
libglvnd # For libEGL
libinput
libxkbcommon
libgbm
pango
seatd
wayland # For libwayland-client
]
++ lib.optional (withDbus || withScreencastSupport || withSystemd) dbus
++ lib.optional withScreencastSupport pipewire
++ lib.optional withSystemd systemd # Includes libudev
++ lib.optional (!withSystemd) eudev; # Use an alternative libudev implementation when building w/o systemd
buildFeatures =
lib.optional withDbus "dbus"
++ lib.optional withDinit "dinit"
++ lib.optional withScreencastSupport "xdp-gnome-screencast"
++ lib.optional withSystemd "systemd";
buildNoDefaultFeatures = true;
postInstall =
''
install -Dm0644 resources/niri.desktop -t $out/share/wayland-sessions
''
+ lib.optionalString withDbus ''
install -Dm0644 resources/niri-portals.conf -t $out/share/xdg-desktop-portal
''
+ lib.optionalString (withSystemd || withDinit) ''
install -Dm0755 resources/niri-session -t $out/bin
''
+ lib.optionalString withSystemd ''
install -Dm0644 resources/niri{-shutdown.target,.service} -t $out/lib/systemd/user
''
+ lib.optionalString withDinit ''
install -Dm0644 resources/dinit/niri{-shutdown,} -t $out/lib/dinit.d/user
'';
env = {
# Force linking with libEGL and libwayland-client
# so they can be discovered by `dlopen()`
RUSTFLAGS = toString (
map (arg: "-C link-arg=" + arg) [
"-Wl,--push-state,--no-as-needed"
"-lEGL"
"-lwayland-client"
"-Wl,--pop-state"
]
);
};
nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgramArg = "--version";
doInstallCheck = true;
passthru = {
providedSessions = [ "niri" ];
updateScript = nix-update-script { };
};
meta = {
description = "Scrollable-tiling Wayland compositor";
homepage = "https://github.com/YaLTeR/niri";
changelog = "https://github.com/YaLTeR/niri/releases/tag/v${finalAttrs.version}";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [
iogamaster
foo-dogsquared
sodiboo
getchoo
];
mainProgram = "niri";
platforms = lib.platforms.linux;
};
})

View file

@ -19,7 +19,6 @@
programs = { programs = {
bash = { bash = {
enable = true; enable = true;
historyFile = "~/.cache/bash_history";
}; };
helix = { helix = {

View file

@ -2,7 +2,7 @@
{ {
imports = [ imports = [
# ./hyprland.nix
./programs.nix ./programs.nix
./home.nix
]; ];
} }

View file

@ -0,0 +1,24 @@
{ pkgs, ... }:
{
home.pointerCursor = {
package = pkgs.kdePackages.breeze;
name = "Breeze_Light";
gtk.enable = true;
x11.enable = true;
};
gtk = {
enable = true;
iconTheme = {
package = pkgs.morewaita-icon-theme;
name = "MoreWaita";
};
gtk3.extraConfig = {
gtk-decoration-layout = "appmenu:";
};
gtk4.extraConfig = {
gtk-decoration-layout = "appmenu:";
};
};
}

View file

@ -1,299 +0,0 @@
{
lib,
pkgs,
...
}:
let
heightfittr = pkgs.writeShellApplication {
name = "heightfittr";
runtimeInputs = with pkgs; [
socat
hyprland
];
text = ''
function handle {
case "$1" in
*openwindow*)
hyprctl dispatch scroller:fitheight all > /dev/null
;;
*closewindow*)
hyprctl dispatch scroller:fitheight all > /dev/null
;;
esac
}
socat - "UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock" | while read -r line; do
handle "$line"
done
'';
};
scrollermodetoggle = pkgs.writeShellApplication {
name = "scrollermodetoggle";
runtimeInputs = with pkgs; [ hyprland ];
text = ''
if [ -f "$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/colmode" ]; then
rm "$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/colmode"
hyprctl --batch 'dispatch scroller:setmode row; notify 2 1000 0 "Row Mode"'
else
touch "$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/colmode"
hyprctl --batch 'dispatch scroller:setmode col; notify 2 1000 0 "Column Mode"'
fi
'';
};
in
{
wayland.windowManager.hyprland = {
enable = true;
plugins = with pkgs.hyprlandPlugins; [ hyprscroller ];
extraConfig = ''
################
### MONITORS ###
################
monitor=,preferred,auto,1
#################
### AUTOSTART ###
#################
# exec-once = ${pkgs.gnome-settings-daemon}/libexec/gsd-rfkill
# exec-once = waybar
# exec-once = syshud
exec-once = ${lib.getExe heightfittr}
env = XCURSOR_SIZE,24
env = HYPRCURSOR_SIZE,24
#####################
### LOOK AND FEEL ###
#####################
general {
gaps_in = 5
gaps_out = 20
border_size = 2
resize_on_border = true
allow_tearing = false
layout = scroller
}
misc {
font_family = Inter
}
plugin {
scroller {
column_default_width = onethird
focuswrap = false
column_widths = onethird onehalf twothirds
center_row_if_space_available = true
}
}
decoration {
rounding = 10
rounding_power = 2
dim_inactive = true
dim_strength = 0.3
shadow {
enabled = true
range = 4
render_power = 3
}
blur {
enabled = true
size = 8
passes = 1
vibrancy = 0.1696
}
layerrule = blur, waybar
layerrule = ignorealpha 0.5, waybar
layerrule = ignorezero, waybar
}
animations {
enabled = yes, please :)
bezier = easeOutQuint,0.23,1,0.32,1
bezier = easeInOutCubic,0.65,0.05,0.36,1
bezier = linear,0,0,1,1
bezier = almostLinear,0.5,0.5,0.75,1.0
bezier = quick,0.15,0,0.1,1
animation = global, 1, 1, default
animation = border, 1, 1, easeOutQuint
animation = windows, 1, 1, easeOutQuint
animation = windowsIn, 1, 1, easeOutQuint, popin 87%
animation = windowsOut, 1, 1, linear, popin 87%
animation = fadeIn, 1, 1, almostLinear
animation = fadeOut, 1, 1, almostLinear
animation = fade, 1, 1, quick
animation = layers, 1, 1, easeOutQuint
animation = layersIn, 1, 1, easeOutQuint, fade
animation = layersOut, 1, 1, linear, fade
animation = fadeLayersIn, 1, 1, almostLinear
animation = fadeLayersOut, 1, 1, almostLinear
animation = workspaces, 1, 1, almostLinear, slidevert
}
misc {
force_default_wallpaper = 0
disable_hyprland_logo = true
}
#############
### INPUT ###
#############
input {
kb_layout = us
kb_variant = altgr-intl
follow_mouse = 1
sensitivity = 0
accel_profile = flat
natural_scroll = true
touchpad {
natural_scroll = true
clickfinger_behavior = true
}
}
###################
### KEYBINDINGS ###
###################
$mainMod = SUPER
$terminal = ghostty
$menu = ulauncher-toggle
# APP SHORTCUTS
bind = ALT, SPACE, exec, $menu
bind = $mainMod, RETURN, exec, $terminal
# SESSION MANAGEMENT
bind = CTRL ALT, DELETE, exit,
bind = $mainMod, mouse_up, exec, hyprnome
bind = $mainMod, mouse_down, exec, hyprnome --previous
bind = CTRL ALT, j, exec, hyprnome
bind = CTRL ALT, k, exec, hyprnome --previous
bind = $mainMod CTRL ALT, j, exec, hyprnome --move
bind = $mainMod CTRL ALT, k, exec, hyprnome --move --previous
bindel = ,XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+
bindel = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
bindel = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
bindel = ,XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle
bindel = ,XF86MonBrightnessUp, exec, brightnessctl s 10%+
bindel = ,XF86MonBrightnessDown, exec, brightnessctl s 10%-
bindl = , XF86AudioNext, exec, playerctl next
bindl = , XF86AudioPause, exec, playerctl play-pause
bindl = , XF86AudioPlay, exec, playerctl play-pause
bindl = , XF86AudioPrev, exec, playerctl previous
bind = CTRL ALT SHIFT, a, exec, bash /home/user/.local/bin/toggle-audio-output.sh
# WINDOW MANAGEMENT
bind = ALT, F4, killactive,
bind = $mainMod, space, togglefloating,
bind = $mainMod, f, fullscreen
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow
bind = SUPER, h, movefocus, l
bind = SUPER, l, movefocus, r
bind = SUPER, k, movefocus, u
bind = SUPER, j, movefocus, d
bind = $mainMod CTRL, h, movewindow, l
bind = $mainMod CTRL, l, movewindow, r
bind = $mainMod CTRL, k, movewindow, u
bind = $mainMod CTRL, j, movewindow, d
bind = $mainMod, v, exec, ${lib.getExe scrollermodetoggle}
bind = $mainMod, r, scroller:cyclewidth, next
bind = $mainMod CTRL, r, scroller:cyclewidth, prev
bind = $mainMod, p, scroller:pin,
bind = $mainMod, c, scroller:alignwindow, center
bind = $mainMod CTRL, f, scroller:fitsize, all
####################
### WINDOW RULES ###
####################
windowrulev2 = suppressevent maximize, class:.*
windowrulev2 = nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0
# ulauncher
windowrule = float, ulauncher
windowrule = pin, ulauncher
windowrule = noborder, ulauncher
windowrule = noshadow, ulauncher
windowrule = nomaxsize, ulauncher
windowrule = noblur, ulauncher
windowrulev2 = animation slide top, class:^(ulauncher)$
# browsers
windowrulev2 = plugin:scroller:columnwidth onehalf, class:(firefox)
windowrulev2 = plugin:scroller:columnwidth onehalf, class:(zen)
windowrulev2 = plugin:scroller:columnwidth onehalf, class:(brave)
'';
};
services = {
# swaync = {
# enable = true;
# settings = {
# positionX = "left";
# positionY = "top";
# layer = "overlay";
# control-center-layer = "top";
# layer-shell = true;
# cssPriority = "application";
# control-center-margin-top = 20;
# control-center-margin-bottom = 20;
# control-center-margin-right = 20;
# control-center-margin-left = 20;
# notification-2fa-action = true;
# notification-inline-replies = false;
# notification-icon-size = 64;
# notification-body-image-height = 100;
# notification-body-image-width = 200;
# timeout = 10;
# timeout-low = 5;
# timeout-critical = 0;
# fit-to-screen = true;
# relative-timestamps = true;
# control-center-width = 500;
# control-center-height = 600;
# notification-window-width = 500;
# keyboard-shortcuts = true;
# image-visibility = "when-available";
# transition-time = 200;
# hide-on-clear = false;
# hide-on-action = true;
# script-fail-notify = true;
# widgets = [
# "inhibitors"
# "title"
# "dnd"
# "notifications"
# "mpris"
# ];
# widget-config = {
# inhibitors = {
# text = "Inhibitors";
# button-text = "Clear All";
# clear-all-button = true;
# };
# title = {
# text = "Notifications";
# clear-all-button = true;
# button-text = "Clear All";
# };
# dnd = {
# text = "Do Not Disturb";
# };
# mpris = {
# image-size = 96;
# image-radius = 12;
# };
# };
# };
# };
# clipman.enable = true;
};
# programs = {
# hyprlock.enable = true;
# };
home.packages = with pkgs; [
brightnessctl
ghostty
hyprnome
playerctl
swaynotificationcenter
syshud
ulauncher
waybar
# inputs.mithril.packages.${pkgs.system}.mithril-control-center
];
}

View file

@ -111,10 +111,6 @@
(lib.mkIf hostType.isWorkstation { (lib.mkIf hostType.isWorkstation {
fonts.fontconfig.enable = true; fonts.fontconfig.enable = true;
home.packages = with pkgs; [
rmenu
];
programs = { programs = {
password-store.package = pkgs.pass-wayland; password-store.package = pkgs.pass-wayland;
@ -137,46 +133,6 @@
}; };
}; };
}; };
gtk = {
gtk3.extraConfig = {
gtk-decoration-layout = "appmenu:";
};
gtk4.extraConfig = {
gtk-decoration-layout = "appmenu:";
};
};
# systemd.user.services.ulauncher = {
# Unit = {
# Description = "Ulauncher Application Launcher";
# After = [ "graphical-session.target" ];
# };
# Service = {
# Type = "simple";
# Environment =
# let
# pydeps = pkgs.python3.withPackages (
# pp: with pp; [
# # dependencies for ulauncher-albert-calculate-anything
# parsedatetime
# pint
# pytz
# requests
# simpleeval
# ]
# );
# in
# [
# "PYTHONPATH=${pydeps}/${pydeps.sitePackages}"
# ];
# ExecStart = pkgs.writeShellScript "ulauncher-env-wrapper.sh" ''
# export PATH="''${XDG_BIN_HOME}:$HOME/.nix-profile/bin:/etc/profiles/per-user/$USER/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin"
# export GDK_BACKEND=wayland
# exec ${pkgs.ulauncher}/bin/ulauncher --hide-window
# '';
# };
# };
}) })
]; ];
} }