diff options
Diffstat (limited to 'accounts/gkleen@sif/default.nix')
-rw-r--r-- | accounts/gkleen@sif/default.nix | 251 |
1 files changed, 251 insertions, 0 deletions
diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix new file mode 100644 index 00000000..440efa4e --- /dev/null +++ b/accounts/gkleen@sif/default.nix | |||
@@ -0,0 +1,251 @@ | |||
1 | { flake, userName, pkgs, customUtils, lib, config, ... }@inputs: | ||
2 | let | ||
3 | cfg = config.home-manager.users.${userName}; | ||
4 | xmonad = import ./xmonad pkgs.haskellPackages; | ||
5 | emacsclientDesktopItem = pkgs.makeDesktopItem { | ||
6 | name = "emacsclient"; | ||
7 | genericName = "Text Editor"; | ||
8 | desktopName = "emacsclient"; | ||
9 | icon = "emacs"; | ||
10 | mimeType = "text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;"; | ||
11 | exec = "${config.home-manager.users.${userName}.programs.emacs.package}/bin/emacsclient -a \"\" %F"; | ||
12 | }; | ||
13 | emacsScratch = pkgs.stdenv.mkDerivation rec { | ||
14 | pname = "scratch"; | ||
15 | version = "0077334cc299aa7885f804d88f52cdb1b35caf71"; | ||
16 | |||
17 | src = pkgs.fetchFromGitHub { | ||
18 | owner = "ffevotte"; | ||
19 | repo = "scratch.el"; | ||
20 | rev = version; | ||
21 | sha256 = "sha256-FUkKJ+1COGzgllzzv51yUIjMZI6slOFVExdwWl2ZEBA="; | ||
22 | }; | ||
23 | |||
24 | phases = [ "installPhase" ]; | ||
25 | |||
26 | installPhase = '' | ||
27 | mkdir -p $out/share/emacs/site-lisp | ||
28 | cp $src/scratch.el $out/share/emacs/site-lisp/default.el | ||
29 | ''; | ||
30 | }; | ||
31 | muteScript = pkgs.stdenv.mkDerivation { | ||
32 | name = "mute"; | ||
33 | src = ./scripts/mute.zsh; | ||
34 | |||
35 | buildInputs = with pkgs; [ makeWrapper ]; | ||
36 | |||
37 | phases = [ "installPhase" ]; | ||
38 | |||
39 | installPhase = '' | ||
40 | mkdir -p $out/bin | ||
41 | install -m 0755 $src $out/bin/mute | ||
42 | wrapProgram $out/bin/mute \ | ||
43 | --prefix PATH : ${pkgs.zsh}/bin \ | ||
44 | --prefix PATH : ${pkgs.findutils}/bin \ | ||
45 | --prefix PATH : ${pkgs.util-linux}/bin \ | ||
46 | --prefix PATH : ${pkgs.coreutils}/bin \ | ||
47 | --prefix PATH : ${pkgs.pulseaudio}/bin | ||
48 | ''; | ||
49 | }; | ||
50 | in { | ||
51 | imports = with flake.nixosModules.userProfiles.${userName}; [ | ||
52 | mpv | ||
53 | ]; | ||
54 | |||
55 | home-manager.users.${userName} = { | ||
56 | programs = { | ||
57 | ssh = { | ||
58 | matchBlocks = import ./ssh-hosts.nix; # customUtils.nixImport { dir = ./ssh-hosts; }; | ||
59 | extraConfig = '' | ||
60 | Match host uniworx3.ifi.lmu.de,uniworx4.ifi.lmu.de,uniworx5.ifi.lmu.de,uni2workgw.ifi.lmu.de,blackbeard.tcs.ifi.lmu.de,gitlab2.rz.ifi.lmu.de,oregon.tcs.ifi.lmu.de !exec "nc -z -w 1 %h %p &>/dev/null" | ||
61 | ProxyJump remote.cip.ifi.lmu.de | ||
62 | |||
63 | Host * | ||
64 | ''; | ||
65 | }; | ||
66 | |||
67 | emacs = { | ||
68 | enable = true; | ||
69 | extraPackages = epkgs: with epkgs; [ | ||
70 | evil evil-dvorak undo-tree magit haskell-mode | ||
71 | nix-mode yaml-mode json-mode shakespeare-mode | ||
72 | smart-mode-line highlight-parentheses highlight-symbol | ||
73 | notmuch ag sass-mode lua-mode fira-code-mode use-package | ||
74 | use-package-ensure-system-package git-gutter emacsScratch | ||
75 | ]; | ||
76 | }; | ||
77 | firefox = { | ||
78 | enable = true; | ||
79 | profiles.default = { | ||
80 | settings = { | ||
81 | "layout.css.devPixelsPerPx" = "1.75"; | ||
82 | "browser.tabs.drawInTitlebar" = false; | ||
83 | "toolkit.legacyUserProfileCustomizations.stylesheets" = true; | ||
84 | "dom.security.https_only_mode" = true; | ||
85 | }; | ||
86 | }; | ||
87 | }; | ||
88 | |||
89 | urxvt = { | ||
90 | enable = true; | ||
91 | package = pkgs.rxvt_unicode-with-plugins; | ||
92 | fonts = [ "xft:FiraCode Nerd Font Mono:style=Regular:pixelsize=21" ]; | ||
93 | scroll = { | ||
94 | lines = 0; | ||
95 | bar.enable = false; | ||
96 | }; | ||
97 | extraConfig = { | ||
98 | urgentOnBell = false; | ||
99 | print-pipe = "cat >/dev/null"; | ||
100 | perl-ext-common = "52-osc,url-select"; | ||
101 | "url-select.launcher" = "firefox"; | ||
102 | "url-select.underline" = true; | ||
103 | }; | ||
104 | keybindings = { | ||
105 | "M-u" = "perl:url-select:select_next"; | ||
106 | }; | ||
107 | }; | ||
108 | |||
109 | zathura = { | ||
110 | enable = true; | ||
111 | package = pkgs.zathura.override { useMupdf = false; }; | ||
112 | }; | ||
113 | |||
114 | mpv.config = { | ||
115 | demuxer-max-bytes = 1073741824; | ||
116 | demuxer-max-back-bytes = 268435456; | ||
117 | }; | ||
118 | |||
119 | autorandr = { | ||
120 | enable = true; | ||
121 | hooks.postswitch = { | ||
122 | # "restart-compton" = "${pkgs.systemd}/bin/systemctl --user try-restart picom"; | ||
123 | "restart-trays" = '' | ||
124 | ${pkgs.coreutils}/bin/sleep 5 | ||
125 | ${pkgs.systemd}/bin/systemctl --user try-restart trayer xmobar | ||
126 | ''; | ||
127 | }; | ||
128 | profiles = customUtils.nixImport { dir = ./autorandr-profiles; }; | ||
129 | }; | ||
130 | |||
131 | zsh.initExtra = "source ${./zshrc}"; | ||
132 | zsh.dirHashes = { | ||
133 | u2w = "$HOME/projects/uni2work"; | ||
134 | docs = "$HOME/documents"; | ||
135 | dl = "$HOME/Downloads"; | ||
136 | flk = "$HOME/config/nixos-flakes"; | ||
137 | fsk-timi = "$HOME/projects/21s/fsk-timi"; | ||
138 | }; | ||
139 | |||
140 | obs-studio = { | ||
141 | enable = true; | ||
142 | plugins = with pkgs; [obs-v4l2sink]; | ||
143 | }; | ||
144 | }; | ||
145 | |||
146 | services = { | ||
147 | dunst = { | ||
148 | settings = import ./dunst-settings.nix inputs; | ||
149 | iconTheme = cfg.gtk.iconTheme; | ||
150 | enable = true; | ||
151 | }; | ||
152 | emacs.enable = true; | ||
153 | gpg-agent = { | ||
154 | enable = true; | ||
155 | enableSshSupport = true; | ||
156 | extraConfig = '' | ||
157 | pinentry-program ${pkgs.pinentry-gtk2}/bin/pinentry | ||
158 | grab | ||
159 | ''; | ||
160 | }; | ||
161 | pasystray.enable = true; | ||
162 | udiskie = { | ||
163 | enable = true; | ||
164 | automount = false; | ||
165 | }; | ||
166 | unclutter = { | ||
167 | enable = true; | ||
168 | timeout = 5; | ||
169 | }; | ||
170 | network-manager-applet.enable = true; | ||
171 | blueman-applet.enable = true; | ||
172 | |||
173 | sxhkd = { | ||
174 | enable = true; | ||
175 | keybindings = { | ||
176 | "button8" = "${muteScript}/bin/mute unmute"; | ||
177 | "@button8" = "${muteScript}/bin/mute mute"; | ||
178 | "button9" = "${pkgs.pulseaudio}/bin/pacmd set-sink-mute @DEFAULT_SINK@ 1"; | ||
179 | "@button9" = "${pkgs.pulseaudio}/bin/pacmd set-sink-mute @DEFAULT_SINK@ 0"; | ||
180 | }; | ||
181 | }; | ||
182 | }; | ||
183 | |||
184 | gtk = { | ||
185 | enable = true; | ||
186 | font.name = "DejaVu Sans 6"; | ||
187 | theme = { | ||
188 | package = pkgs.equilux-theme; | ||
189 | name = "Equilux-compact"; | ||
190 | }; | ||
191 | iconTheme = { | ||
192 | package = pkgs.paper-icon-theme; | ||
193 | name = "Paper"; | ||
194 | }; | ||
195 | }; | ||
196 | |||
197 | xsession = { | ||
198 | enable = true; | ||
199 | |||
200 | windowManager.command = "${xmonad}/bin/xmonad"; | ||
201 | |||
202 | initExtra = let | ||
203 | lockScript = pkgs.writeScript "lock" '' | ||
204 | #!${pkgs.stdenv.shell} | ||
205 | ${pkgs.playerctl}/bin/playerctl -a pause | ||
206 | exec ${pkgs.xsecurelock}/bin/xsecurelock | ||
207 | ''; | ||
208 | in '' | ||
209 | ${pkgs.coreutils}/bin/env XSECURELOCK_WANT_FIRST_KEYPRESS=1 XSECURELOCK_DIM_ALPHA=1 ${pkgs.xss-lock}/bin/xss-lock -l -n ${pkgs.xsecurelock}/libexec/xsecurelock/dimmer -- ${lockScript} & | ||
210 | ${pkgs.xorg.xinput}/bin/xinput disable 'Synaptics TM3512-010' | ||
211 | ${pkgs.xorg.xset}/bin/xset s 590 10 | ||
212 | ''; | ||
213 | }; | ||
214 | |||
215 | xresources.properties = import ./xresources.nix; | ||
216 | |||
217 | home = { | ||
218 | packages = with pkgs; [ | ||
219 | fira-code powerline-fonts nerdfonts pavucontrol keepassxc | ||
220 | youtube-dl sxiv xclip mumble pulseaudio-ctl libnotify synergy | ||
221 | xorg.xbacklight screen-message pidgin-with-plugins | ||
222 | google-play-music-desktop-player qt5ct playerctl evince | ||
223 | thunderbird zulip zoom-us steam steam-run wireshark skype | ||
224 | virt-manager rclone cached-nix-shell xournal discord xmonad | ||
225 | worktime fira-code-symbols emacsclientDesktopItem libreoffice | ||
226 | xournalpp | ||
227 | ]; | ||
228 | |||
229 | file = { | ||
230 | ".emacs".source = ./emacs.el; | ||
231 | ".backup-munin".source = ./backup-patterns; | ||
232 | ".mozilla/firefox/default/chrome/userChrome.css".source = ./firefox-chrome.css; | ||
233 | ".mozilla/firefox/default/chrome/userContent.css".source = ./firefox-content.css; | ||
234 | }; | ||
235 | |||
236 | sessionVariables = { | ||
237 | GDK_SCALE = 96.0 / 282.0; | ||
238 | QT_AUTO_SCREEN_SCALE_FACTOR = 1; | ||
239 | QT_QPA_PLATFORMTHEME = "qt5ct"; | ||
240 | }; | ||
241 | |||
242 | extraProfileCommands = '' | ||
243 | export XDG_DATA_DIRS="${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}:${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}''${XDG_DATA_DIRS:+:''${XDG_DATA_DIRS}}" | ||
244 | ''; | ||
245 | }; | ||
246 | |||
247 | fonts.fontconfig.enable = true; | ||
248 | |||
249 | systemd.user = import ./systemd.nix inputs; | ||
250 | }; | ||
251 | } | ||