blob: a1796a86a681e3d947b5a06949f11356296b26ff (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
|
# nixos-config - My current NixOS configuration
#
# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
# SPDX-License-Identifier: GPL-3.0-or-later
#
# This file is part of my nixos-config.
#
# You should have received a copy of the License along with this program.
# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
{
lib,
pkgs,
baseLib,
qmk_firmware,
system,
...
}: {
imports = [
./hardware.nix
];
soispha = {
bluetooth = {enable = true;};
networking = {
enable = true;
hostName = "tiamat";
mode = "systemd-networkd";
};
nixpkgs = {
enable = true;
systemName = "x86_64-linux";
};
services = {
backup = {
backupDiskUuid = "c06ce163-2955-4388-b212-dfec4448fcf4";
enable = true;
};
unison.foreign.address = "apzu.fritz.box";
};
programs = {
river = {
unicodeInput.enable = true;
init = {
mappings = {
layout = "us";
keymap = let
map = key: "<Alt+Ctrl+Meta+Shift-${key}>";
in
(lib.mapAttrs' (name: value: lib.nameValuePair (map name) value) {
# Movement
"A" = {command = ["exit"];};
"B" = {command = ["close"];};
"C" = {command = ["focus-view" "previous"];};
"D" = {command = ["focus-view" "next"];};
"E" = {command = ["swap" "previous"];};
"F" = {command = ["swap" "next"];};
"G" = {command = ["zoom"];};
"H" = {command = ["toggle-fullscreen"];};
"I" = {command = ["toggle-float"];};
"J" = {command = ["send-to-output" "next"];};
"K" = {command = ["spawn" "${lib.getExe pkgs.alacritty}"];};
"L" = {command = ["spawn" "${lib.getExe pkgs.screenshot_persistent}"];};
# Audio
# "M" = {command = ["spawn" "video-pause toggle"]; modes = ["normal" "locked"]; };
"N" = {
command = ["spawn" "${lib.getExe pkgs.mpc} toggle"];
modes = ["normal" "locked"];
};
# Launcher
"O" = {command = ["spawn" "${lib.getExe pkgs.rofi} -show combi -modes combi -combi-modes 'window,drun,run' -show-icons"];};
"P" = {command = ["spawn" "${lib.getExe pkgs.tskm} open select"];};
"Q" = {command = ["spawn" "${lib.getExe pkgs.keepassxc}"];};
# "R" = {command = ["spawn" "nheko"];};
"S" = {command = ["spawn" "${lib.getExe pkgs.signal-desktop}"];};
"T" = {command = ["spawn" "${lib.getExe pkgs.lock}"];};
"U" = {command = ["focus-output" "next"];};
"V" = {command = ["focus-previous-tags"];};
"W" = {command = ["send-to-previous-tags"];};
# "X" = {command = ["spawn" "bemenu-run"];};
# "Y" = {command = ["spawn" "bemenu-run"];};
# Toggle all tags
"0" = {command = ["set-focused-tags" "${builtins.toString ((baseLib.pow 2 32) - 1)}"];};
# Support Unicode input
"Z" = {command = ["spawn" "${lib.getExe qmk_firmware.packages.${system}.qmk_unicode_type} 106 65377"];};
})
// ({
# TODO: add toggle-focus mapping
# Toggle all tags
"<Alt+Ctrl+Shift-0>" = {command = ["set-view-tags" "${builtins.toString ((baseLib.pow 2 32) - 1)}"];};
# Mouse
"<Meta-<MOUSE_LEFT>>" = {
command = ["move-view"];
map_mode = "MapMouse";
};
"<Meta-<MOUSE_RIGHT>>" = {
command = ["resize-view"];
map_mode = "MapMouse";
};
}
// (
builtins.foldl' (acc: elem: acc // elem) {} (
builtins.map (index: let
num = builtins.toString index;
index2tag = input: builtins.toString (baseLib.pow 2 (input - 1));
in {
"${map num}" = {command = ["set-focused-tags" (index2tag index)];};
"<Alt+Ctrl+Shift-${num}>" = {command = ["set-view-tags" (index2tag index)];};
# "<Super+Shift+Ctrl-${num}>" = {command = ["toggle-view-tags" (index2tag index)];};
}) (builtins.genList (i: i + 1) 9)
)
));
};
screenSetupCode = {
"DP-2" = {pos = "2560,0";};
"DP-1" = {
scale = "1.5";
pos = "0,0";
};
};
};
};
};
locale = {
enable = true;
keyMap = "us";
};
users = {
enable = true;
enableDeprecatedPlugdev = true;
hashedPassword = "$y$jFT$qi3wS9njrMl2y55b3NOBI0$j40Qt6AAkMSfZ82KPhqMaUaPztWtPps1wOqaXaF/L.6";
};
};
system.stateVersion = "23.05";
}
|