1 { config, pkgs, lib, inputs, hostName, ... }:
4 ../nixos/profiles/builder.nix
5 ../nixos/profiles/debug.nix
6 ../nixos/profiles/graphical.nix
7 ../nixos/profiles/lang-fr.nix
8 ../nixos/profiles/printing.nix
9 ../nixos/profiles/tor.nix
10 ../nixos/profiles/irssi.nix
16 # Lower kernel's security for better performances
17 boot.kernelParams = [ "mitigations=off" ];
19 home-manager.users.julm = {
20 imports = [ ../homes/julm.nix ];
22 systemd.services.home-manager-julm.postStart = ''
23 ${pkgs.nix}/bin/nix-env --delete-generations +1 --profile /nix/var/nix/profiles/per-user/julm/home-manager
26 openssh.authorizedKeys.keys = map lib.readFile [
27 # For nix -L run .#oignon.switch
28 ../users/julm/ssh/oignon.pub
34 # Put the hashedPassword in /nix/store,
35 # though /etc/shadow is not world readable...
36 # printf %s $(mkpasswd -m md5crypt)
37 hashedPassword = lib.readFile oignon/users/julm/login/hashedPassword.clear;
48 config.services.davfs2.davGroup
51 # If created, zfs-mount.service would require:
52 # zfs set overlay=yes ${hostName}/home
54 openssh.authorizedKeys.keys = map lib.readFile [
55 ../users/julm/ssh/losurdo.pub
59 systemd.services.nix-daemon.serviceConfig.LoadCredentialEncrypted =
60 [ ("${hostName}.key:${inputs.self}/hosts/${hostName}/nix/secret-key-files.priv.pem.cred") ];
63 secret-key-files = /run/credentials/nix-daemon.service/${hostName}.key
66 trusted-users = [ config.users.users."julm".name ];
68 #"http://nix-localcache.losurdo.wg"
69 "ssh://nix-ssh@losurdo.wg?priority=30"
71 trusted-public-keys = map lib.readFile [
72 ../users/nix/ssh/losurdo.pub
75 nixPath = lib.mkForce [ "nixpkgs=${inputs.nixpkgs}" ];
77 #environment.etc."nixpkgs".source = pkgs.path;
78 #environment.etc."nixpkgs-overlays".source = inputs.self + "/nixpkgs";
80 nix.settings.allowed-users = [ config.users.users."nix-ssh".name ];
83 keys = map lib.readFile [
84 ../users/julm/ssh/losurdo.pub
85 ../users/julm/ssh/oignon.pub
86 ../users/sevy/ssh/patate.pub
90 environment.systemPackages = [
91 pkgs.riseup-vpn # Can't be installed by home-manager because it needs to install policy-kit rules
94 boot.extraModulePackages = [
95 #config.boot.kernelPackages.v4l2loopback
98 programs.fuse.userAllowOther = true;
100 services.davfs2.enable = true;
102 systemd.automounts = [
103 { where = "/mnt/aubergine"; automountConfig.TimeoutIdleSec = "5 min"; }
107 # Use the user's gpg-agent session to query
108 # for the password of the SSH key when auto-mounting.
110 pkgs.writeScript "sshAsUser" ''
112 exec ${pkgs.sudo}/bin/sudo -i -u "$user" \
113 ${pkgs.openssh}/bin/ssh "$@"
121 "exec" # Override "user"'s noexec
125 "ssh_command=${sshAsUser}\\040julm"
128 "x-systemd.automount"
129 #"Compression=yes" # YMMV
130 # Disconnect approximately 2*15=30 seconds after a network failure
131 "ServerAliveCountMax=1"
132 "ServerAliveInterval=15"
139 device = "${pkgs.sshfs-fuse}/bin/sshfs#julm@aubergine.wg:/";
144 device = "${pkgs.sshfs-fuse}/bin/sshfs#julm@losurdo.wg:/";
149 device = "${pkgs.sshfs-fuse}/bin/sshfs#julm@mermet.wg:/";
153 "/mnt/ilico/severine" = {
154 device = "https://nuage.ilico.org/remote.php/dav/files/severine/";
158 conf = pkgs.writeText "davfs2.conf" ''
159 backup_dir /home/julm/.local/share/davfs2/ilico/severine
160 secrets /home/julm/.davfs2/secrets
172 "x-systemd.automount"
173 "x-systemd.device-timeout=1m"
174 "x-systemd.idle-timeout=1m"
175 "x-systemd.mount-timeout=10s"
180 networking.firewall.extraCommands = ''
181 ip46tables -A nixos-fw -i wg-intra -p tcp -m tcp --dport 8000 -j ACCEPT
186 defaultMode = "online";
189 localDiscovery = false;
191 Datastore.StorageMax = "10GB";
192 Discovery.MDNS.Enabled = false;
195 #Swarm.AddrFilters = null;
197 startWhenNeeded = true;
200 services.udev.packages = [
201 # Allow the console user access the Yubikey USB device node,
202 # needed for challenge/response to work correctly.
203 pkgs.yubikey-personalization
207 layout = "fr,us(altgr-intl)";
210 # Let the session be generated by home-manager
212 name = "home-manager";
214 ${pkgs.runtimeShell} $HOME/.hm-xsession &
221 defaultSession = "home-manager";
222 #defaultSession = "none+xmonad";
223 #defaultSession = "mate";
224 #defaultSession = "cinnamon";
226 user = config.users.users.julm.name;
231 # This value determines the NixOS release with which your system is to be
232 # compatible, in order to avoid breaking some software such as database
233 # servers. You should change this only after NixOS release notes say you should.
234 system.stateVersion = "20.09"; # Did you read the comment?