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