Files
dendritic/modules/users/john.nix
T
2026-07-03 23:42:27 -05:00

60 lines
1.6 KiB
Nix

{ self, inputs, ... }:
let
username = "john";
baseUserModules = self.factory.user {
username = username;
isAdmin = true;
};
in
{
flake.meta.users."${username}" = {
email = "[email protected]";
name = "John Lancaster";
inherit username;
key = "";
keygrip = [ ];
authorizedKeys = [
# Shared keys for every host can go here.
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIAUa4dcg1TWc4pW++uodyhX4eOqrX/QYIxFWtEP7HFJ john@john-pc-ubuntu"
];
};
flake.modules = {
nixos."${username}" = { config, pkgs, ... }: {
imports = [
baseUserModules.nixos."${username}"
];
users.users."${username}" = {
openssh.authorizedKeys.keys = inputs.self.meta.users."${username}".authorizedKeys;
};
};
# This module will be imported by the user factory
homeManager."${username}" = { pkgs, ... }:
with inputs.self.meta.users."${username}";
let
selfPkgs = inputs.self.packages.${pkgs.stdenv.hostPlatform.system};
in {
home.stateVersion = "25.11";
imports = [
inputs.self.modules.homeManager.shell-tools
inputs.self.modules.homeManager.ssh
inputs.self.modules.homeManager.git
];
xdg.enable = true;
home.packages = [
selfPkgs.neovim-min
];
home.sessionVariables = {
EDITOR = "nvim";
VISUAL = "nvim";
GIT_EDITOR = "nvim";
SOPS_EDITOR = "nvim";
};
programs.git.settings.user.name = name;
programs.git.settings.user.email = email;
programs.git.settings.core.editor = "nvim";
};
};
}