Skip to content

Commit

Permalink
add support for managed knownHostsLines
Browse files Browse the repository at this point in the history
  • Loading branch information
dszakallas committed Oct 24, 2024
1 parent ae9f95d commit f762a70
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 6 deletions.
8 changes: 4 additions & 4 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 15 additions & 1 deletion modules/home/default/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ in {
};
})
] ++ (lib.optionals hostPlatform.isDarwin [ ./darwin ]);
options = {
davids.ssh.enable = mkEnableOption "SSH goodies";
davids.ssh.knownHostsLines = with types; mkOption {
description = "Managed known_host file lines";
type = lines;
default = "";
};
};
config = {
home = {
packages = lists.flatten [ adm av net files dev nix ];
Expand All @@ -107,6 +115,9 @@ in {
EDITOR = "vim";
LANG = "en_US.UTF-8";
};
file.".ssh/davids.known_hosts" = mkIf config.davids.ssh.enable {
text = config.davids.ssh.knownHostsLines;
};
};
programs = {
vim = {
Expand All @@ -133,10 +144,13 @@ in {
nix-direnv.enable = true;
};

ssh = {
ssh = mkIf config.davids.ssh.enable {
enable = true;
# Unmanaged local overrides
includes = [ "~/.local/share/ssh/config" ];

# default ~/.ssh/known_hosts is unmanaged. ~/.ssh/davids.known_hosts is managed by this module
userKnownHostsFile = "~/.ssh/known_hosts ~/.ssh/davids.known_hosts";
};

bash = {
Expand Down
1 change: 1 addition & 0 deletions users/davidszakallas/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
davids.k8stools.enable = true;
davids.emacs.enable = true;
davids.jupiter.enable = true;
davids.ssh.enable = true;
};
}
1 change: 1 addition & 0 deletions users/dszakallas/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@
davids.k8stools.enable = true;
davids.emacs.enable = true;
davids.pure.enable = true;
davids.ssh.enable = true;
};
}
2 changes: 1 addition & 1 deletion vendor/davids-dotfiles-private

0 comments on commit f762a70

Please sign in to comment.