60 lines
1.6 KiB
Nix
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 = with inputs.self.modules.homeManager; [
|
|
ssh-new
|
|
shell-tools
|
|
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";
|
|
};
|
|
};
|
|
}
|