zaphyra's git: nixfiles

zaphyra's nixfiles

1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 
27 
28 
29 
30 
31 
32 
33 
34 
35 
36 
37 
38 
39 
40 
41 
42 
43 
44 
45 
46 
47 
48 
49 
50 
51 
52 
53 
54 
55 
56 
57 
58 
59 
60 
61 
62 
63 
64 
65 
66 
67 
68 
{
  povSelf,
  config,
  lib,
  homeManagerModules,
  ...
}:
let
  inherit (lib) types;
  cfg = lib.getAttrFromPath povSelf config;

in
{

  options.enable = {
    type = types.bool;
    default = false;
  };

  config = lib.mkIf cfg.enable (
    lib.mkMerge [
      {
        sops.secrets.voidPassword = {
          neededForUsers = true;
          #sopsFile = inputs.self.sopsSecrets.common;
        };

        users.users.void = {
          uid = 1000;
          description = "Hannah";
          hashedPasswordFile = config.sops.secrets.voidPassword.path;
          isNormalUser = true;
          extraGroups = [
            "audio"
            "dialout"
            "docker"
            "input"
            "networkmanager"
            "seat"
            "ssh"
            "tss"
            "video"
            "wheel"
          ];
          openssh.authorizedKeys.keys = [
            "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOFsnTwRtKRrn2KqbkTvXgwZniD1p90A7iqvQduhoDL6 openpgp:0x03F32AB3"
          ];
        };
      }

      (lib.mkIf config.modules.homeManager.enable {
        home-manager.users.void.imports =
          with homeManagerModules.void;
          lib.concatLists [
            [
              home
              impermanence # FIXME
            ]

            (lib.optionals config.modules.filesystem.impermanence.home.enable [
              homeManagerModules.void.impermanence # FIXME: implement impermanence
            ])
          ];
      })
    ]
  );

}