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
57 trustedUsers = [ config.users.users."julm".name ];
59 #"http://nix-localcache.losurdo.wg"
60 "ssh://nix-ssh@losurdo.wg?priority=30"
62 binaryCachePublicKeys = map lib.readFile [
63 ../private/shared/nix/losurdo.pub
65 nixPath = lib.mkForce [ "nixpkgs=${inputs.nixpkgs}" ];
67 #environment.etc."nixpkgs".source = pkgs.path;
68 #environment.etc."nixpkgs-overlays".source = inputs.self + "/nixpkgs";
70 nix.allowedUsers = [ config.users.users."nix-ssh".name ];
73 keys = map lib.readFile [
74 ../private/shared/ssh/julm/losurdo.pub
75 ../private/shared/ssh/sevy/patate.pub
76 ../private/shared/ssh/julm/oignon.pub
80 environment.systemPackages = [
81 pkgs.riseup-vpn # Can't be installed by home-manager because it needs to install policy-kit rules
84 boot.extraModulePackages = [
85 #config.boot.kernelPackages.v4l2loopback
88 programs.fuse.userAllowOther = true;
90 services.davfs2.enable = true;
93 # Use the user's gpg-agent session to query
94 # for the password of the SSH key when auto-mounting.
97 pkgs.writeScript "sshAsUser-${user}" ''
98 exec ${pkgs.sudo}/bin/sudo -i -u ${user} \
99 ${pkgs.openssh}/bin/ssh "$@"
103 "noatime" "noexec" "nosuid"
104 "user" "uid=julm" "gid=users" "allow_other"
105 "_netdev" "ssh_command=${sshAsUser "julm"}" # "reconnect"
106 "noauto" "x-gvfs-hide" "x-systemd.automount"
107 #"Compression=yes" # YMMV
108 # Disconnect approximately 2*15=30 seconds after a network failure
109 "ServerAliveCountMax=1"
110 "ServerAliveInterval=15"
114 device = "${pkgs.sshfsFuse}/bin/sshfs#julm@losurdo.wg:/";
119 device = "${pkgs.sshfsFuse}/bin/sshfs#julm@mermet.wg:/";
123 "/mnt/ilico/severine" = {
124 device = "https://nuage.ilico.org/remote.php/dav/files/severine/";
127 let conf = pkgs.writeText "davfs2.conf" ''
128 backup_dir /home/julm/.local/share/davfs2/ilico/severine
129 secrets /home/julm/.davfs2/secrets
131 [ "conf=${conf}" "user" "noexec" "nosuid"
132 "noauto" "nofail" "_netdev" "reconnect"
133 "x-systemd.automount"
134 "x-systemd.device-timeout=1m"
135 "x-systemd.idle-timeout=1m"
136 "x-systemd.mount-timeout=10s"
141 networking.firewall.extraCommands = ''
142 ip46tables -A nixos-fw -i wg-intra -p tcp -m tcp --dport 8000 -j ACCEPT
147 defaultMode = "online";
150 localDiscovery = false;
152 Datastore.StorageMax = "10GB";
153 Discovery.MDNS.Enabled = false;
156 #Swarm.AddrFilters = null;
158 startWhenNeeded = true;
161 services.udev.packages = [
162 # Allow the console user access the Yubikey USB device node,
163 # needed for challenge/response to work correctly.
164 pkgs.yubikey-personalization
170 # Let the session be generated by home-manager
171 { name = "home-manager";
173 ${pkgs.runtimeShell} $HOME/.hm-xsession &
180 defaultSession = "home-manager";
181 #defaultSession = "none+xmonad";
182 #defaultSession = "mate";
183 #defaultSession = "cinnamon";
185 user = config.users.users.julm.name;
190 # This value determines the NixOS release with which your system is to be
191 # compatible, in order to avoid breaking some software such as database
192 # servers. You should change this only after NixOS release notes say you should.
193 system.stateVersion = "20.09"; # Did you read the comment?