restructured flake

This commit is contained in:
willifan 2025-05-30 14:22:14 +02:00
parent 5c7ae091c1
commit bf3bb961f3
100 changed files with 76 additions and 78 deletions

View file

@ -0,0 +1,9 @@
{ ... }:
{
imports = [
./niri.nix
./river.nix
./waybar.nix
];
}

View file

@ -0,0 +1,95 @@
{ inputs, lib, config, pkgs, ... }:
let
SCRIPTS = "$XDG_CONFIG_HOME/desktop-utils/scripts";
autobrightness = fetchTarball {
url = "https://git.huwe.mooo.com/willifan/Mac-like-automatic-brightness/archive/0.1.0.tar.gz";
sha256 = "1andyln5vmm934nl1lsid2gpc88h9il83b84yd9dmqr7pninwk37";
};
in
lib.mkIf (config.desktop.wm.niri.enable && config.nixos.enable) {
nixpkgs.overlays = [ inputs.niri.overlays.niri ];
programs.niri.enable = true;
programs.light.enable = true;
home-manager.users.willifan = {
home.packages = [
pkgs.xwayland-satellite
pkgs.bc
];
programs.niri.settings = {
outputs."eDP-1" = {
scale = 1.6;
variable-refresh-rate = true;
};
spawn-at-startup = [
{
command = [ "xwayland-satellite" ":0" ];
}
{
command = [ "sh" "${autobrightness}/AutomaticBrightness.sh" ];
}
];
hotkey-overlay.skip-at-startup = true;
prefer-no-csd = true;
environment = {
DISPLAY = ":0";
};
input = {
keyboard.xkb = {
layout = "eu";
};
};
window-rules = [
{
geometry-corner-radius = {
top-right = 12.0;
top-left = 12.0;
bottom-right = 12.0;
bottom-left = 12.0;
};
clip-to-geometry = true;
open-maximized = true;
}
];
binds = {
"Mod+H".action.focus-column-or-monitor-left = { };
"Mod+J".action.focus-window-or-monitor-down = { };
"Mod+K".action.focus-window-or-monitor-up = { };
"Mod+L".action.focus-column-or-monitor-right = { };
"Mod+Q".action.spawn = [ "kitty" ];
"Mod+C".action.close-window = { };
"Mod+M".action.quit = { };
"Mod+E".action.spawn = [ "thunar" ];
"Mod+R".action.spawn = [ "fuzzel" ];
"Mod+P".action.spawn = [ "Enpass" ];
"Mod+F".action.fullscreen-window = { };
"XF86AudioMute".action.spawn = [ "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle" ];
"XF86AudioLowerVolume".action.spawn = [ "sh" "-c" "${SCRIPTS}/volume.sh -5" ];
"XF86AudioRaiseVolume".action.spawn = [ "sh" "-c" "${SCRIPTS}/volume.sh 5" ];
"XF86AudioPrev".action.spawn = [ "playerctl" "previous" ];
"XF86AudioPlay".action.spawn = [ "playerctl" "play-pause" ];
"XF86AudioNext".action.spawn = [ "playerctl" "next" ];
"XF86MonBrightnessDown".action.spawn = [ "sh" "${autobrightness}/AutomaticBrightness.sh" "-d" "10" ];
"XF86MonBrightnessUp".action.spawn = [ "sh" "${autobrightness}/AutomaticBrightness.sh" "-i" "10" ];
"Print".action.screenshot = { };
};
};
};
}

View file

@ -0,0 +1,19 @@
{ lib, config, ... }:
lib.mkIf config.desktop.wm.river.enable {
home-manager.users.willifan = {
wayland.windowManager.river = {
enable = true;
settings = {
map = {
normal = {
"Super Q" = "spawn 'kitty'";
"Super R" = "spawn 'fuzzel'";
"Super E" = "spawn 'thunar'";
"Super C" = "close";
};
};
};
};
};
}

View file

@ -0,0 +1,153 @@
{ lib, config, pkgs, ... }:
let
icons = fetchTarball {
url = "https://files.huwe.mooo.com/waybar.tar.gz";
sha256 = "0h5r8r7vscm6yv25kgyzx5y325n5ri78n28vmdvgmysp351drm57";
};
in
lib.mkIf config.desktop.wm.niri.enable {
home-manager.users.willifan = {
programs.waybar = {
enable = true;
settings = {
mainBar = {
layer = "top";
position = "top";
height = 25;
output = [
"eDP-1"
];
modules-left = [ "clock" "mpris" ];
modules-center = [ "niri/workspaces" ];
modules-right = [ "tray" "group/ressources" "group/peripherals" "group/wireless" "group/power" ];
"group/ressources" = {
orientation = "inherit";
modules = [ "group/cpu" "group/memory" ];
};
"group/peripherals" = {
orientation = "inherit";
modules = [ "group/volume" "group/backlight" ];
};
"group/wireless" = {
orientation = "inherit";
modules = [ "group/networking" "group/bluetooth" ];
};
"group/power" = {
orientation = "inherit";
modules = [ "group/battery" "image#power" ];
};
"clock" = {
interval = 1;
format = "{:%H:%M:%S}";
};
"mpris" = {
format = "";
format-playing = "{dynamic}";
dynamic-order = [ "title" "artist" "album" "position" "length" ];
dynamic-len = 30;
};
"niri/workspaces" = {
all-outputs = true;
};
"group/cpu" = {
orientation = "inherit";
modules = [ "image#cpu" "cpu" ];
};
"image#cpu" = {
path = "${icons}/cpu.png";
size = 16;
};
"cpu" = {
format = "{usage}%";
};
"group/memory" = {
orientation = "inherit";
modules = [ "image#memory" "memory" ];
};
"image#memory" = {
path = "${icons}/ram.png";
size = 16;
};
"memory" = {
format = "{percentage}%";
};
"group/volume" = {
orientation = "inherit";
modules = [ "image#volume" "wireplumber" ];
};
"image#volume" = {
path = "${icons}/volume.png";
size = 16;
};
"wireplumber" = {
format = "{volume}%";
};
"group/backlight" = {
orientation = "inherit";
modules = [ "image#backlight" "backlight" ];
};
"image#backlight" = {
path = "${icons}/brightness.png";
size = 16;
};
"backlight" = {
format = "{percent}%";
};
"group/networking" = {
orientation = "inherit";
modules = [ "image#networking" "network" ];
};
"image#networking" = {
path = "${icons}/wifiHigh.png";
size = 16;
};
"network" = {
format = "{signalStrength}%";
};
"group/bluetooth" = {
orientation = "inherit";
modules = [ "image#bluetooth" "bluetooth" ];
};
"image#bluetooth" = {
path = "${icons}/bluetooth.png";
size = 16;
};
"bluetooth" = {
format = "{status}";
};
"group/battery" = {
orientation = "inherit";
modules = [ "image#battery" "battery" ];
};
"image#battery" = {
path = "${icons}/battery.png";
size = 16;
};
"battery" = {
format = "{capacity}%";
};
"image#power" = {
path = "${icons}/power.png";
size = 16;
};
};
};
systemd = {
enable = true;
};
};
};
}