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