mirror of
https://github.com/RGBCube/ncc
synced 2026-01-14 09:11:00 +00:00
67 lines
1.5 KiB
Nix
67 lines
1.5 KiB
Nix
{ self, config, lib, pkgs, ... }: let
|
|
inherit (lib) enabled mkIf;
|
|
|
|
controlPath = "~/.ssh/control";
|
|
in {
|
|
secrets.sshConfig = {
|
|
file = ./config.age;
|
|
mode = "444";
|
|
};
|
|
|
|
home-manager.sharedModules = [{
|
|
home.activation.createControlPath = {
|
|
after = [ "writeBoundary" ];
|
|
before = [];
|
|
data = "mkdir --parents ${controlPath}";
|
|
};
|
|
|
|
programs.ssh = enabled {
|
|
controlMaster = "auto";
|
|
controlPath = "${controlPath}/%r@%n:%p";
|
|
controlPersist = "60m";
|
|
serverAliveCountMax = 2;
|
|
serverAliveInterval = 60;
|
|
|
|
includes = [ config.secrets.sshConfig.path ];
|
|
|
|
matchBlocks = {
|
|
"*" = {
|
|
setEnv.COLORTERM = "truecolor";
|
|
setEnv.TERM = "xterm-256color";
|
|
|
|
identityFile = "~/.ssh/id";
|
|
};
|
|
|
|
# TODO: Maybe autogenerate these?
|
|
|
|
best = {
|
|
hostname = self.best.networking.ipv4.address;
|
|
user = "the";
|
|
port = 2222;
|
|
};
|
|
|
|
cube = {
|
|
hostname = self.cube.networking.ipv4.address;
|
|
user = "rgb";
|
|
port = 2222;
|
|
};
|
|
|
|
disk = {
|
|
hostname = self.disk.networking.ipv4.address;
|
|
user = "floppy";
|
|
port = 2222;
|
|
};
|
|
|
|
nine = {
|
|
hostname = self.nine.networking.ipv4.address;
|
|
user = "seven";
|
|
port = 2222;
|
|
};
|
|
};
|
|
};
|
|
}];
|
|
|
|
environment.systemPackages = mkIf config.isDesktop [
|
|
pkgs.mosh
|
|
];
|
|
}
|