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/wireguard/wg-intra.nix
19 home-manager.users.julm = {
20 imports = [ ../homes/julm.nix ];
21 host.hardware = [ "ThinkPad" "X201" ];
23 systemd.services.home-manager-julm.postStart = ''
24 ${pkgs.nix}/bin/nix-env --delete-generations +1 --profile /nix/var/nix/profiles/per-user/julm/home-manager
29 # Put the hashedPassword in /nix/store, but it will also be in /etc/passwd
30 # which is already world readable.
31 hashedPassword = lib.readFile ../private/world/julm/hashedPassword;
41 config.services.davfs2.davGroup
44 # If created, zfs-mount.service would require:
45 # zfs set overlay=yes ${hostName}/home
47 openssh.authorizedKeys.keys = map lib.readFile [
48 ../private/shared/ssh/julm/losurdo.pub
54 secret-key-files = ${private}/${hostName}/nix/binary-cache/priv.pem
56 trustedUsers = [ config.users.users."julm".name ];
58 #"http://nix-localcache.losurdo.wg"
59 "ssh://nix-ssh@losurdo.wg?priority=30"
61 binaryCachePublicKeys = map lib.readFile [
62 ../private/shared/nix/losurdo.pub
65 #environment.etc."nixpkgs".source = pkgs.path;
66 #environment.etc."nixpkgs-overlays".source = inputs.self + "/nixpkgs";
68 nix.allowedUsers = [ config.users.users."nix-ssh".name ];
71 keys = map lib.readFile [
72 ../private/shared/ssh/julm/losurdo.pub
73 ../private/shared/ssh/sevy/patate.pub
74 ../private/shared/ssh/julm/oignon.pub
78 environment.systemPackages = [
79 pkgs.riseup-vpn # Can't be installed by home-manager because it needs to install policy-kit rules
82 boot.extraModulePackages = [
83 #config.boot.kernelPackages.v4l2loopback
86 programs.fuse.userAllowOther = true;
89 # Use the user's gpg-agent session to query
90 # for the password of the SSH key when auto-mounting.
93 pkgs.writeScript "sshAsUser-${user}" ''
94 exec ${pkgs.sudo}/bin/sudo -i -u ${user} \
95 ${pkgs.openssh}/bin/ssh "$@"
99 "noatime" "noexec" "nosuid"
100 "user" "uid=julm" "gid=users" "allow_other"
101 "_netdev" "ssh_command=${sshAsUser "julm"}" # "reconnect"
102 "noauto" "x-gvfs-hide" "x-systemd.automount"
103 #"Compression=yes" # YMMV
104 # Disconnect approximately 2*15=30 seconds after a network failure
105 "ServerAliveCountMax=1"
106 "ServerAliveInterval=15"
110 device = "${pkgs.sshfsFuse}/bin/sshfs#julm@losurdo.wg:/";
115 device = "${pkgs.sshfsFuse}/bin/sshfs#julm@mermet.wg:/";
121 networking.firewall.extraCommands = ''
122 ip46tables -A nixos-fw -i wg-intra -p tcp -m tcp --dport 8000 -j ACCEPT
127 defaultMode = "online";
130 localDiscovery = false;
132 Datastore.StorageMax = "10GB";
133 Discovery.MDNS.Enabled = false;
136 #Swarm.AddrFilters = null;
138 startWhenNeeded = true;
141 services.udev.packages = [
142 # Allow the console user access the Yubikey USB device node,
143 # needed for challenge/response to work correctly.
144 pkgs.yubikey-personalization
150 # Let the session be generated by home-manager
151 { name = "home-manager";
153 ${pkgs.runtimeShell} $HOME/.hm-xsession &
160 defaultSession = "home-manager";
161 #defaultSession = "none+xmonad";
162 #defaultSession = "mate";
163 #defaultSession = "cinnamon";
165 user = config.users.users.julm.name;
170 # This value determines the NixOS release with which your system is to be
171 # compatible, in order to avoid breaking some software such as database
172 # servers. You should change this only after NixOS release notes say you should.
173 system.stateVersion = "20.09"; # Did you read the comment?