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