ssh user certs in home-manager
This commit is contained in:
+28
-26
@@ -16,44 +16,46 @@ in
|
||||
authorizedKeys = [
|
||||
# Shared keys for every host can go here.
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIAUa4dcg1TWc4pW++uodyhX4eOqrX/QYIxFWtEP7HFJ john@john-pc-ubuntu"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFn5ilhqaeDsOWSk7y29se2NvxGm8djlfL3RGLokj0q6 john@john-p14s"
|
||||
];
|
||||
};
|
||||
|
||||
flake.modules = {
|
||||
nixos."${username}" = { config, pkgs, ... }: {
|
||||
nixos."${username}" = { config, pkgs, ... }: let
|
||||
selfMeta = inputs.self.meta.users."${username}";
|
||||
in {
|
||||
imports = [
|
||||
baseUserModules.nixos."${username}"
|
||||
];
|
||||
users.users."${username}" = {
|
||||
openssh.authorizedKeys.keys = inputs.self.meta.users."${username}".authorizedKeys;
|
||||
openssh.authorizedKeys.keys = selfMeta.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";
|
||||
homeManager."${username}" = { pkgs, ... }: let
|
||||
selfMeta = inputs.self.meta.users."${username}";
|
||||
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 = selfMeta.name;
|
||||
programs.git.settings.user.email = selfMeta.email;
|
||||
programs.git.settings.core.editor = "nvim";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user