mirror of
https://git.sr.ht/~rouven/nixos-config
synced 2025-04-11 09:16:20 +02:00
Compare commits
3 commits
ba3929c399
...
f32125afb7
Author | SHA1 | Date | |
---|---|---|---|
f32125afb7 | |||
0655bc7be8 | |||
75ef09ca41 |
7 changed files with 97 additions and 98 deletions
6
flake.lock
generated
6
flake.lock
generated
|
@ -180,11 +180,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1710062421,
|
"lastModified": 1710164657,
|
||||||
"narHash": "sha256-FiCNRfyUgJOLYIokLiFsfI7B+Zn9HDnOzFR3uVr5qsQ=",
|
"narHash": "sha256-l64+ZjaQAVkHDVaK0VHwtXBdjcBD6nLBD+p7IfyBp/w=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "36f873dfc8e2b6b89936ff3e2b74803d50447e0a",
|
"rev": "017b12de5b899ef9b64e2c035ce257bfe95b8ae2",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -3,11 +3,10 @@ let
|
||||||
inherit (prev) callPackage;
|
inherit (prev) callPackage;
|
||||||
inherit (prev) fetchFromGitHub;
|
inherit (prev) fetchFromGitHub;
|
||||||
inherit (prev) fetchPypi;
|
inherit (prev) fetchPypi;
|
||||||
inherit (prev) fetchpatch;
|
|
||||||
inherit (prev) makeWrapper;
|
inherit (prev) makeWrapper;
|
||||||
inherit (prev) python3Packages;
|
inherit (prev) python3Packages;
|
||||||
in
|
in
|
||||||
rec {
|
{
|
||||||
pww = callPackage ../pkgs/pww { };
|
pww = callPackage ../pkgs/pww { };
|
||||||
ianny = callPackage ../pkgs/ianny { };
|
ianny = callPackage ../pkgs/ianny { };
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ pkgs, ... }:
|
{ ... }:
|
||||||
{
|
{
|
||||||
programs.git = {
|
programs.git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
@ -60,6 +60,18 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
systemd.user.services.swaybg = {
|
||||||
|
Unit = {
|
||||||
|
Description = "Wallpaper tool for Wayland compositors";
|
||||||
|
After = [ "graphical-session-pre.target" ];
|
||||||
|
PartOf = [ "graphical-session.target" ];
|
||||||
|
};
|
||||||
|
Service = {
|
||||||
|
ExecStart = "${pkgs.swaybg}/bin/swaybg -i ${../../../../images/wallpaper.png} -m fill";
|
||||||
|
};
|
||||||
|
Install = { WantedBy = [ "graphical-session.target" ]; };
|
||||||
|
};
|
||||||
|
|
||||||
services.wlsunset = {
|
services.wlsunset = {
|
||||||
enable = true;
|
enable = true;
|
||||||
longitude = "13";
|
longitude = "13";
|
||||||
|
|
|
@ -1,95 +1,86 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, lib, ... }:
|
||||||
{
|
{
|
||||||
home.packages = with pkgs; [
|
wayland.windowManager.river = {
|
||||||
river
|
enable = true;
|
||||||
];
|
systemd.extraCommands = [ "systemctl --user start river-session.target" ];
|
||||||
systemd.user.targets.river-session = {
|
settings = {
|
||||||
Unit = {
|
focus-follows-cursor = "always";
|
||||||
After = "graphical-session-pre.target";
|
set-cursor-warp = "on-focus-change";
|
||||||
BindsTo = "graphical-session.target";
|
attach-mode = "bottom";
|
||||||
Description = "river compositor session";
|
default-layout = "rivertile";
|
||||||
Wants = "graphical-session-pre.target";
|
output-layout = "rivertile";
|
||||||
};
|
|
||||||
};
|
|
||||||
xdg.configFile = {
|
|
||||||
"river/init" = {
|
|
||||||
source =
|
|
||||||
pkgs.writeShellScript "river-init.sh" ''
|
|
||||||
riverctl focus-follows-cursor always
|
|
||||||
riverctl set-cursor-warp on-focus-change
|
|
||||||
riverctl attach-mode bottom
|
|
||||||
riverctl spawn rivertile
|
|
||||||
riverctl default-layout rivertile
|
|
||||||
riverctl output-layout rivertile
|
|
||||||
riverctl keyboard-layout -variant dvorak-alt-intl us
|
|
||||||
riverctl input pointer-2-7-SynPS/2_Synaptics_TouchPad tap enabled
|
|
||||||
riverctl input pointer-2-7-SynPS/2_Synaptics_TouchPad drag enabled
|
|
||||||
riverctl input pointer-2-7-SynPS/2_Synaptics_TouchPad middle-emulation enabled
|
|
||||||
riverctl input pointer-2-7-SynPS/2_Synaptics_TouchPad accel-profile adaptive
|
|
||||||
|
|
||||||
|
keyboard-layout = "-variant dvorak-alt-intl us";
|
||||||
riverctl spawn "${pkgs.swaybg}/bin/swaybg -i ${../../../../images/wallpaper.png} -m fill"
|
input."pointer-2-7-SynPS/2_Synaptics_TouchPad" = {
|
||||||
|
tap = "enabled";
|
||||||
|
drag = "enabled";
|
||||||
|
middle-emulation = "enabled";
|
||||||
|
accel-profile = "adaptive";
|
||||||
|
};
|
||||||
|
|
||||||
riverctl map normal Super Return spawn footclient
|
map.normal = lib.attrsets.zipAttrs [
|
||||||
riverctl map normal Super+Shift Return zoom
|
{
|
||||||
riverctl map normal Super+Shift Q close
|
"Super" = {
|
||||||
riverctl map normal Super F toggle-fullscreen
|
Return = "spawn footclient";
|
||||||
|
Space = "toggle-float";
|
||||||
|
A = "spawn\"${pkgs.wofi-emoji}/bin/wofi-emoji\"";
|
||||||
|
F = "toggle-fullscreen";
|
||||||
|
H = "focus-output previous";
|
||||||
|
J = "focus-view previous";
|
||||||
|
K = "focus-view next";
|
||||||
|
L = "focus-output next";
|
||||||
|
O = "send-to-output next";
|
||||||
|
S = "send-to-output next";
|
||||||
|
};
|
||||||
|
"Super+Shift" = {
|
||||||
|
Return = "zoom";
|
||||||
|
Q = "close";
|
||||||
|
H = ''send-layout-cmd rivertile "main-ratio -0.05"'';
|
||||||
|
J = ''send-layout-cmd rivertile "main-count -1"'';
|
||||||
|
K = ''send-layout-cmd rivertile "main-count +1"'';
|
||||||
|
L = ''send-layout-cmd rivertile "main-ratio +0.05"'';
|
||||||
|
};
|
||||||
|
"Alt" = builtins.mapAttrs (_key: bind: "spawn " + bind) {
|
||||||
|
Space = "${pkgs.fuzzel}/bin/fuzzel";
|
||||||
|
};
|
||||||
|
"None" = builtins.mapAttrs (_key: bind: "spawn \"" + bind + "\"") {
|
||||||
|
Print = "${pkgs.sway-contrib.grimshot}/bin/grimshot copy area";
|
||||||
|
XF86Launch2 = "${pkgs.sway-contrib.grimshot}/bin/grimshot save area - | ${pkgs.swappy}/bin/swappy -f -";
|
||||||
|
XF86MonBrightnessUp = "${pkgs.light}/bin/light -A 10";
|
||||||
|
XF86MonBrightnessDown = "${pkgs.light}/bin/light -U 10";
|
||||||
|
XF86AudioMute = "${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle";
|
||||||
|
XF86AudioMicMute = "${pkgs.pulseaudio}/bin/pactl set-source-mute @DEFAULT_SOURCE@ toggle";
|
||||||
|
XF86AudioRaiseVolume = "${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +5%";
|
||||||
|
XF86AudioLowerVolume = "${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ -5%";
|
||||||
|
XF86Favorites = "${pkgs.systemd}/bin/loginctl lock-session";
|
||||||
|
XF86Messenger = "${pkgs.swaynotificationcenter}/bin/swaync-client --toggle-panel";
|
||||||
|
Cancel = "${pkgs.swaynotificationcenter}/bin/swaync-client --hide-latest";
|
||||||
|
};
|
||||||
|
"Shift" = builtins.mapAttrs (_key: bind: "spawn \"" + bind + "\"") {
|
||||||
|
XF86AudioRaiseVolume = "${pkgs.pulseaudio}/bin/pactl set-source-volume @DEFAULT_SOURCE@ +5%";
|
||||||
|
XF86AudioLowerVolume = "${pkgs.pulseaudio}/bin/pactl set-source-volume @DEFAULT_SOURCE@ -5%";
|
||||||
|
Cancel = "${pkgs.swaynotificationcenter}/bin/swaync-client --cloes-all";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
# fuckery. Encodes https://github.com/riverwm/river/blob/c474be1537c833da35682ef54194c3d6ddf1eee0/example/init#L77 in nix
|
||||||
|
(lib.attrsets.mapAttrs
|
||||||
|
(_mod: value: lib.attrsets.genAttrs (lib.lists.forEach (lib.lists.range 1 9) (num: toString num))
|
||||||
|
(tag: value + builtins.replaceStrings [ "TAG" ] [ tag ] " $((1 << (TAG - 1)))"))
|
||||||
|
{
|
||||||
|
"Super" = "set-focused-tags";
|
||||||
|
"Super+Shift" = "set-view-tags";
|
||||||
|
"Super+Control" = "toggle-focused-tags";
|
||||||
|
"Super+Shift+Control" = "toggle-view-tags";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
map-pointer.normal = {
|
||||||
|
"Super BTN_LEFT" = "move-view";
|
||||||
|
"Super BTN_RIGHT" = "resize-view";
|
||||||
|
};
|
||||||
|
|
||||||
riverctl map normal Super S send-to-output next
|
spawn = [
|
||||||
|
"rivertile"
|
||||||
riverctl map normal Super+Shift K send-layout-cmd rivertile "main-count +1"
|
];
|
||||||
riverctl map normal Super+Shift J send-layout-cmd rivertile "main-count -1"
|
|
||||||
riverctl map normal Super+Shift L send-layout-cmd rivertile "main-ratio +0.05"
|
|
||||||
riverctl map normal Super+Shift H send-layout-cmd rivertile "main-ratio -0.05"
|
|
||||||
|
|
||||||
riverctl map normal Super K focus-view next
|
|
||||||
riverctl map normal Super J focus-view previous
|
|
||||||
riverctl map normal Super L focus-output next
|
|
||||||
riverctl map normal Super H focus-output previous
|
|
||||||
riverctl map normal Super O send-to-output next
|
|
||||||
riverctl map-pointer normal Super BTN_LEFT move-view
|
|
||||||
|
|
||||||
riverctl map-pointer normal Super BTN_RIGHT resize-view
|
|
||||||
|
|
||||||
riverctl map normal Alt Space spawn "${pkgs.fuzzel}/bin/fuzzel"
|
|
||||||
riverctl map normal Alt A spawn "${pkgs.wofi-emoji}/bin/wofi-emoji";
|
|
||||||
riverctl map normal Super Space toggle-float
|
|
||||||
|
|
||||||
for i in $(seq 1 9)
|
|
||||||
do
|
|
||||||
tags=$((1 << ($i - 1)))
|
|
||||||
|
|
||||||
# Super+[1-9] to focus tag [0-8]
|
|
||||||
riverctl map normal Super $i set-focused-tags $tags
|
|
||||||
|
|
||||||
# Super+Shift+[1-9] to tag focused view with tag [0-8]
|
|
||||||
riverctl map normal Super+Shift $i set-view-tags $tags
|
|
||||||
|
|
||||||
# Super+Control+[1-9] to toggle focus of tag [0-8]
|
|
||||||
riverctl map normal Super+Control $i toggle-focused-tags $tags
|
|
||||||
|
|
||||||
# Super+Shift+Control+[1-9] to toggle tag [0-8] of focused view
|
|
||||||
riverctl map normal Super+Shift+Control $i toggle-view-tags $tags
|
|
||||||
done
|
|
||||||
|
|
||||||
riverctl map normal None Print spawn "${pkgs.sway-contrib.grimshot}/bin/grimshot copy area"
|
|
||||||
riverctl map normal None XF86Launch2 spawn "${pkgs.sway-contrib.grimshot}/bin/grimshot save area - | ${pkgs.swappy}/bin/swappy -f -"
|
|
||||||
riverctl map normal None XF86MonBrightnessUp spawn "${pkgs.light}/bin/light -A 10"
|
|
||||||
riverctl map normal None XF86MonBrightnessDown spawn "${pkgs.light}/bin/light -U 10"
|
|
||||||
riverctl map normal None XF86AudioMute spawn "${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle"
|
|
||||||
riverctl map normal None XF86AudioMicMute spawn "${pkgs.pulseaudio}/bin/pactl set-source-mute @DEFAULT_SOURCE@ toggle"
|
|
||||||
riverctl map normal None XF86AudioRaiseVolume spawn "${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +5%"
|
|
||||||
riverctl map normal None XF86AudioLowerVolume spawn "${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ -5%"
|
|
||||||
riverctl map normal Shift XF86AudioRaiseVolume spawn "${pkgs.pulseaudio}/bin/pactl set-source-volume @DEFAULT_SOURCE@ +5%"
|
|
||||||
riverctl map normal Shift XF86AudioLowerVolume spawn "${pkgs.pulseaudio}/bin/pactl set-source-volume @DEFAULT_SOURCE@ -5%"
|
|
||||||
riverctl map normal None XF86Favorites spawn "${pkgs.systemd}/bin/loginctl lock-session"
|
|
||||||
riverctl map normal None XF86Messenger spawn "${pkgs.swaynotificationcenter}/bin/swaync-client --toggle-panel"
|
|
||||||
riverctl map normal None Cancel spawn "${pkgs.swaynotificationcenter}/bin/swaync-client --hide-latest"
|
|
||||||
riverctl map normal Shift Cancel spawn "${pkgs.swaynotificationcenter}/bin/swaync-client --cloes-all"
|
|
||||||
|
|
||||||
${pkgs.dbus}/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL
|
|
||||||
systemctl --user start river-session.target
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,9 +6,6 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
config = rec {
|
config = rec {
|
||||||
startup = [
|
startup = [
|
||||||
{
|
|
||||||
command = "${lib.getExe pkgs.swaybg} -i ${../../../../images/wallpaper.png} -m fill";
|
|
||||||
}
|
|
||||||
{
|
{
|
||||||
command = "${pkgs.autotiling-rs}/bin/autotiling-rs";
|
command = "${pkgs.autotiling-rs}/bin/autotiling-rs";
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, ... }:
|
||||||
{
|
{
|
||||||
systemd.user.services.waybar.Service.Environment = "PATH=${pkgs.swaynotificationcenter}/bin";
|
systemd.user.services.waybar.Service.Environment = "PATH=${pkgs.swaynotificationcenter}/bin";
|
||||||
programs.waybar = {
|
programs.waybar = {
|
||||||
|
|
Loading…
Add table
Reference in a new issue