]> Git — Sourcephile - julm/julm-nix.git/blob - homes/julm.nix
wireguard: fix UDP hole-punching
[julm/julm-nix.git] / homes / julm.nix
1 { pkgs, lib, config, hostName, ... }:
2 {
3 imports = [
4 ./softwares.nix
5 ./options.nix
6 julm/mutt.nix
7 (import (julm/hosts + "/${hostName}.nix"))
8 ];
9 host.base = lib.elem hostName [ "losurdo" "mermet" "oignon" ];
10 host.desktop = lib.elem hostName [ /*"losurdo"*/ "oignon" ];
11 host.server = lib.elem hostName [ "losurdo" "mermet" ];
12 host.admin = lib.elem hostName [ "losurdo" "mermet" "oignon" ];
13 host.developer = lib.elem hostName [ "losurdo" "oignon" ];
14 host.media = lib.elem hostName [ "losurdo" "oignon" ];
15 programs.bat.enable = config.host.base;
16 programs.bash.enable = config.host.base;
17 #programs.broot.enable = config.host.base;
18 programs.doom-emacs.enable = config.host.developer;
19 programs.firefox = {
20 enable = config.host.desktop;
21 profiles =
22 let defaultProfile = {
23 settings = {
24 "browser.bookmarks.showMobileBookmarks" = true;
25 "browser.search.isUS" = false;
26 "browser.search.region" = "FR";
27 "distribution.searchplugins.defaultLocale" = "fr-FR";
28 "general.useragent.locale" = "fr-FR";
29 "security.identityblock.show_extended_validation" = true;
30 "toolkit.legacyUserProfileCustomizations.stylesheets" = true;
31 };
32 userChrome = builtins.readFile softwares/firefox/userChrome.css;
33 }; in {
34 "rp4xy6ye.2021" = lib.mkMerge [defaultProfile {
35 id = 0;
36 name = "2021";
37 settings = {
38 "browser.startup.homepage" = "https://code.sourcephile.fr";
39 };
40 }];
41 "8y3d28fa.tor" = lib.mkMerge [defaultProfile {
42 id = 1;
43 name = "tor";
44 settings = {
45 "browser.startup.homepage" = "https://check.torproject.org";
46 };
47 }];
48 };
49 };
50 programs.gpg.enable = config.host.base;
51 home.file."${config.programs.gpg.homedir}/gpg.conf".text = ''
52 # julm@autogeree.net
53 trusted-key 0xD15AF7F467E8299B
54 # julm@sourcephile.fr (2021-08-12)
55 trusted-key 0xA58CD81C3863926F
56 '';
57 services.gpg-agent.enable = config.host.base;
58 services.gpg-agent.sshKeys = [
59 # julm@autogeree.net
60 "D275EBA09C7E1FFBFB47F6EEF164E6D56FB24AB2"
61 # julm@sourcephile.fr (2021-08-12)
62 "3D94D14514F1EA2B6D62F1275D888897B082415D"
63 ];
64 programs.direnv.enable = config.host.base;
65 programs.htop.enable = config.host.base;
66 programs.irssi.enable = hostName == "mermet" || hostName == "losurdo";
67 programs.irssi.extraConfig = builtins.readFile julm/irssi/config;
68 home.file.".irssi/passwd".text = ''
69 FreeNode : ${pkgs.pass}/bin/pass freenode.net/irc/julm
70 GeekNode : ${pkgs.pass}/bin/pass geeknode.org/irc/julm
71 IndyMedia : ${pkgs.pass}/bin/pass indymedia.org/irc/julm
72 Libera : ${pkgs.pass}/bin/pass libera.chat/irc/julm
73 OFTC : ${pkgs.pass}/bin/pass oftc.net/irc/julm
74 ToileLibre : ${pkgs.pass}/bin/pass toile-libre.org/irc/julm
75 '';
76 programs.man.enable = config.host.base;
77 programs.neovim.enable = config.host.developer;
78 programs.ssh.enable = config.host.base;
79 programs.ssh.matchBlocks."lan.losurdo.sourcephile.fr" = {
80 compression = true; # Helps to get a better framerate with forwardX11
81 forwardX11 = true;
82 forwardX11Trusted = true;
83 serverAliveInterval = 15;
84 };
85 programs.tmux.enable = config.host.base;
86 programs.vim.enable = config.host.base;
87 manual.manpages.enable = config.host.base;
88 programs.git = {
89 enable = config.host.base;
90 userName = "Julien Moutinho";
91 userEmail = "julm@sourcephile.fr";
92 signing.key = "0x7182433A39582282929B2A222E3618DD0D087650";
93 signing.signByDefault = false;
94 package =
95 if lib.elem hostName [ "losurdo" "oignon" ]
96 then pkgs.gitFull
97 else pkgs.gitMinimal;
98 extraConfig = {
99 sendemail.smtpEncryption = "ssl"; # Yes, "ssl", not "tls" which does not work because it expects STARTTLS.
100 sendemail.smtpServer = "mail.sourcephile.fr";
101 sendemail.smtpServerPort = "465";
102 sendemail.smtpUser = "julm@sourcephile.fr";
103 };
104 };
105 services.redshift.enable = lib.mkDefault config.host.desktop;
106 xsession.enable = lib.mkDefault config.host.desktop;
107 xsession.windowManager.xmonad.enable = lib.mkDefault config.host.desktop;
108 home.stateVersion = "20.09";
109 home.sessionPath = [ "${config.home.homeDirectory}/bin" ];
110 home.sessionVariables = {
111 EDITOR = "vim";
112 LANG = "fr_FR.UTF-8";
113 LESS = "-FRSX";
114 LOCALE_ARCHIVE = "${pkgs.glibcLocales}/lib/locale/locale-archive";
115 MANPAGER = "less";
116 };
117 # Warning: triggers a rebuild of mumble
118 #nixpkgs.config.mumble.speechdSupport = lib.mkDefault config.host.desktop;
119 home.packages =
120 lib.optionals config.host.base [
121 #pkgs.amfora
122 pkgs.bc
123 #pkgs.browsh
124 #pkgs.cabal2nix
125 pkgs.coreutils
126 pkgs.croc
127 pkgs.curl
128 #pkgs.dnsutils
129 pkgs.exa
130 pkgs.file
131 #pkgs.git-remote-gpg
132 pkgs.glib # gio
133 #pkgs.go-mtpfs
134 pkgs.gvfs
135 #pkgs.haskell.packages.ghc865.zerobin
136 pkgs.htop
137 pkgs.hwinfo
138 pkgs.inetutils
139 #pkgs.ipfs
140 #pkgs.i7z
141 pkgs.less
142 pkgs.lf
143 pkgs.lftp
144 pkgs.libfaketime
145 pkgs.libidn
146 pkgs.libxml2.bin
147 #pkgs.linuxPackages.cpupower
148 #pkgs.linuxPackages.perf
149 pkgs.lm_sensors
150 pkgs.lsof
151 pkgs.lsscsi
152 pkgs.mastodon-archive
153 #pkgs.meli
154 pkgs.mosh
155 pkgs.ncdu
156 pkgs.ncurses
157 pkgs.ntfs3g
158 #pkgs.onionshare
159 pkgs.openssl
160 pkgs.p7zip
161 pkgs.pass
162 pkgs.pastebinit
163 pkgs.pciutils
164 pkgs.poppler_utils
165 pkgs.powertop
166 pkgs.procps
167 #pkgs.profanity
168 pkgs.pv
169 #pkgs.ranger
170 #pkgs.ripgrep
171 pkgs.sanoid
172 #pkgs.sdate
173 pkgs.sshfs
174 pkgs.tcpdump
175 pkgs.tree
176 pkgs.unar
177 pkgs.unzip
178 pkgs.usbutils
179 pkgs.utillinux
180 pkgs.vbetool
181 pkgs.wget
182 pkgs.wgetpaste
183 pkgs.which
184 pkgs.xdg_utils
185 pkgs.zfs
186 ] ++ lib.optionals config.host.desktop [
187 pkgs.calibre
188 #pkgs.chromium
189 pkgs.amule
190 pkgs.dino
191 pkgs.djview
192 pkgs.dmenu
193 pkgs.evince
194 pkgs.freeciv_gtk
195 pkgs.gajim
196 pkgs.geeqie
197 pkgs.gimp
198 pkgs.glxinfo
199 pkgs.gparted
200 pkgs.gpicview
201 pkgs.hicolor-icon-theme
202 pkgs.keepass
203 pkgs.libdvdcss
204 pkgs.libreoffice
205 pkgs.liferea
206 pkgs.mpv
207 pkgs.mumble
208 pkgs.networkmanager-openvpn
209 pkgs.networkmanagerapplet
210 pkgs.nix-du
211 pkgs.pavucontrol
212 pkgs.pdftk
213 #pkgs.ristretto
214 pkgs.thunderbird
215 pkgs.transmission-gtk
216 pkgs.vlc
217 pkgs.xclip
218 (pkgs.texlive.combine { inherit (pkgs.texlive) scheme-medium xdvi ucs; })
219 #(pkgs.texlive.combine { inherit (pkgs.texlive) scheme-medium xdvi; })
220 pkgs.xorg.xkill
221 pkgs.xsane
222 pkgs.yubikey-personalization-gui
223 ] ++ lib.optionals config.host.media [
224 pkgs.aria2
225 pkgs.convmv
226 pkgs.ffmpeg
227 pkgs.imagemagick
228 pkgs.mplayer
229 pkgs.gtk-pipe-viewer
230 pkgs.podl
231 pkgs.stig
232 pkgs.yt-dlp
233 ] ++ lib.optionals config.host.admin [
234 pkgs.acpi
235 pkgs.bmon
236 pkgs.cachix
237 pkgs.cryptsetup
238 #pkgs.compsize
239 pkgs.dstat
240 pkgs.e2fsprogs
241 pkgs.ethtool
242 pkgs.knot-dns
243 pkgs.ldns
244 pkgs.miniupnpc
245 pkgs.nmon
246 pkgs.nnn
247 pkgs.parted
248 pkgs.rdfind
249 pkgs.smartmontools
250 pkgs.strace
251 pkgs.stress-ng
252 ] ++ lib.optionals config.host.developer [
253 pkgs.aspell
254 pkgs.aspellDicts.fr
255 pkgs.binutils
256 pkgs.binwalk
257 #pkgs.dracut not yet packaged
258 pkgs.git-chglog
259 pkgs.git-crypt
260 pkgs.git-quick-stats
261 pkgs.gnumake
262 pkgs.graphviz
263 pkgs.hledger
264 pkgs.hunspell
265 pkgs.hunspellDicts.fr-moderne
266 pkgs.jc
267 pkgs.jq
268 pkgs.mailutils
269 pkgs.neofetch
270 pkgs.nix-prefetch-git
271 pkgs.nixpkgs-review
272 pkgs.opusTools
273 pkgs.patchelf
274 pkgs.picocom
275 pkgs.qprint
276 pkgs.reuse
277 pkgs.shellcheck
278 pkgs.sipcalc
279 pkgs.socat
280 pkgs.sqlite
281 pkgs.tig
282 pkgs.ubootTools
283 pkgs.xmlstarlet
284 pkgs.xsel
285 pkgs.yubikey-personalization
286 ];
287 }