1 { config, pkgs, lib, private, hostName, ... }:
4 ../nixos/profiles/dnscrypt-proxy2.nix
5 ../nixos/profiles/graphical.nix
6 ../nixos/profiles/lang-fr.nix
7 ../nixos/profiles/networking.nix
8 ../nixos/profiles/printing.nix
9 ../nixos/profiles/security.nix
10 ../nixos/profiles/system.nix
11 ../nixos/profiles/wireguard/wg-intra.nix
17 home-manager.users.julm = {
18 imports = [ ../homes/julm.nix ];
19 host.hardware = [ "ThinkPad" "X201" ];
21 systemd.services.home-manager-julm.postStart = ''
22 ${pkgs.nix}/bin/nix-env --delete-generations +1 --profile /nix/var/nix/profiles/per-user/julm/home-manager
27 # Put the hashedPassword in /nix/store, but it will also be in /etc/passwd
28 # which is already world readable.
29 hashedPassword = lib.readFile ../private/world/julm/hashedPassword;
39 config.services.davfs2.davGroup
42 # If created, zfs-mount.service would require:
43 # zfs set overlay=yes ${hostName}/home
45 openssh.authorizedKeys.keys = map lib.readFile [
46 ../private/shared/ssh/julm/losurdo.pub
52 secret-key-files = ${private}/${hostName}/nix/binary-cache/priv.pem
54 trustedUsers = [ config.users.users."julm".name ];
56 "http://nix-localcache.losurdo.wg"
58 binaryCachePublicKeys = map lib.readFile [
59 ../private/shared/nix/losurdo.pub
62 #environment.etc."nixpkgs".source = pkgs.path;
63 #environment.etc."nixpkgs-overlays".source = inputs.self + "/nixpkgs";
65 nix.allowedUsers = [ config.users.users."nix-ssh".name ];
68 keys = map lib.readFile [
69 ../private/shared/ssh/julm/losurdo.pub
70 ../private/shared/ssh/sevy/patate.pub
71 ../private/shared/ssh/julm/oignon.pub
75 environment.systemPackages = [
76 pkgs.riseup-vpn # Can't be installed by home-manager because it needs to install policy-kit rules
79 programs.fuse.userAllowOther = true;
80 fileSystems."/mnt/losurdo" = {
81 device = "${pkgs.sshfsFuse}/bin/sshfs#julm@losurdo.wg:/";
84 # Use the user's gpg-agent session to query
85 # for the password of the SSH key when auto-mounting.
87 pkgs.writeScript "sshAsUser-${user}" ''
88 exec ${pkgs.sudo}/bin/sudo -i -u ${user} \
89 ${pkgs.openssh}/bin/ssh "$@"
92 "noatime" "noexec" "nosuid"
93 "user" "uid=julm" "gid=users" "allow_other"
94 "_netdev" "ssh_command=${sshAsUser "julm"}" # "reconnect"
95 "noauto" "x-gvfs-hide" "x-systemd.automount"
96 #"Compression=yes" # YMMV
97 # Disconnect approximately 2*15=30 seconds after a network failure
98 "ServerAliveCountMax=1"
99 "ServerAliveInterval=15"
105 defaultMode = "online";
108 localDiscovery = false;
110 Datastore.StorageMax = "10GB";
111 Discovery.MDNS.Enabled = false;
114 #Swarm.AddrFilters = null;
116 startWhenNeeded = true;
121 # Allow the console user access the Yubikey USB device node,
122 # needed for challenge/response to work correctly.
123 pkgs.yubikey-personalization
130 # Let the session be generated by home-manager
131 { name = "home-manager";
133 ${pkgs.runtimeShell} $HOME/.hm-xsession &
140 defaultSession = "home-manager";
141 #defaultSession = "none+xmonad";
142 #defaultSession = "mate";
143 #defaultSession = "cinnamon";
145 user = config.users.users.julm.name;
150 systemd.coredump.enable = true;
151 #environment.enableDebugInfo = true;
153 # This value determines the NixOS release with which your system is to be
154 # compatible, in order to avoid breaking some software such as database
155 # servers. You should change this only after NixOS release notes say you should.
156 system.stateVersion = "20.09"; # Did you read the comment?