]> Git — Sourcephile - julm/julm-nix.git/blob - homes/julm.nix
julm: ssh: manage keys imperatively
[julm/julm-nix.git] / homes / julm.nix
1 {
2 pkgs,
3 lib,
4 config,
5 hostName,
6 ...
7 }:
8 {
9 imports = [
10 ../home-manager/profiles/essential.nix
11 ../home-manager/profiles/vim.nix
12 ../home-manager/options.nix
13 julm/mutt.nix
14 (import (julm/hosts + "/${hostName}.nix"))
15 ];
16 programs.bash.shellAliases = {
17 firefox-calyx = "sudo systemd-run -P -p JoinsNamespaceOf=netns-calyx.service -p PrivateNetwork=true -p BindReadOnlyPaths=/etc/netns/calyx/resolv.conf:/etc/resolv.conf -E DISPLAY=$DISPLAY -p User=julm -E DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS -E LANG=$LANG -E LOCALE_ARCHIVE=$LOCALE_ARCHIVE -E PATH=$PATH -- firefox -P calyx";
18 };
19 programs.browserpass.enable = config.programs.firefox.enable;
20 programs.firefox.profiles =
21 let
22 defaultProfile = {
23 settings = {
24 "browser.bookmarks.showMobileBookmarks" = true;
25 "browser.compactmode.show" = true;
26 "browser.search.isUS" = false;
27 "browser.search.region" = "FR";
28 "distribution.searchplugins.defaultLocale" = "fr-FR";
29 "dom.security.https_first" = true;
30 "dom.security.https_only_mode" = true;
31 "general.useragent.locale" = "fr-FR";
32 "privacy.globalprivacycontrol.enabled" = true;
33 "privacy.globalprivacycontrol.functionality.enabled" = true;
34 "security.identityblock.show_extended_validation" = true;
35 "toolkit.legacyUserProfileCustomizations.stylesheets" = true;
36 #"privacy.firstparty.isolate" = true;
37 };
38 userChrome = lib.readFile ../home-manager/profiles/firefox/userChrome.css;
39 };
40 in
41 {
42 "rD9bggx0.2025" = lib.mkMerge [
43 defaultProfile
44 {
45 id = 0;
46 name = "2025";
47 settings = {
48 "browser.startup.homepage" = "https://democracynow.org";
49 };
50 }
51 ];
52 "8y3d28fa.tor" = lib.mkMerge [
53 defaultProfile
54 {
55 id = 1;
56 name = "tor";
57 settings = {
58 "browser.startup.homepage" = "https://check.torproject.org";
59 "privacy.firstparty.isolate" = true;
60 };
61 }
62 ];
63 "zqa1ck7d.calyx" = lib.mkMerge [
64 defaultProfile
65 {
66 id = 2;
67 name = "calyx";
68 settings = {
69 "browser.startup.homepage" = "https://icanhazip.com";
70 "privacy.firstparty.isolate" = true;
71 };
72 }
73 ];
74 "0yplujgj.2022" = lib.mkMerge [
75 defaultProfile
76 {
77 id = 4;
78 name = "2022";
79 settings = {
80 "browser.startup.homepage" = "https://democracynow.org";
81 };
82 }
83 ];
84 };
85 home.file."${config.programs.gpg.homedir}/gpg.conf".text = ''
86 # julm@autogeree.net
87 trusted-key 0xD15AF7F467E8299B
88 # julm@sourcephile.fr (2021-08-12)
89 trusted-key 0xA58CD81C3863926F
90 '';
91 # ExplanationNote: manage SSH keys imperatively for more flexibility
92 #services.gpg-agent.sshKeys = [ ];
93 programs.irssi.extraConfig = lib.readFile julm/irssi/irssi.conf;
94 xdg.configFile."doom/config.el".text = lib.readFile julm/emacs/config.el;
95 home.file.".irssi/passwd" = lib.mkIf config.programs.irssi.enable {
96 text = ''
97 FreeNode : ${pkgs.pass}/bin/pass freenode.net/irc/julm
98 GeekNode : ${pkgs.pass}/bin/pass geeknode.org/irc/julm
99 IndyMedia : ${pkgs.pass}/bin/pass indymedia.org/irc/julm
100 Libera : ${pkgs.pass}/bin/pass libera.chat/irc/julm
101 OFTC : ${pkgs.pass}/bin/pass oftc.net/irc/julm
102 ToileLibre : ${pkgs.pass}/bin/pass toile-libre.org/irc/julm
103 '';
104 };
105 programs.ssh.matchBlocks = {
106 "aubergine.sp" = {
107 #compression = true; # Helps to get a better framerate with forwardX11
108 forwardAgent = true;
109 forwardX11 = true;
110 forwardX11Trusted = true;
111 serverAliveInterval = 15;
112 extraOptions = {
113 Ciphers = "aes128-gcm@openssh.com";
114 };
115 };
116 "blackberry.sp" = {
117 user = "julm";
118 };
119 "courge.sp" = {
120 user = "mo";
121 };
122 "patate.sp" = {
123 user = "sevy";
124 };
125 }
126 // lib.genAttrs [ "lan.losurdo.sourcephile.fr" "losurdo.sp" ] (_: {
127 compression = true; # Helps to get a better framerate with forwardX11
128 forwardX11 = true;
129 forwardX11Trusted = true;
130 serverAliveInterval = 15;
131 });
132 programs.git = {
133 userName = "Julien Moutinho";
134 userEmail = "julm@sourcephile.fr";
135 signing.key = "0x4FE467034C11017B429BAC53A58CD81C3863926F";
136 signing.signByDefault = false;
137 extraConfig = {
138 sendemail.smtpEncryption = "ssl"; # Yes, "ssl", not "tls" which does not work because it expects STARTTLS.
139 sendemail.smtpServer = "mail.sourcephile.fr";
140 sendemail.smtpServerPort = "465";
141 sendemail.smtpUser = "julm@sourcephile.fr";
142 };
143 };
144 }