This repository has no description
4.9 kB
210 lines
1{
2 config,
3 lib,
4 pkgs,
5 ...
6}:
7{
8 imports = [
9 ../../alacritty.nix
10 ../../power-action.nix
11 ../../xdg-open.nix
12 ../../yubikey.nix
13 ../../pipewire.nix
14 ../../tmux.nix
15 ../../themes.nix
16 ../../fonts.nix
17 {
18 users.users.mainUser.packages = [
19 pkgs.sshuttle
20 self.packages.${pkgs.system}.mpv
21 ];
22 security.sudo.extraConfig = ''
23 lass ALL= (root) NOPASSWD:SETENV: ${pkgs.sshuttle}/bin/.sshuttle-wrapped
24 '';
25 }
26 {
27 #font magic
28 options.lass.fonts = {
29 regular = lib.mkOption {
30 type = lib.types.str;
31 default = "xft:Iosevka Term SS15:style=regular";
32 };
33 bold = lib.mkOption {
34 type = lib.types.str;
35 default = "xft:Iosevka Term SS15:style=bold";
36 };
37 italic = lib.mkOption {
38 type = lib.types.str;
39 default = "xft:Iosevka Term SS15:style=italic";
40 };
41 };
42 config.krebs.xresources.resources.X = ''
43 *.font: ${config.lass.fonts.regular}
44 *.boldFont: ${config.lass.fonts.bold}
45 *.italicFont: ${config.lass.fonts.italic}
46 '';
47 }
48 ];
49
50 users.users.mainUser.extraGroups = [
51 "audio"
52 "pipewire"
53 "video"
54 ];
55
56 time.timeZone = "Europe/Berlin";
57
58 programs.ssh.agentTimeout = "10m";
59 programs.ssh.startAgent = false;
60 services.openssh.forwardX11 = true;
61
62 environment.systemPackages = with pkgs; [
63 acpi
64 acpilight
65 ripgrep
66 cabal2nix
67 dic
68 dmenu
69 font-size
70 fzfmenu
71 gimp
72 gitAndTools.gh
73 git-crypt
74 git-preview
75 dconf
76 iodine
77 libarchive
78 lm_sensors
79 ncdu
80 nix-index
81 nixpkgs-review
82 nmap
83 pavucontrol
84 ponymix
85 powertop
86 rxvt-unicode
87 sxiv
88 nsxiv
89 taskwarrior
90 termite
91 transgui
92 wirelesstools
93 x11vnc
94 xclip
95 xorg.xmodmap
96 xorg.xhost
97 xdotool
98 xsel
99 zathura
100 flameshot
101 (pkgs.writers.writeDashBin "screenshot" ''
102 set -efu
103
104 ${pkgs.flameshot}/bin/flameshot gui &&
105 ${pkgs.klem}/bin/klem
106 '')
107 (pkgs.writers.writeDashBin "IM" ''
108 ${pkgs.mosh}/bin/mosh green.r -- tmux new-session -A -s IM -- weechat
109 '')
110 (pkgs.writers.writeDashBin "deploy_hm" ''
111 target=$1
112 shift
113
114 hm_profile=$(${pkgs.home-manager}/bin/home-manager -f ~/sync/stockholm/lass/2configs/home-manager.nix build "$@")
115 nix-copy-closure --to "$target" "$hm_profile"
116 ssh "$target" -- "$hm_profile"/activate
117 '')
118 zbar
119 ];
120
121 services.udev.extraRules = ''
122 SUBSYSTEM=="backlight", ACTION=="add", \
123 RUN+="${pkgs.coreutils}/bin/chgrp video /sys/class/backlight/%k/brightness", \
124 RUN+="${pkgs.coreutils}/bin/chmod g+w /sys/class/backlight/%k/brightness"
125 '';
126
127 services.xserver = {
128 enable = true;
129 layout = "us";
130 display = lib.mkForce 0;
131 xkbVariant = "altgr-intl";
132 xkbOptions = "caps:escape";
133 libinput.enable = true;
134 exportConfiguration = true;
135 displayManager = {
136 lightdm.enable = true;
137 defaultSession = "none+xmonad";
138 sessionCommands = ''
139 ${pkgs.xorg.xhost}/bin/xhost +LOCAL:
140 '';
141 };
142 };
143
144 nixpkgs.config.packageOverrides = _super: {
145 dmenu = pkgs.writers.writeDashBin "dmenu" ''
146 ${pkgs.fzfmenu}/bin/fzfmenu "$@"
147 '';
148 };
149
150 krebs.xresources.enable = true;
151
152 lass.klem = {
153 kpaste.script = pkgs.writeDash "kpaste-wrapper" ''
154 ${pkgs.kpaste}/bin/kpaste \
155 | ${pkgs.coreutils}/bin/tail -1 \
156 | ${pkgs.coreutils}/bin/tr -d '\r\n'
157 '';
158 go = {
159 target = "STRING";
160 script = "${pkgs.goify}/bin/goify";
161 };
162 "go.lassul.us" = {
163 target = "STRING";
164 script = pkgs.writeDash "go.lassul.us" ''
165 export GO_HOST='go.lassul.us'
166 ${pkgs.goify}/bin/goify
167 '';
168 };
169 qrcode = {
170 target = "image";
171 script = pkgs.writeDash "zbar" ''
172 ${pkgs.zbar}/bin/zbarimg -q --raw -
173 '';
174 };
175 ocr = {
176 target = "image";
177 script = pkgs.writeDash "gocr" ''
178 ${pkgs.netpbm}/bin/pngtopnm - \
179 | ${pkgs.gocr}/bin/gocr -
180 '';
181 };
182 };
183
184 services.clipmenu.enable = true;
185
186 # synchronize all the clipboards
187 systemd.user.services.autocutsel = {
188 enable = true;
189 wantedBy = [ "graphical-session.target" ];
190 after = [ "graphical-session.target" ];
191 serviceConfig = {
192 Type = "forking";
193 ExecStart = pkgs.writers.writeDash "autocutsel" ''
194 ${pkgs.autocutsel}/bin/autocutsel -fork -selection PRIMARY
195 ${pkgs.autocutsel}/bin/autocutsel -fork -selection CLIPBOARD
196 '';
197 };
198 };
199 systemd.services.xsettingsd = {
200 wantedBy = [ "multi-user.target" ];
201 after = [ "display-manager.service" ];
202 environment.DISPLAY = ":0";
203 serviceConfig = {
204 ExecStart = "${pkgs.xsettingsd}/bin/xsettingsd -c /var/theme/config/xsettings.conf";
205 User = "lass";
206 Restart = "always";
207 RestartSec = "15s";
208 };
209 };
210}