]> Git — Sourcephile - julm/julm-nix.git/blob - hosts/aubergine.nix
networking: improve timing when updating
[julm/julm-nix.git] / hosts / aubergine.nix
1 { config, pkgs, lib, inputs, ... }:
2 {
3 imports = [
4 #../nixos/profiles/debug.nix
5 ../nixos/profiles/lang-fr.nix
6 #../nixos/profiles/tor.nix
7 aubergine/hardware.nix
8 aubergine/networking.nix
9 aubergine/nginx.nix
10 aubergine/backup.nix
11 ];
12
13 # Lower kernel's security for better performances
14 boot.kernelParams = [ "mitigations=off" ];
15
16 home-manager.users.julm = {
17 imports = [ ../homes/julm.nix ];
18 };
19 systemd.services.home-manager-julm.postStart = ''
20 ${pkgs.nix}/bin/nix-env --delete-generations +1 --profile /nix/var/nix/profiles/per-user/julm/home-manager
21 '';
22 users.users.julm = {
23 isNormalUser = true;
24 uid = 1000;
25 # Put the hashedPassword in /nix/store, but it will also be in /etc/passwd
26 # which is already world readable.
27 # printf %s $(mkpasswd -m md5crypt)
28 hashedPassword = lib.readFile aubergine/users/julm/login/hashedPassword.clear;
29 extraGroups = [
30 "adbusers"
31 "dialout"
32 "networkmanager"
33 "tor"
34 "wheel"
35 ];
36 # If created, zfs-mount.service would require:
37 # zfs set overlay=yes ${hostName}/home
38 createHome = true;
39 openssh.authorizedKeys.keys = map lib.readFile [
40 ../users/root/ssh/losurdo.pub
41 ../users/julm/ssh/losurdo.pub
42 ../users/julm/ssh/oignon.pub
43 ../users/julm/ssh/redmi.pub
44 ];
45 };
46 users.users.root = {
47 hashedPassword = "!";
48 openssh.authorizedKeys.keys =
49 config.users.users.julm.openssh.authorizedKeys.keys;
50 };
51
52 #systemd.services.nix-daemon.serviceConfig.LoadCredentialEncrypted =
53 # "secret-key-files:" + aubergine/nix/secret-key-files;
54 nix = {
55 extraOptions = ''
56 #secret-key-files = /run/credentials/nix-daemon.service/secret-key-files.pem
57 '';
58 settings = {
59 substituters = [
60 #"http://nix-localcache.losurdo.wg"
61 #"ssh://nix-ssh@losurdo.wg?priority=30"
62 #"ssh://nix-ssh@oignon.wg?priority=30"
63 ];
64 trusted-public-keys = map lib.readFile [
65 ../users/root/nix/oignon.pub
66 ];
67 };
68 nixPath = lib.mkForce [ "nixpkgs=${inputs.nixpkgs}" ];
69 };
70 #environment.etc."nixpkgs".source = pkgs.path;
71 #environment.etc."nixpkgs-overlays".source = inputs.self + "/nixpkgs";
72
73 nix.settings.allowed-users = [ config.users.users."nix-ssh".name ];
74 nix.sshServe = {
75 enable = true;
76 keys = map lib.readFile [
77 ../users/julm/ssh/losurdo.pub
78 ../users/sevy/ssh/patate.pub
79 ../users/julm/ssh/oignon.pub
80 ];
81 };
82
83 environment.systemPackages = [
84 ];
85
86 boot.extraModulePackages = [
87 #config.boot.kernelPackages.v4l2loopback
88 ];
89
90 # This value determines the NixOS release with which your system is to be
91 # compatible, in order to avoid breaking some software such as database
92 # servers. You should change this only after NixOS release notes say you should.
93 system.stateVersion = "22.11"; # Did you read the comment?
94 }