]> Git — Sourcephile - julm/julm-nix.git/blob - hosts/blackberry.nix
blackberry: nebula: staticHostMap: update
[julm/julm-nix.git] / hosts / blackberry.nix
1 { config, pkgs, lib, inputs, hostName, ... }:
2 {
3 imports = [
4 #../nixos/profiles/debug.nix
5 ../nixos/profiles/graphical.nix
6 #../nixos/profiles/irssi.nix
7 ../nixos/profiles/lang-fr.nix
8 ../nixos/profiles/desktop.nix
9 ../nixos/profiles/printing.nix
10 #../nixos/profiles/radio.nix
11 ../nixos/profiles/tor.nix
12 ../nixos/profiles/bluetooth.nix
13 #blackberry/backup.nix
14 blackberry/hardware.nix
15 blackberry/nebula.nix
16 blackberry/networking.nix
17 blackberry/pixiecore.nix
18 ];
19
20 # Lower kernel's security for better performances
21 security.kernel.mitigations = "off";
22
23 home-manager.users.julm = {
24 imports = [ ../homes/julm.nix ];
25 };
26 users.users.root = {
27 openssh.authorizedKeys.keys = map lib.readFile [
28 # For nix -L run .#oignon.switch
29 ../users/julm/ssh/oignon.pub
30 ../users/julm/ssh/blackberry.pub
31 ];
32 };
33 users.users.julm = {
34 isNormalUser = true;
35 uid = 1000;
36 # Put the hashedPassword in /nix/store,
37 # though /etc/shadow is not world readable...
38 # printf %s $(mkpasswd -m md5crypt)
39 hashedPassword = lib.readFile blackberry/users/julm/login/hashedPassword.clear;
40 extraGroups = [
41 "adbusers"
42 "dialout"
43 "lp"
44 "networkmanager"
45 "plugdev" # For rtl-sdr
46 "scanner"
47 "tor"
48 "video"
49 "wheel"
50 #"ipfs"
51 config.services.davfs2.davGroup
52 #"vboxusers"
53 ];
54 # If created, zfs-mount.service would require:
55 # zfs set overlay=yes ${hostName}/home
56 createHome = false;
57 openssh.authorizedKeys.keys = map lib.readFile [
58 ../users/julm/ssh/oignon.pub
59 ../users/julm/ssh/losurdo.pub
60 ];
61 };
62
63 nix = {
64 extraOptions = ''
65 '';
66 settings = {
67 substituters = [
68 ];
69 trusted-public-keys = map lib.readFile [
70 ];
71 };
72 nixPath = lib.mkForce [ "nixpkgs=${inputs.nixpkgs}" ];
73 };
74
75 environment.systemPackages = [
76 #pkgs.riseup-vpn # Can't be installed by home-manager because it needs to install policy-kit rules
77 ];
78
79 boot.extraModulePackages = [
80 #config.boot.kernelPackages.v4l2loopback
81 ];
82
83 programs.fuse.userAllowOther = true;
84
85 systemd.automounts = [
86 { where = "/mnt/aubergine"; automountConfig.TimeoutIdleSec = "5 min"; }
87 ];
88 fileSystems =
89 let
90 # Use the user's gpg-agent session to query
91 # for the password of the SSH key when auto-mounting.
92 sshAsUser =
93 pkgs.writeScript "sshAsUser" ''
94 user="$1"; shift
95 exec ${pkgs.sudo}/bin/sudo -i -u "$user" \
96 ${pkgs.openssh}/bin/ssh "$@"
97 '';
98 options =
99 [
100 "user"
101 "uid=julm"
102 "gid=users"
103 "allow_other"
104 "exec" # Override "user"'s noexec
105 "noatime"
106 "nosuid"
107 "_netdev"
108 "ssh_command=${sshAsUser}\\040julm"
109 "noauto"
110 "x-gvfs-hide"
111 "x-systemd.automount"
112 #"Compression=yes" # YMMV
113 # Disconnect approximately 2*15=30 seconds after a network failure
114 "ServerAliveCountMax=1"
115 "ServerAliveInterval=15"
116 "dir_cache=no"
117 #"reconnect"
118 ];
119 in
120 {
121 "/mnt/aubergine" = {
122 device = "${pkgs.sshfs-fuse}/bin/sshfs#julm@aubergine.sp:/";
123 fsType = "fuse";
124 inherit options;
125 };
126 };
127
128 networking.firewall.extraCommands = ''
129 ip46tables -A nixos-fw -i wg-intra -p tcp -m tcp --dport 8000 -j ACCEPT
130 '';
131
132 services.xserver = {
133 xkb = {
134 layout = "fr,us(altgr-intl)";
135 };
136 desktopManager = {
137 session = [
138 # Let the session be generated by home-manager
139 {
140 name = "home-manager";
141 start = ''
142 ${pkgs.runtimeShell} $HOME/.hm-xsession &
143 waitPID=$!
144 '';
145 }
146 ];
147 };
148 };
149
150 services.displayManager = {
151 defaultSession = "home-manager";
152 #defaultSession = "none+xmonad";
153 #defaultSession = "mate";
154 #defaultSession = "cinnamon";
155 autoLogin = {
156 user = config.users.users.julm.name;
157 };
158 };
159
160 # This value determines the NixOS release with which your system is to be
161 # compatible, in order to avoid breaking some software such as database
162 # servers. You should change this only after NixOS release notes say you should.
163 system.stateVersion = "24.05"; # Did you read the comment?
164 }