1 { config, pkgs, lib, 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
66 #environment.etc."nixpkgs".source = pkgs.path;
67 #environment.etc."nixpkgs-overlays".source = inputs.self + "/nixpkgs";
69 nix.allowedUsers = [ config.users.users."nix-ssh".name ];
72 keys = map lib.readFile [
73 ../private/shared/ssh/julm/losurdo.pub
74 ../private/shared/ssh/sevy/patate.pub
75 ../private/shared/ssh/julm/oignon.pub
79 environment.systemPackages = [
80 pkgs.riseup-vpn # Can't be installed by home-manager because it needs to install policy-kit rules
83 boot.extraModulePackages = [
84 #config.boot.kernelPackages.v4l2loopback
87 programs.fuse.userAllowOther = true;
90 # Use the user's gpg-agent session to query
91 # for the password of the SSH key when auto-mounting.
94 pkgs.writeScript "sshAsUser-${user}" ''
95 exec ${pkgs.sudo}/bin/sudo -i -u ${user} \
96 ${pkgs.openssh}/bin/ssh "$@"
100 "noatime" "noexec" "nosuid"
101 "user" "uid=julm" "gid=users" "allow_other"
102 "_netdev" "ssh_command=${sshAsUser "julm"}" # "reconnect"
103 "noauto" "x-gvfs-hide" "x-systemd.automount"
104 #"Compression=yes" # YMMV
105 # Disconnect approximately 2*15=30 seconds after a network failure
106 "ServerAliveCountMax=1"
107 "ServerAliveInterval=15"
111 device = "${pkgs.sshfsFuse}/bin/sshfs#julm@losurdo.wg:/";
116 device = "${pkgs.sshfsFuse}/bin/sshfs#julm@mermet.wg:/";
122 networking.firewall.extraCommands = ''
123 ip46tables -A nixos-fw -i wg-intra -p tcp -m tcp --dport 8000 -j ACCEPT
128 defaultMode = "online";
131 localDiscovery = false;
133 Datastore.StorageMax = "10GB";
134 Discovery.MDNS.Enabled = false;
137 #Swarm.AddrFilters = null;
139 startWhenNeeded = true;
142 services.udev.packages = [
143 # Allow the console user access the Yubikey USB device node,
144 # needed for challenge/response to work correctly.
145 pkgs.yubikey-personalization
151 # Let the session be generated by home-manager
152 { name = "home-manager";
154 ${pkgs.runtimeShell} $HOME/.hm-xsession &
161 defaultSession = "home-manager";
162 #defaultSession = "none+xmonad";
163 #defaultSession = "mate";
164 #defaultSession = "cinnamon";
166 user = config.users.users.julm.name;
171 # This value determines the NixOS release with which your system is to be
172 # compatible, in order to avoid breaking some software such as database
173 # servers. You should change this only after NixOS release notes say you should.
174 system.stateVersion = "20.09"; # Did you read the comment?