This repository has no description
4.6 kB
191 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 sshvnc
78 sxiv
79 nsxiv
80 taskwarrior
81 termite
82 transgui
83 wirelesstools
84 x11vnc
85 xclip
86 xephyrify
87 xorg.xmodmap
88 xorg.xhost
89 xdotool
90 xsel
91 zathura
92 flameshot
93 (pkgs.writers.writeDashBin "screenshot" ''
94 set -efu
95
96 ${pkgs.flameshot}/bin/flameshot gui &&
97 ${pkgs.klem}/bin/klem
98 '')
99 (pkgs.writers.writeDashBin "IM" ''
100 ${pkgs.mosh}/bin/mosh green.r -- tmux new-session -A -s IM -- weechat
101 '')
102 (pkgs.writers.writeDashBin "deploy_hm" ''
103 target=$1
104 shift
105
106 hm_profile=$(${pkgs.home-manager}/bin/home-manager -f ~/sync/stockholm/lass/2configs/home-manager.nix build "$@")
107 nix-copy-closure --to "$target" "$hm_profile"
108 ssh "$target" -- "$hm_profile"/activate
109 '')
110 zbar
111 ];
112
113 services.udev.extraRules = ''
114 SUBSYSTEM=="backlight", ACTION=="add", \
115 RUN+="${pkgs.coreutils}/bin/chgrp video /sys/class/backlight/%k/brightness", \
116 RUN+="${pkgs.coreutils}/bin/chmod g+w /sys/class/backlight/%k/brightness"
117 '';
118
119 services.xserver = {
120 enable = true;
121 layout = "us";
122 display = lib.mkForce 0;
123 xkbVariant = "altgr-intl";
124 xkbOptions = "caps:escape";
125 libinput.enable = true;
126 exportConfiguration = true;
127 displayManager = {
128 lightdm.enable = true;
129 defaultSession = "none+xmonad";
130 sessionCommands = ''
131 ${pkgs.xorg.xhost}/bin/xhost +LOCAL:
132 '';
133 };
134 };
135
136 nixpkgs.config.packageOverrides = super: {
137 dmenu = pkgs.writers.writeDashBin "dmenu" ''
138 ${pkgs.fzfmenu}/bin/fzfmenu "$@"
139 '';
140 };
141
142 krebs.xresources.enable = true;
143
144 lass.klem = {
145 kpaste.script = pkgs.writeDash "kpaste-wrapper" ''
146 ${pkgs.kpaste}/bin/kpaste \
147 | ${pkgs.coreutils}/bin/tail -1 \
148 | ${pkgs.coreutils}/bin/tr -d '\r\n'
149 '';
150 go = {
151 target = "STRING";
152 script = "${pkgs.goify}/bin/goify";
153 };
154 "go.lassul.us" = {
155 target = "STRING";
156 script = pkgs.writeDash "go.lassul.us" ''
157 export GO_HOST='go.lassul.us'
158 ${pkgs.goify}/bin/goify
159 '';
160 };
161 qrcode = {
162 target = "image";
163 script = pkgs.writeDash "zbar" ''
164 ${pkgs.zbar}/bin/zbarimg -q --raw -
165 '';
166 };
167 ocr = {
168 target = "image";
169 script = pkgs.writeDash "gocr" ''
170 ${pkgs.netpbm}/bin/pngtopnm - \
171 | ${pkgs.gocr}/bin/gocr -
172 '';
173 };
174 };
175
176 services.clipmenu.enable = true;
177
178 # synchronize all the clipboards
179 systemd.user.services.autocutsel = {
180 enable = true;
181 wantedBy = [ "graphical-session.target" ];
182 after = [ "graphical-session.target" ];
183 serviceConfig = {
184 Type = "forking";
185 ExecStart = pkgs.writers.writeDash "autocutsel" ''
186 ${pkgs.autocutsel}/bin/autocutsel -fork -selection PRIMARY
187 ${pkgs.autocutsel}/bin/autocutsel -fork -selection CLIPBOARD
188 '';
189 };
190 };
191}