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 ../hosts/losurdo/nix/key.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;
103 # Use the user's gpg-agent session to query
104 # for the password of the SSH key when auto-mounting.
107 pkgs.writeScript "sshAsUser-${user}" ''
108 exec ${pkgs.sudo}/bin/sudo -i -u ${user} \
109 ${pkgs.openssh}/bin/ssh "$@"
121 "ssh_command=${sshAsUser "julm"}" # "reconnect"
124 "x-systemd.automount"
125 #"Compression=yes" # YMMV
126 # Disconnect approximately 2*15=30 seconds after a network failure
127 "ServerAliveCountMax=1"
128 "ServerAliveInterval=15"
133 device = "${pkgs.sshfs-fuse}/bin/sshfs#julm@aubergine.wg:/";
138 device = "${pkgs.sshfs-fuse}/bin/sshfs#julm@losurdo.wg:/";
143 device = "${pkgs.sshfs-fuse}/bin/sshfs#julm@mermet.wg:/";
147 "/mnt/ilico/severine" = {
148 device = "https://nuage.ilico.org/remote.php/dav/files/severine/";
152 conf = pkgs.writeText "davfs2.conf" ''
153 backup_dir /home/julm/.local/share/davfs2/ilico/severine
154 secrets /home/julm/.davfs2/secrets
166 "x-systemd.automount"
167 "x-systemd.device-timeout=1m"
168 "x-systemd.idle-timeout=1m"
169 "x-systemd.mount-timeout=10s"
174 networking.firewall.extraCommands = ''
175 ip46tables -A nixos-fw -i wg-intra -p tcp -m tcp --dport 8000 -j ACCEPT
180 defaultMode = "online";
183 localDiscovery = false;
185 Datastore.StorageMax = "10GB";
186 Discovery.MDNS.Enabled = false;
189 #Swarm.AddrFilters = null;
191 startWhenNeeded = true;
194 services.udev.packages = [
195 # Allow the console user access the Yubikey USB device node,
196 # needed for challenge/response to work correctly.
197 pkgs.yubikey-personalization
203 # Let the session be generated by home-manager
205 name = "home-manager";
207 ${pkgs.runtimeShell} $HOME/.hm-xsession &
214 defaultSession = "home-manager";
215 #defaultSession = "none+xmonad";
216 #defaultSession = "mate";
217 #defaultSession = "cinnamon";
219 user = config.users.users.julm.name;
224 # This value determines the NixOS release with which your system is to be
225 # compatible, in order to avoid breaking some software such as database
226 # servers. You should change this only after NixOS release notes say you should.
227 system.stateVersion = "20.09"; # Did you read the comment?