feat(ssh/openssh): overhauling ssh and openssh modules
This commit is contained in:
@@ -25,7 +25,6 @@ in
|
||||
];
|
||||
shellAbbrs = {
|
||||
extract = "extract.sh";
|
||||
nixcleanboot = "sudo nix run /home/$USER/.nix-config#cleanup-boot";
|
||||
nixclean = "nh clean all --keep 3";
|
||||
nixdev = "nix develop ~/.nix-config -c $SHELL";
|
||||
nixup = "nh os switch -H $hostname";
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
{
|
||||
outputs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
nixosConfigs = builtins.attrNames outputs.nixosConfigurations;
|
||||
homeConfigs = map (n: lib.last (lib.splitString "@" n)) (
|
||||
builtins.attrNames outputs.homeConfigurations
|
||||
);
|
||||
hostnames = lib.unique (homeConfigs ++ nixosConfigs);
|
||||
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.home.programs.ssh;
|
||||
in
|
||||
@@ -13,8 +20,23 @@ in
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
userKnownHostsFile = "~/.ssh/known_hosts";
|
||||
matchBlocks = {
|
||||
net = {
|
||||
host = lib.concatStringsSep " " (
|
||||
lib.flatten (
|
||||
map (host: [
|
||||
host
|
||||
"${host}.local"
|
||||
]) hostnames
|
||||
)
|
||||
);
|
||||
extraOptions.StreamLocalBindUnlink = "yes";
|
||||
forwardAgent = true;
|
||||
forwardX11 = true;
|
||||
forwardX11Trusted = true;
|
||||
setEnv.WAYLAND_DISPLAY = "wayland-waypipe";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user