broke out ssh module

This commit is contained in:
John Lancaster
2025-07-02 22:56:10 -05:00
parent 97b2e05f80
commit c1a9e401cb
3 changed files with 37 additions and 72 deletions

View File

@@ -4,6 +4,7 @@
imports = [
./homeManagerModules/git.nix
./homeManagerModules/shell.nix
./homeManagerModules/ssh.nix
# inputs._1password-shell-plugins.hmModules.default
];
# Home Manager needs a bit of information about you and the paths it should
@@ -21,15 +22,10 @@
busybox
gnugrep
dig
# eza
gdu
lazygit
btop
yazi
(writeShellScriptBin "nhmu" ''
nix flake update --flake ~/.config/home-manager
nix run home-manager -- switch --flake ~/.config/home-manager
'')
# # It is sometimes useful to fine-tune packages, for example, by applying
# # overrides. You can do that directly here, just don't forget the
# # parentheses. Maybe you want to install Nerd Fonts with a limited number of
@@ -37,21 +33,6 @@
# (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })
];
# Home Manager is pretty good at managing dotfiles. The primary way to manage
# plain files is through 'home.file'.
home.file = {
# # Building this configuration will create a copy of 'dotfiles/screenrc' in
# # the Nix store. Activating the configuration will then make '~/.screenrc' a
# # symlink to the Nix store copy.
# ".screenrc".source = dotfiles/screenrc;
# # You can also set the file content immediately.
# ".gradle/gradle.properties".text = ''
# org.gradle.console=verbose
# org.gradle.daemon.idletimeout=3600000
# '';
};
# Home Manager can also manage your environment variables through
# 'home.sessionVariables'. These will be explicitly sourced when using a
# shell provided by Home Manager. If you don't want to manage your shell
@@ -75,58 +56,6 @@
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
# programs.zsh = lib.mkIf config.shell {
# enable = true;
# enableCompletion = true;
# autosuggestion.enable = true;
# syntaxHighlighting.enable = true;
# oh-my-zsh = {
# enable = true;
# theme = "risto";
# plugins = [
# "sudo"
# "dotenv"
# "git"
# "ssh"
# "ssh-agent"
# ] ++ lib.optional config._1password "1password";
# };
# shellAliases.ls = "${pkgs.eza}/bin/eza -lgos type --no-time";
# # initContent = lib.mkIf config._1password ''
# # source ${config.home.homeDirectory}/.config/op/plugins.sh
# # '';
# };
programs.ssh = lib.mkIf config.ssh {
enable = true;
extraConfig = ''
SetEnv TERM="xterm-256color"
${lib.optionalString config._1password "IdentityAgent ~/.1password/agent.sock"}
'';
matchBlocks = lib.mkMerge [
(lib.mkIf (config.profile == "personal") {
"panoptes" = {
hostname = "192.168.1.107";
user = "panoptes";
};
"pve5070" = {
hostname = "192.168.1.130";
user = "root";
};
"nix-test" = {
hostname = "192.168.1.36";
user = "root";
};
})
(lib.mkIf (config.profile == "work") {
"ubuntu-nvidia" = {
hostname = "10.118.46.120";
user = "john";
};
})
];
};
# https://developer.1password.com/docs/cli/shell-plugins/nix/
programs._1password-shell-plugins = lib.mkIf config._1password {
# enable 1Password shell plugins for bash, zsh, and fish shell

View File

@@ -0,0 +1,32 @@
{ config, lib, ... }:
{
programs.ssh = lib.mkIf config.ssh {
enable = true;
extraConfig = ''
SetEnv TERM="xterm-256color"
${lib.optionalString config._1password "IdentityAgent ~/.1password/agent.sock"}
'';
matchBlocks = lib.mkMerge [
(lib.mkIf (config.profile == "personal") {
"panoptes" = {
hostname = "192.168.1.107";
user = "panoptes";
};
"pve5070" = {
hostname = "192.168.1.130";
user = "root";
};
"nix-test" = {
hostname = "192.168.1.36";
user = "john";
};
})
(lib.mkIf (config.profile == "work") {
"ubuntu-nvidia" = {
hostname = "10.118.46.120";
user = "john";
};
})
];
};
}

View File

@@ -4,6 +4,10 @@ let
in
{
environment.systemPackages = with pkgs; [
(writeShellScriptBin "nhmu" ''
nix flake update --flake ~/.config/home-manager
nix run home-manager -- switch --flake ~/.config/home-manager
'')
(pkgs.writeShellScriptBin "nfs" ''
sudo nixos-rebuild switch --flake $(readlink -f /etc/nixos)#${hostName} --impure
'')