This repository has no description
4.0 kB
162 lines
1{
2 self,
3 config,
4 lib,
5 pkgs,
6 ...
7}:
8let
9 stockholmPkgs = self.inputs.stockholm.packages.${pkgs.stdenv.hostPlatform.system};
10in
11{
12 imports = [
13 ../../alacritty.nix
14 ../../xdg-open.nix
15 ../../yubikey.nix
16 ../../pipewire.nix
17 ../../themes.nix
18 ../../fonts.nix
19 {
20 users.users.mainUser.packages = [
21 pkgs.sshuttle
22 self.packages.${pkgs.system}.mpv
23 ];
24 security.sudo.extraConfig = ''
25 lass ALL= (root) NOPASSWD:SETENV: ${pkgs.sshuttle}/bin/.sshuttle-wrapped
26 '';
27 }
28 {
29 #font magic
30 options.lass.fonts = {
31 regular = lib.mkOption {
32 type = lib.types.str;
33 default = "xft:Iosevka Term SS15:style=regular";
34 };
35 bold = lib.mkOption {
36 type = lib.types.str;
37 default = "xft:Iosevka Term SS15:style=bold";
38 };
39 italic = lib.mkOption {
40 type = lib.types.str;
41 default = "xft:Iosevka Term SS15:style=italic";
42 };
43 };
44 config.services.xserver.displayManager.sessionCommands =
45 let
46 xres = pkgs.writeText "xreources" ''
47 *.font: ${config.lass.fonts.regular}
48 *.boldFont: ${config.lass.fonts.bold}
49 *.italicFont: ${config.lass.fonts.italic}
50 '';
51 in
52 ''
53 ${pkgs.xorg.xrdb}/bin/xrdb -merge ${xres}
54 '';
55 }
56 ];
57
58 users.users.mainUser.extraGroups = [
59 "audio"
60 "video"
61 ];
62
63 time.timeZone = "Europe/Berlin";
64
65 programs.ssh.agentTimeout = "10m";
66 programs.ssh.startAgent = false;
67 services.openssh.forwardX11 = true;
68
69 environment.systemPackages = with pkgs; [
70 acpi
71 acpilight
72 ripgrep
73 dmenu
74 stockholmPkgs.fzfmenu
75 dconf
76 libarchive
77 ncdu
78 nix-index
79 nixpkgs-review
80 nmap
81 pavucontrol
82 sxiv
83 nsxiv
84 wirelesstools
85 x11vnc
86 xclip
87 xorg.xmodmap
88 xorg.xhost
89 xdotool
90 xsel
91 zathura
92 flameshot
93 (pkgs.writers.writeDashBin "screenshot" ''
94 ${pkgs.flameshot}/bin/flameshot gui
95 '')
96 (pkgs.writers.writeDashBin "deploy_hm" ''
97 target=$1
98 shift
99
100 hm_profile=$(${pkgs.home-manager}/bin/home-manager -f ~/sync/stockholm/lass/2configs/home-manager.nix build "$@")
101 nix-copy-closure --to "$target" "$hm_profile"
102 ssh "$target" -- "$hm_profile"/activate
103 '')
104 zbar
105 ];
106
107 services.udev.extraRules = ''
108 SUBSYSTEM=="backlight", ACTION=="add", \
109 RUN+="${pkgs.coreutils}/bin/chgrp video /sys/class/backlight/%k/brightness", \
110 RUN+="${pkgs.coreutils}/bin/chmod g+w /sys/class/backlight/%k/brightness"
111 '';
112
113 services.xserver = {
114 enable = true;
115 layout = "us";
116 display = lib.mkForce 0;
117 xkbVariant = "altgr-intl";
118 xkbOptions = "caps:escape";
119 libinput.enable = true;
120 exportConfiguration = true;
121 displayManager = {
122 lightdm.enable = true;
123 defaultSession = "none+xmonad";
124 sessionCommands = ''
125 ${pkgs.xorg.xhost}/bin/xhost +LOCAL:
126 '';
127 };
128 };
129
130 nixpkgs.config.packageOverrides = _super: {
131 dmenu = pkgs.writers.writeDashBin "dmenu" ''
132 ${stockholmPkgs.fzfmenu}/bin/fzfmenu "$@"
133 '';
134 };
135
136 services.clipmenu.enable = true;
137
138 # synchronize all the clipboards
139 systemd.user.services.autocutsel = {
140 enable = true;
141 wantedBy = [ "graphical-session.target" ];
142 after = [ "graphical-session.target" ];
143 serviceConfig = {
144 Type = "forking";
145 ExecStart = pkgs.writers.writeDash "autocutsel" ''
146 ${pkgs.autocutsel}/bin/autocutsel -fork -selection PRIMARY
147 ${pkgs.autocutsel}/bin/autocutsel -fork -selection CLIPBOARD
148 '';
149 };
150 };
151 systemd.services.xsettingsd = {
152 wantedBy = [ "multi-user.target" ];
153 after = [ "display-manager.service" ];
154 environment.DISPLAY = ":0";
155 serviceConfig = {
156 ExecStart = "${pkgs.xsettingsd}/bin/xsettingsd -c /var/theme/config/xsettings.conf";
157 User = "lass";
158 Restart = "always";
159 RestartSec = "15s";
160 };
161 };
162}