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
19 # Lower kernel's security for better performances
20 security.kernel.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:${builtins.path { path = ./. + "/${hostName}/nix/secret-key-files.priv.pem.cred"; }}"
65 secret-key-files = /run/credentials/nix-daemon.service/${hostName}.key
69 #"http://nix-localcache.losurdo.sp"
70 "ssh://nix-ssh@losurdo.sp?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.sp:/";
145 device = "${pkgs.sshfs-fuse}/bin/sshfs#julm@losurdo.sp:/";
150 device = "${pkgs.sshfs-fuse}/bin/sshfs#julm@mermet.sp:/";
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
209 layout = "fr,us(altgr-intl)";
213 # Let the session be generated by home-manager
215 name = "home-manager";
217 ${pkgs.runtimeShell} $HOME/.hm-xsession &
225 services.displayManager = {
226 defaultSession = "home-manager";
227 #defaultSession = "none+xmonad";
228 #defaultSession = "mate";
229 #defaultSession = "cinnamon";
231 user = config.users.users.julm.name;
235 # This value determines the NixOS release with which your system is to be
236 # compatible, in order to avoid breaking some software such as database
237 # servers. You should change this only after NixOS release notes say you should.
238 system.stateVersion = "20.09"; # Did you read the comment?