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 ];
23 systemd.services.home-manager-julm.postStart = ''
24 ${pkgs.nix}/bin/nix-env --delete-generations +1 --profile /nix/var/nix/profiles/per-user/julm/home-manager
27 openssh.authorizedKeys.keys = map lib.readFile [
28 # For nix -L run .#oignon.switch
29 ../users/julm/ssh/oignon.pub
35 # Put the hashedPassword in /nix/store,
36 # though /etc/shadow is not world readable...
37 # printf %s $(mkpasswd -m md5crypt)
38 hashedPassword = lib.readFile oignon/users/julm/login/hashedPassword.clear;
44 "plugdev" # For rtl-sdr
50 config.services.davfs2.davGroup
53 # If created, zfs-mount.service would require:
54 # zfs set overlay=yes ${hostName}/home
56 openssh.authorizedKeys.keys = map lib.readFile [
57 ../users/julm/ssh/losurdo.pub
61 systemd.services.nix-daemon.serviceConfig.LoadCredentialEncrypted =
62 [ ("${hostName}.key:${inputs.self}/hosts/${hostName}/nix/secret-key-files.priv.pem.cred") ];
65 secret-key-files = /run/credentials/nix-daemon.service/${hostName}.key
69 #"http://nix-localcache.losurdo.wg"
70 "ssh://nix-ssh@losurdo.wg?priority=30"
72 trusted-public-keys = map lib.readFile [
73 ../users/nix/ssh/losurdo.pub
76 nixPath = lib.mkForce [ "nixpkgs=${inputs.nixpkgs}" ];
78 #environment.etc."nixpkgs".source = pkgs.path;
79 #environment.etc."nixpkgs-overlays".source = inputs.self + "/nixpkgs";
81 nix.settings.allowed-users = [ config.users.users."nix-ssh".name ];
84 keys = map lib.readFile [
85 ../users/julm/ssh/losurdo.pub
86 ../users/julm/ssh/oignon.pub
87 ../users/sevy/ssh/patate.pub
91 environment.systemPackages = [
92 pkgs.riseup-vpn # Can't be installed by home-manager because it needs to install policy-kit rules
95 boot.extraModulePackages = [
96 #config.boot.kernelPackages.v4l2loopback
99 programs.fuse.userAllowOther = true;
101 services.davfs2.enable = true;
103 systemd.automounts = [
104 { where = "/mnt/aubergine"; automountConfig.TimeoutIdleSec = "5 min"; }
108 # Use the user's gpg-agent session to query
109 # for the password of the SSH key when auto-mounting.
111 pkgs.writeScript "sshAsUser" ''
113 exec ${pkgs.sudo}/bin/sudo -i -u "$user" \
114 ${pkgs.openssh}/bin/ssh "$@"
122 "exec" # Override "user"'s noexec
126 "ssh_command=${sshAsUser}\\040julm"
129 "x-systemd.automount"
130 #"Compression=yes" # YMMV
131 # Disconnect approximately 2*15=30 seconds after a network failure
132 "ServerAliveCountMax=1"
133 "ServerAliveInterval=15"
140 device = "${pkgs.sshfs-fuse}/bin/sshfs#julm@aubergine.wg:/";
145 device = "${pkgs.sshfs-fuse}/bin/sshfs#julm@losurdo.wg:/";
150 device = "${pkgs.sshfs-fuse}/bin/sshfs#julm@mermet.wg:/";
154 "/mnt/ilico/severine" = {
155 device = "https://nuage.ilico.org/remote.php/dav/files/severine/";
159 conf = pkgs.writeText "davfs2.conf" ''
160 backup_dir /home/julm/.local/share/davfs2/ilico/severine
161 secrets /home/julm/.davfs2/secrets
173 "x-systemd.automount"
174 "x-systemd.device-timeout=1m"
175 "x-systemd.idle-timeout=1m"
176 "x-systemd.mount-timeout=10s"
181 networking.firewall.extraCommands = ''
182 ip46tables -A nixos-fw -i wg-intra -p tcp -m tcp --dport 8000 -j ACCEPT
187 defaultMode = "online";
190 localDiscovery = false;
192 Datastore.StorageMax = "10GB";
193 Discovery.MDNS.Enabled = false;
196 #Swarm.AddrFilters = null;
198 startWhenNeeded = true;
201 services.udev.packages = [
202 # Allow the console user access the Yubikey USB device node,
203 # needed for challenge/response to work correctly.
204 pkgs.yubikey-personalization
208 layout = "fr,us(altgr-intl)";
211 # Let the session be generated by home-manager
213 name = "home-manager";
215 ${pkgs.runtimeShell} $HOME/.hm-xsession &
222 defaultSession = "home-manager";
223 #defaultSession = "none+xmonad";
224 #defaultSession = "mate";
225 #defaultSession = "cinnamon";
227 user = config.users.users.julm.name;
232 # This value determines the NixOS release with which your system is to be
233 # compatible, in order to avoid breaking some software such as database
234 # servers. You should change this only after NixOS release notes say you should.
235 system.stateVersion = "20.09"; # Did you read the comment?