1 { config, pkgs, lib, inputs, hostName, ... }:
4 ../nixos/profiles/debug.nix
5 ../nixos/profiles/graphical.nix
6 ../nixos/profiles/irssi.nix
7 ../nixos/profiles/lang-fr.nix
8 ../nixos/profiles/laptop.nix
9 ../nixos/profiles/printing.nix
10 ../nixos/profiles/radio.nix
11 ../nixos/profiles/tor.nix
19 # Lower kernel's security for better performances
20 boot.kernelParams = [ "mitigations=off" ];
22 home-manager.users.julm = {
23 imports = [ ../homes/julm.nix ];
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;
43 "plugdev" # For rtl-sdr
49 config.services.davfs2.davGroup
52 # If created, zfs-mount.service would require:
53 # zfs set overlay=yes ${hostName}/home
55 openssh.authorizedKeys.keys = map lib.readFile [
56 ../users/julm/ssh/losurdo.pub
60 systemd.services.nix-daemon.serviceConfig.LoadCredentialEncrypted =
61 [ ("${hostName}.key:${inputs.self}/hosts/${hostName}/nix/secret-key-files.priv.pem.cred") ];
64 secret-key-files = /run/credentials/nix-daemon.service/${hostName}.key
68 #"http://nix-localcache.losurdo.sp"
69 "ssh://nix-ssh@losurdo.sp?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.sp:/";
144 device = "${pkgs.sshfs-fuse}/bin/sshfs#julm@losurdo.sp:/";
149 device = "${pkgs.sshfs-fuse}/bin/sshfs#julm@mermet.sp:/";
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?