summaryrefslogtreecommitdiff
path: root/accounts/gkleen@sif/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'accounts/gkleen@sif/default.nix')
-rw-r--r--accounts/gkleen@sif/default.nix236
1 files changed, 236 insertions, 0 deletions
diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix
new file mode 100644
index 00000000..a318a8ee
--- /dev/null
+++ b/accounts/gkleen@sif/default.nix
@@ -0,0 +1,236 @@
1{ flake, userName, pkgs, customUtils, lib, config, ... }@inputs:
2let
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 };
50in {
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 alacritty = {
90 enable = true;
91 settings = import ./alacritty.nix;
92 };
93
94 zathura = {
95 enable = true;
96 package = pkgs.zathura.override { useMupdf = false; };
97 };
98
99 mpv.config = {
100 demuxer-max-bytes = 1073741824;
101 demuxer-max-back-bytes = 268435456;
102 };
103
104 autorandr = {
105 enable = true;
106 hooks.postswitch = {
107 # "restart-compton" = "${pkgs.systemd}/bin/systemctl --user try-restart picom";
108 "restart-trays" = ''
109 ${pkgs.coreutils}/bin/sleep 5
110 ${pkgs.systemd}/bin/systemctl --user try-restart trayer xmobar
111 '';
112 };
113 profiles = customUtils.nixImport { dir = ./autorandr-profiles; };
114 };
115
116 zsh.initExtra = "source ${./zshrc}";
117 zsh.dirHashes = {
118 u2w = "$HOME/projects/uni2work";
119 docs = "$HOME/documents";
120 dl = "$HOME/Downloads";
121 flk = "$HOME/config/nixos-flakes";
122 fsk-timi = "$HOME/projects/21s/fsk-timi";
123 };
124
125 obs-studio = {
126 enable = true;
127 plugins = with pkgs; [obs-v4l2sink];
128 };
129 };
130
131 services = {
132 dunst = {
133 settings = import ./dunst-settings.nix inputs;
134 iconTheme = cfg.gtk.iconTheme;
135 enable = true;
136 };
137 emacs.enable = true;
138 gpg-agent = {
139 enable = true;
140 enableSshSupport = true;
141 extraConfig = ''
142 pinentry-program ${pkgs.pinentry-gtk2}/bin/pinentry
143 grab
144 '';
145 };
146 pasystray.enable = true;
147 udiskie = {
148 enable = true;
149 automount = false;
150 };
151 unclutter = {
152 enable = true;
153 timeout = 5;
154 };
155 network-manager-applet.enable = true;
156 blueman-applet.enable = true;
157
158 sxhkd = {
159 enable = true;
160 keybindings = {
161 "button8" = "${muteScript}/bin/mute unmute";
162 "@button8" = "${muteScript}/bin/mute mute";
163 "button9" = "${pkgs.pulseaudio}/bin/pacmd set-sink-mute @DEFAULT_SINK@ 1";
164 "@button9" = "${pkgs.pulseaudio}/bin/pacmd set-sink-mute @DEFAULT_SINK@ 0";
165 };
166 };
167 };
168
169 gtk = {
170 enable = true;
171 font.name = "DejaVu Sans 6";
172 theme = {
173 package = pkgs.equilux-theme;
174 name = "Equilux-compact";
175 };
176 iconTheme = {
177 package = pkgs.paper-icon-theme;
178 name = "Paper";
179 };
180 };
181
182 xsession = {
183 enable = true;
184
185 windowManager.command = "${xmonad}/bin/xmonad";
186
187 initExtra = let
188 lockScript = pkgs.writeScript "lock" ''
189 #!${pkgs.stdenv.shell}
190 ${pkgs.playerctl}/bin/playerctl -a pause
191 exec ${pkgs.xsecurelock}/bin/xsecurelock
192 '';
193 in ''
194 ${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} &
195 ${pkgs.xorg.xinput}/bin/xinput disable 'Synaptics TM3512-010'
196 ${pkgs.xorg.xset}/bin/xset s 590 10
197 '';
198 };
199
200 xresources.properties = import ./xresources.nix;
201
202 home = {
203 packages = with pkgs; [
204 fira-code powerline-fonts nerdfonts pavucontrol keepassxc
205 youtube-dl sxiv xclip mumble pulseaudio-ctl libnotify synergy
206 xorg.xbacklight screen-message pidgin-with-plugins
207 google-play-music-desktop-player qt5ct playerctl evince
208 thunderbird zulip zoom-us steam steam-run wireshark skype
209 virt-manager rclone cached-nix-shell xournal discord xmonad
210 worktime fira-code-symbols emacsclientDesktopItem libreoffice
211 xournalpp
212 ];
213
214 file = {
215 ".emacs".source = ./emacs.el;
216 ".backup-munin".source = ./backup-patterns;
217 ".mozilla/firefox/default/chrome/userChrome.css".source = ./firefox-chrome.css;
218 ".mozilla/firefox/default/chrome/userContent.css".source = ./firefox-content.css;
219 };
220
221 sessionVariables = {
222 GDK_SCALE = 96.0 / 282.0;
223 QT_AUTO_SCREEN_SCALE_FACTOR = 1;
224 QT_QPA_PLATFORMTHEME = "qt5ct";
225 };
226
227 extraProfileCommands = ''
228 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}}"
229 '';
230 };
231
232 fonts.fontconfig.enable = true;
233
234 systemd.user = import ./systemd.nix inputs;
235 };
236}