1 { config, pkgs, lib, inputs, private, hostName, ... }:
4 ../nixos/profiles/debug.nix
5 ../nixos/profiles/dnscrypt-proxy2.nix
6 ../nixos/profiles/graphical.nix
7 ../nixos/profiles/lang-fr.nix
8 ../nixos/profiles/networking.nix
9 ../nixos/profiles/printing.nix
10 ../nixos/profiles/security.nix
11 ../nixos/profiles/system.nix
12 ../nixos/profiles/tor.nix
13 ../nixos/profiles/irssi.nix
14 ../nixos/profiles/wireguard/wg-intra.nix
20 home-manager.users.julm = {
21 imports = [ ../homes/julm.nix ];
22 host.hardware = [ "ThinkPad" "X201" ];
24 systemd.services.home-manager-julm.postStart = ''
25 ${pkgs.nix}/bin/nix-env --delete-generations +1 --profile /nix/var/nix/profiles/per-user/julm/home-manager
30 # Put the hashedPassword in /nix/store, but it will also be in /etc/passwd
31 # which is already world readable.
32 hashedPassword = lib.readFile ../private/world/julm/hashedPassword;
42 config.services.davfs2.davGroup
45 # If created, zfs-mount.service would require:
46 # zfs set overlay=yes ${hostName}/home
48 openssh.authorizedKeys.keys = map lib.readFile [
49 ../private/shared/ssh/julm/losurdo.pub
55 secret-key-files = ${private}/${hostName}/nix/binary-cache/priv.pem
58 trusted-users = [ config.users.users."julm".name ];
60 #"http://nix-localcache.losurdo.wg"
61 "ssh://nix-ssh@losurdo.wg?priority=30"
63 trusted-public-keys = map lib.readFile [
64 ../private/shared/nix/losurdo.pub
67 nixPath = lib.mkForce [ "nixpkgs=${inputs.nixpkgs}" ];
69 #environment.etc."nixpkgs".source = pkgs.path;
70 #environment.etc."nixpkgs-overlays".source = inputs.self + "/nixpkgs";
72 nix.settings.allowed-users = [ config.users.users."nix-ssh".name ];
75 keys = map lib.readFile [
76 ../private/shared/ssh/julm/losurdo.pub
77 ../private/shared/ssh/sevy/patate.pub
78 ../private/shared/ssh/julm/oignon.pub
82 environment.systemPackages = [
83 pkgs.riseup-vpn # Can't be installed by home-manager because it needs to install policy-kit rules
86 boot.extraModulePackages = [
87 #config.boot.kernelPackages.v4l2loopback
90 programs.fuse.userAllowOther = true;
92 services.davfs2.enable = true;
95 # Use the user's gpg-agent session to query
96 # for the password of the SSH key when auto-mounting.
99 pkgs.writeScript "sshAsUser-${user}" ''
100 exec ${pkgs.sudo}/bin/sudo -i -u ${user} \
101 ${pkgs.openssh}/bin/ssh "$@"
105 "noatime" "noexec" "nosuid"
106 "user" "uid=julm" "gid=users" "allow_other"
107 "_netdev" "ssh_command=${sshAsUser "julm"}" # "reconnect"
108 "noauto" "x-gvfs-hide" "x-systemd.automount"
109 #"Compression=yes" # YMMV
110 # Disconnect approximately 2*15=30 seconds after a network failure
111 "ServerAliveCountMax=1"
112 "ServerAliveInterval=15"
116 device = "${pkgs.sshfs-fuse}/bin/sshfs#julm@losurdo.wg:/";
121 device = "${pkgs.sshfs-fuse}/bin/sshfs#julm@mermet.wg:/";
125 "/mnt/ilico/severine" = {
126 device = "https://nuage.ilico.org/remote.php/dav/files/severine/";
129 let conf = pkgs.writeText "davfs2.conf" ''
130 backup_dir /home/julm/.local/share/davfs2/ilico/severine
131 secrets /home/julm/.davfs2/secrets
133 [ "conf=${conf}" "user" "noexec" "nosuid"
134 "noauto" "nofail" "_netdev" "reconnect"
135 "x-systemd.automount"
136 "x-systemd.device-timeout=1m"
137 "x-systemd.idle-timeout=1m"
138 "x-systemd.mount-timeout=10s"
143 networking.firewall.extraCommands = ''
144 ip46tables -A nixos-fw -i wg-intra -p tcp -m tcp --dport 8000 -j ACCEPT
149 defaultMode = "online";
152 localDiscovery = false;
154 Datastore.StorageMax = "10GB";
155 Discovery.MDNS.Enabled = false;
158 #Swarm.AddrFilters = null;
160 startWhenNeeded = true;
163 services.udev.packages = [
164 # Allow the console user access the Yubikey USB device node,
165 # needed for challenge/response to work correctly.
166 pkgs.yubikey-personalization
172 # Let the session be generated by home-manager
173 { name = "home-manager";
175 ${pkgs.runtimeShell} $HOME/.hm-xsession &
182 defaultSession = "home-manager";
183 #defaultSession = "none+xmonad";
184 #defaultSession = "mate";
185 #defaultSession = "cinnamon";
187 user = config.users.users.julm.name;
192 # This value determines the NixOS release with which your system is to be
193 # compatible, in order to avoid breaking some software such as database
194 # servers. You should change this only after NixOS release notes say you should.
195 system.stateVersion = "20.09"; # Did you read the comment?