1 { config, pkgs, lib, inputs, hostName, ... }:
4 ../nixos/profiles/builder.nix
5 ../nixos/profiles/debug.nix
6 ../nixos/profiles/graphical.nix
7 ../nixos/profiles/irssi.nix
8 ../nixos/profiles/lang-fr.nix
9 ../nixos/profiles/printing.nix
10 ../nixos/profiles/radio.nix
11 ../nixos/profiles/tor.nix
17 # Lower kernel's security for better performances
18 boot.kernelParams = [ "mitigations=off" ];
20 home-manager.users.julm = {
21 imports = [ ../homes/julm.nix ];
24 openssh.authorizedKeys.keys = map lib.readFile [
25 # For nix -L run .#oignon.switch
26 ../users/julm/ssh/oignon.pub
32 # Put the hashedPassword in /nix/store,
33 # though /etc/shadow is not world readable...
34 # printf %s $(mkpasswd -m md5crypt)
35 hashedPassword = lib.readFile oignon/users/julm/login/hashedPassword.clear;
41 "plugdev" # For rtl-sdr
47 config.services.davfs2.davGroup
50 # If created, zfs-mount.service would require:
51 # zfs set overlay=yes ${hostName}/home
53 openssh.authorizedKeys.keys = map lib.readFile [
54 ../users/julm/ssh/losurdo.pub
58 systemd.services.nix-daemon.serviceConfig.LoadCredentialEncrypted =
59 [ ("${hostName}.key:${inputs.self}/hosts/${hostName}/nix/secret-key-files.priv.pem.cred") ];
62 secret-key-files = /run/credentials/nix-daemon.service/${hostName}.key
66 #"http://nix-localcache.losurdo.wg"
67 "ssh://nix-ssh@losurdo.wg?priority=30"
69 trusted-public-keys = map lib.readFile [
70 ../users/nix/ssh/losurdo.pub
73 nixPath = lib.mkForce [ "nixpkgs=${inputs.nixpkgs}" ];
75 #environment.etc."nixpkgs".source = pkgs.path;
76 #environment.etc."nixpkgs-overlays".source = inputs.self + "/nixpkgs";
78 nix.settings.allowed-users = [ config.users.users."nix-ssh".name ];
81 keys = map lib.readFile [
82 ../users/julm/ssh/losurdo.pub
83 ../users/julm/ssh/oignon.pub
84 ../users/sevy/ssh/patate.pub
88 environment.systemPackages = [
89 pkgs.riseup-vpn # Can't be installed by home-manager because it needs to install policy-kit rules
92 boot.extraModulePackages = [
93 #config.boot.kernelPackages.v4l2loopback
96 programs.fuse.userAllowOther = true;
98 services.davfs2.enable = true;
100 systemd.automounts = [
101 { where = "/mnt/aubergine"; automountConfig.TimeoutIdleSec = "5 min"; }
105 # Use the user's gpg-agent session to query
106 # for the password of the SSH key when auto-mounting.
108 pkgs.writeScript "sshAsUser" ''
110 exec ${pkgs.sudo}/bin/sudo -i -u "$user" \
111 ${pkgs.openssh}/bin/ssh "$@"
119 "exec" # Override "user"'s noexec
123 "ssh_command=${sshAsUser}\\040julm"
126 "x-systemd.automount"
127 #"Compression=yes" # YMMV
128 # Disconnect approximately 2*15=30 seconds after a network failure
129 "ServerAliveCountMax=1"
130 "ServerAliveInterval=15"
137 device = "${pkgs.sshfs-fuse}/bin/sshfs#julm@aubergine.wg:/";
142 device = "${pkgs.sshfs-fuse}/bin/sshfs#julm@losurdo.wg:/";
147 device = "${pkgs.sshfs-fuse}/bin/sshfs#julm@mermet.wg:/";
151 "/mnt/ilico/severine" = {
152 device = "https://nuage.ilico.org/remote.php/dav/files/severine/";
156 conf = pkgs.writeText "davfs2.conf" ''
157 backup_dir /home/julm/.local/share/davfs2/ilico/severine
158 secrets /home/julm/.davfs2/secrets
170 "x-systemd.automount"
171 "x-systemd.device-timeout=1m"
172 "x-systemd.idle-timeout=1m"
173 "x-systemd.mount-timeout=10s"
178 networking.firewall.extraCommands = ''
179 ip46tables -A nixos-fw -i wg-intra -p tcp -m tcp --dport 8000 -j ACCEPT
184 defaultMode = "online";
187 localDiscovery = false;
189 Datastore.StorageMax = "10GB";
190 Discovery.MDNS.Enabled = false;
193 #Swarm.AddrFilters = null;
195 startWhenNeeded = true;
198 services.udev.packages = [
199 # Allow the console user access the Yubikey USB device node,
200 # needed for challenge/response to work correctly.
201 pkgs.yubikey-personalization
205 layout = "fr,us(altgr-intl)";
208 # Let the session be generated by home-manager
210 name = "home-manager";
212 ${pkgs.runtimeShell} $HOME/.hm-xsession &
219 defaultSession = "home-manager";
220 #defaultSession = "none+xmonad";
221 #defaultSession = "mate";
222 #defaultSession = "cinnamon";
224 user = config.users.users.julm.name;
229 # This value determines the NixOS release with which your system is to be
230 # compatible, in order to avoid breaking some software such as database
231 # servers. You should change this only after NixOS release notes say you should.
232 system.stateVersion = "20.09"; # Did you read the comment?