dotfiles

My PC Dotfiles & Website

modules/users/v7/default.nix (2359B)


 1{config, ...}: let
 2  inherit (config.flake) files modules;
 3  name = "maydayv7";
 4in {
 5  flake.modules.nixos.v7 = {
 6    config,
 7    pkgs,
 8    ...
 9  }: {
10    users.users.v7 = {
11      isNormalUser = true;
12      description = "V 7";
13      uid = 1000;
14      group = "users";
15      shell = pkgs.zsh;
16      hashedPasswordFile = config.sops.secrets."v7.secret".path;
17    };
18  };
19
20  flake.modules.homeManager.v7 = {
21    config,
22    lib,
23    ...
24  }: {
25    imports = [modules.homeManager.v7-cli];
26    home.file = {
27      ".face".source = ./profile.png;
28      ".config/goa-1.0/accounts.conf".text = builtins.readFile ./accounts.conf;
29      ".config/gtk-3.0/bookmarks".text = lib.mkBefore ''
30        file://${config.home.homeDirectory}/TBD TBD
31        file://${config.home.homeDirectory}/Projects Projects
32      '';
33    };
34  };
35
36  flake.modules.homeManager.v7-cli = {
37    config,
38    lib,
39    pkgs,
40    ...
41  }: let
42    homeDir = config.home.homeDirectory;
43    github-mcp = config.programs.mcp.servers ? github;
44  in {
45    credentials = {
46      inherit name;
47      fullname = "V7";
48      mail = "maydayv7@gmail.com";
49      key = "8C240C0C11293EE56260601CCF616EB19C2765E4";
50    };
51
52    home = {
53      persist.directories = [
54        "TBD"
55        "Projects"
56      ];
57
58      file."Projects/dotfiles".source = config.lib.file.mkOutOfStoreSymlink files.path.system;
59
60      packages = with pkgs; [
61        home-manager
62        cloudflared
63        dig
64      ];
65    };
66
67    sops.templates = let
68      github-token = config.sops.placeholder."github-token.secret";
69    in
70      {
71        "gh-hosts.yml" = {
72          path = "${homeDir}/.config/gh/hosts.yml";
73          content = ''
74            github.com:
75                git_protocol: https
76                user: ${name}
77                oauth_token: ${github-token}
78                users:
79                    ${name}:
80                        oauth_token: ${github-token}
81          '';
82        };
83      }
84      // lib.optionalAttrs github-mcp {
85        "github-mcp.sh".content = ''
86          export ${config.programs.mcp.servers.github.bearer_token_env_var}='${github-token}'
87        '';
88      };
89
90    programs = {
91      zsh.initContent = lib.mkIf github-mcp (lib.mkAfter ''
92        source ${config.sops.templates."github-mcp.sh".path}
93      '');
94
95      ssh.includes = [config.sops.secrets."ssh-config.secret".path];
96    };
97  };
98}