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
12 ../nixos/profiles/bluetooth.nix
20 # Lower kernel's security for better performances
21 security.kernel.mitigations = "off";
23 home-manager.users.julm = {
24 imports = [ ../homes/julm.nix ];
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:${builtins.path { path = ./. + "/${hostName}/nix/secret-key-files.priv.pem.cred"; }}"
66 secret-key-files = /run/credentials/nix-daemon.service/${hostName}.key
70 #"http://nix-localcache.losurdo.sp"
71 "ssh://nix-ssh@losurdo.sp?priority=30"
73 trusted-public-keys = map lib.readFile [
74 ../users/nix/ssh/losurdo.pub
77 nixPath = lib.mkForce [ "nixpkgs=${inputs.nixpkgs}" ];
79 #environment.etc."nixpkgs".source = pkgs.path;
80 #environment.etc."nixpkgs-overlays".source = inputs.self + "/nixpkgs";
82 nix.settings.allowed-users = [ config.users.users."nix-ssh".name ];
85 keys = map lib.readFile [
86 ../users/julm/ssh/losurdo.pub
87 ../users/julm/ssh/oignon.pub
88 ../users/sevy/ssh/patate.pub
92 environment.systemPackages = [
93 pkgs.riseup-vpn # Can't be installed by home-manager because it needs to install policy-kit rules
96 boot.extraModulePackages = [
97 #config.boot.kernelPackages.v4l2loopback
100 programs.fuse.userAllowOther = true;
102 services.davfs2.enable = true;
104 systemd.automounts = [
105 { where = "/mnt/aubergine"; automountConfig.TimeoutIdleSec = "5 min"; }
109 # Use the user's gpg-agent session to query
110 # for the password of the SSH key when auto-mounting.
112 pkgs.writeScript "sshAsUser" ''
114 exec ${pkgs.sudo}/bin/sudo -i -u "$user" \
115 ${pkgs.openssh}/bin/ssh "$@"
123 "exec" # Override "user"'s noexec
127 "ssh_command=${sshAsUser}\\040julm"
130 "x-systemd.automount"
131 #"Compression=yes" # YMMV
132 # Disconnect approximately 2*15=30 seconds after a network failure
133 "ServerAliveCountMax=1"
134 "ServerAliveInterval=15"
141 device = "${pkgs.sshfs-fuse}/bin/sshfs#julm@aubergine.sp:/";
146 device = "${pkgs.sshfs-fuse}/bin/sshfs#julm@losurdo.sp:/";
151 device = "${pkgs.sshfs-fuse}/bin/sshfs#julm@mermet.sp:/";
155 "/mnt/ilico/severine" = {
156 device = "https://nuage.ilico.org/remote.php/dav/files/severine/";
160 conf = pkgs.writeText "davfs2.conf" ''
161 backup_dir /home/julm/.local/share/davfs2/ilico/severine
162 secrets /home/julm/.davfs2/secrets
174 "x-systemd.automount"
175 "x-systemd.device-timeout=1m"
176 "x-systemd.idle-timeout=1m"
177 "x-systemd.mount-timeout=10s"
182 networking.firewall.extraCommands = ''
183 ip46tables -A nixos-fw -i wg-intra -p tcp -m tcp --dport 8000 -j ACCEPT
188 defaultMode = "online";
191 localDiscovery = false;
193 Datastore.StorageMax = "10GB";
194 Discovery.MDNS.Enabled = false;
197 #Swarm.AddrFilters = null;
199 startWhenNeeded = true;
202 services.udev.packages = [
203 # Allow the console user access the Yubikey USB device node,
204 # needed for challenge/response to work correctly.
205 pkgs.yubikey-personalization
209 layout = "fr,us(altgr-intl)";
212 # Let the session be generated by home-manager
214 name = "home-manager";
216 ${pkgs.runtimeShell} $HOME/.hm-xsession &
223 defaultSession = "home-manager";
224 #defaultSession = "none+xmonad";
225 #defaultSession = "mate";
226 #defaultSession = "cinnamon";
228 user = config.users.users.julm.name;
233 # This value determines the NixOS release with which your system is to be
234 # compatible, in order to avoid breaking some software such as database
235 # servers. You should change this only after NixOS release notes say you should.
236 system.stateVersion = "20.09"; # Did you read the comment?