1 { config, pkgs, lib, inputs, private, hostName, ... }:
4 ../nixos/profiles/builder.nix
5 ../nixos/profiles/debug.nix
6 ../nixos/profiles/graphical.nix
7 ../nixos/profiles/lang-fr.nix
8 ../nixos/profiles/printing.nix
9 ../nixos/profiles/security.nix
10 ../nixos/profiles/system.nix
11 ../nixos/profiles/tor.nix
12 ../nixos/profiles/irssi.nix
18 # Lower kernel's security for better performances
19 boot.kernelParams = [ "mitigations=off" ];
21 home-manager.users.julm = {
22 imports = [ ../homes/julm.nix ];
23 host.hardware = [ "ThinkPad" "X201" ];
25 systemd.services.home-manager-julm.postStart = ''
26 ${pkgs.nix}/bin/nix-env --delete-generations +1 --profile /nix/var/nix/profiles/per-user/julm/home-manager
29 openssh.authorizedKeys.keys = map lib.readFile [
30 ../private/shared/ssh/julm/oignon.pub
36 # Put the hashedPassword in /nix/store, but it will also be in /etc/passwd
37 # which is already world readable.
38 hashedPassword = lib.readFile ../private/world/julm/hashedPassword;
49 config.services.davfs2.davGroup
52 # If created, zfs-mount.service would require:
53 # zfs set overlay=yes ${hostName}/home
55 openssh.authorizedKeys.keys = map lib.readFile [
56 ../private/shared/ssh/julm/losurdo.pub
62 #secret-key-files = /run/credentials/nix-daemon.service/secret-key-files.pem
63 secret-key-files = ${private}/${hostName}/nix/binary-cache/priv.pem
66 trusted-users = [ config.users.users."julm".name ];
68 #"http://nix-localcache.losurdo.wg"
69 "ssh://nix-ssh@losurdo.wg?priority=30"
71 trusted-public-keys = map lib.readFile [
72 ../private/shared/nix/losurdo.pub
75 nixPath = lib.mkForce [ "nixpkgs=${inputs.nixpkgs}" ];
77 #environment.etc."nixpkgs".source = pkgs.path;
78 #environment.etc."nixpkgs-overlays".source = inputs.self + "/nixpkgs";
80 nix.settings.allowed-users = [ config.users.users."nix-ssh".name ];
83 keys = map lib.readFile [
84 ../private/shared/ssh/julm/losurdo.pub
85 ../private/shared/ssh/sevy/patate.pub
86 ../private/shared/ssh/julm/oignon.pub
90 environment.systemPackages = [
91 pkgs.riseup-vpn # Can't be installed by home-manager because it needs to install policy-kit rules
94 boot.extraModulePackages = [
95 #config.boot.kernelPackages.v4l2loopback
98 programs.fuse.userAllowOther = true;
100 services.davfs2.enable = true;
103 # Use the user's gpg-agent session to query
104 # for the password of the SSH key when auto-mounting.
107 pkgs.writeScript "sshAsUser-${user}" ''
108 exec ${pkgs.sudo}/bin/sudo -i -u ${user} \
109 ${pkgs.openssh}/bin/ssh "$@"
113 "noatime" "noexec" "nosuid"
114 "user" "uid=julm" "gid=users" "allow_other"
115 "_netdev" "ssh_command=${sshAsUser "julm"}" # "reconnect"
116 "noauto" "x-gvfs-hide" "x-systemd.automount"
117 #"Compression=yes" # YMMV
118 # Disconnect approximately 2*15=30 seconds after a network failure
119 "ServerAliveCountMax=1"
120 "ServerAliveInterval=15"
124 device = "${pkgs.sshfs-fuse}/bin/sshfs#julm@losurdo.wg:/";
129 device = "${pkgs.sshfs-fuse}/bin/sshfs#julm@mermet.wg:/";
133 "/mnt/ilico/severine" = {
134 device = "https://nuage.ilico.org/remote.php/dav/files/severine/";
137 let conf = pkgs.writeText "davfs2.conf" ''
138 backup_dir /home/julm/.local/share/davfs2/ilico/severine
139 secrets /home/julm/.davfs2/secrets
141 [ "conf=${conf}" "user" "noexec" "nosuid"
142 "noauto" "nofail" "_netdev" "reconnect"
143 "x-systemd.automount"
144 "x-systemd.device-timeout=1m"
145 "x-systemd.idle-timeout=1m"
146 "x-systemd.mount-timeout=10s"
151 networking.firewall.extraCommands = ''
152 ip46tables -A nixos-fw -i wg-intra -p tcp -m tcp --dport 8000 -j ACCEPT
157 defaultMode = "online";
160 localDiscovery = false;
162 Datastore.StorageMax = "10GB";
163 Discovery.MDNS.Enabled = false;
166 #Swarm.AddrFilters = null;
168 startWhenNeeded = true;
171 services.udev.packages = [
172 # Allow the console user access the Yubikey USB device node,
173 # needed for challenge/response to work correctly.
174 pkgs.yubikey-personalization
180 # Let the session be generated by home-manager
181 { name = "home-manager";
183 ${pkgs.runtimeShell} $HOME/.hm-xsession &
190 defaultSession = "home-manager";
191 #defaultSession = "none+xmonad";
192 #defaultSession = "mate";
193 #defaultSession = "cinnamon";
195 user = config.users.users.julm.name;
200 # This value determines the NixOS release with which your system is to be
201 # compatible, in order to avoid breaking some software such as database
202 # servers. You should change this only after NixOS release notes say you should.
203 system.stateVersion = "20.09"; # Did you read the comment?