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/security.nix
10 ../nixos/profiles/system.nix
11 ../nixos/profiles/tor.nix
12 ../nixos/profiles/irssi.nix
18 # Lower kernel's security for better performances
19 boot.kernelParams = [ "mitigations=off" ];
21 home-manager.users.julm = {
22 imports = [ ../homes/julm.nix ];
23 host.hardware = [ "ThinkPad" "X201" ];
25 systemd.services.home-manager-julm.postStart = ''
26 ${pkgs.nix}/bin/nix-env --delete-generations +1 --profile /nix/var/nix/profiles/per-user/julm/home-manager
29 openssh.authorizedKeys.keys = map lib.readFile [
30 # For nix -L run .#oignon.switch
31 ../users/julm/ssh/oignon.pub
37 # Put the hashedPassword in /nix/store,
38 # though /etc/shadow is not world readable...
39 # printf %s $(mkpasswd -m md5crypt)
40 hashedPassword = lib.readFile oignon/users/julm/login/hashedPassword;
51 config.services.davfs2.davGroup
54 # If created, zfs-mount.service would require:
55 # zfs set overlay=yes ${hostName}/home
57 openssh.authorizedKeys.keys = map lib.readFile [
58 ../users/julm/ssh/losurdo.pub
64 #secret-key-files = /run/credentials/nix-daemon.service/secret-key-files.pem
67 trusted-users = [ config.users.users."julm".name ];
69 #"http://nix-localcache.losurdo.wg"
70 "ssh://nix-ssh@losurdo.wg?priority=30"
72 trusted-public-keys = map lib.readFile [
73 ../hosts/losurdo/nix/key.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;
104 # Use the user's gpg-agent session to query
105 # for the password of the SSH key when auto-mounting.
108 pkgs.writeScript "sshAsUser-${user}" ''
109 exec ${pkgs.sudo}/bin/sudo -i -u ${user} \
110 ${pkgs.openssh}/bin/ssh "$@"
114 "noatime" "noexec" "nosuid"
115 "user" "uid=julm" "gid=users" "allow_other"
116 "_netdev" "ssh_command=${sshAsUser "julm"}" # "reconnect"
117 "noauto" "x-gvfs-hide" "x-systemd.automount"
118 #"Compression=yes" # YMMV
119 # Disconnect approximately 2*15=30 seconds after a network failure
120 "ServerAliveCountMax=1"
121 "ServerAliveInterval=15"
125 device = "${pkgs.sshfs-fuse}/bin/sshfs#julm@aubergine.wg:/";
130 device = "${pkgs.sshfs-fuse}/bin/sshfs#julm@losurdo.wg:/";
135 device = "${pkgs.sshfs-fuse}/bin/sshfs#julm@mermet.wg:/";
139 "/mnt/ilico/severine" = {
140 device = "https://nuage.ilico.org/remote.php/dav/files/severine/";
143 let conf = pkgs.writeText "davfs2.conf" ''
144 backup_dir /home/julm/.local/share/davfs2/ilico/severine
145 secrets /home/julm/.davfs2/secrets
147 [ "conf=${conf}" "user" "noexec" "nosuid"
148 "noauto" "nofail" "_netdev" "reconnect"
149 "x-systemd.automount"
150 "x-systemd.device-timeout=1m"
151 "x-systemd.idle-timeout=1m"
152 "x-systemd.mount-timeout=10s"
157 networking.firewall.extraCommands = ''
158 ip46tables -A nixos-fw -i wg-intra -p tcp -m tcp --dport 8000 -j ACCEPT
163 defaultMode = "online";
166 localDiscovery = false;
168 Datastore.StorageMax = "10GB";
169 Discovery.MDNS.Enabled = false;
172 #Swarm.AddrFilters = null;
174 startWhenNeeded = true;
177 services.udev.packages = [
178 # Allow the console user access the Yubikey USB device node,
179 # needed for challenge/response to work correctly.
180 pkgs.yubikey-personalization
186 # Let the session be generated by home-manager
187 { name = "home-manager";
189 ${pkgs.runtimeShell} $HOME/.hm-xsession &
196 defaultSession = "home-manager";
197 #defaultSession = "none+xmonad";
198 #defaultSession = "mate";
199 #defaultSession = "cinnamon";
201 user = config.users.users.julm.name;
206 # This value determines the NixOS release with which your system is to be
207 # compatible, in order to avoid breaking some software such as database
208 # servers. You should change this only after NixOS release notes say you should.
209 system.stateVersion = "20.09"; # Did you read the comment?