Move SSH configs into specific collections

This commit is contained in:
Evie Litherland-Smith 2023-05-05 13:20:32 +01:00
parent 00dfa03827
commit 5002cf9d48
3 changed files with 41 additions and 36 deletions

View file

@ -4,6 +4,19 @@
../common/desktop.nix
../../git/personal.nix
];
programs.ssh.matchBlocks = {
"legion xenia xenia.me.uk" = {
user = "xenia";
hostname = "xenia.me.uk";
port = 30;
forwardAgent = true;
};
"vanguard" = {
user = "xenia";
hostname = "192.168.1.166";
forwardAgent = true;
};
};
home.packages = with pkgs; [
discord
element-desktop

View file

@ -1,9 +1,34 @@
{ pkgs, ... }:
{ pkgs, lib, ... }:
{
imports = [
../common/desktop.nix
../../git/work.nix
];
programs.ssh.matchBlocks = {
"batch" = {
user = "cxsbatch";
hostname = "heimdall115.jetdata.eu";
};
"jupyter" = {
hostname = "freia022.hpc.l";
localForwards = [
{
bind.port = 6702;
host.address = "localhost";
host.port = 6702;
}
];
};
"freia" = {
hostname = "freia022.hpc.l";
};
"freia???" = lib.hm.dag.entryAfter [ "freia" ] {
hostname = "%h.hpc.l";
};
"freia* jupyter" = lib.hm.dag.entryAfter [ "freia" "freia???" "jupyter" ] {
user = "elitherl";
};
};
home.packages = with pkgs; [
libreoffice-fresh
neovide

37
home/env/ssh.nix vendored
View file

@ -1,4 +1,4 @@
{ pkgs, lib, ... }:
{ pkgs, ... }:
{
programs.ssh = {
enable = true;
@ -7,40 +7,7 @@
serverAliveCountMax = 3;
controlMaster = "auto";
controlPersist = "1s";
matchBlocks = {
"legion xenia xenia.me.uk" = {
user = "xenia";
hostname = "xenia.me.uk";
port = 30;
forwardAgent = true;
};
"vanguard" = {
user = "xenia";
hostname = "192.168.1.166";
forwardAgent = true;
};
"git.ccfe.ac.uk".user = "git";
"batch" = {
user = "cxsbatch";
hostname = "heimdall115.jetdata.eu";
};
"freia" = {
hostname = "freia022.hpc.l";
remoteForwards = [
{
bind.port = 6702;
host.address = "localhost";
host.port = 6702;
}
];
};
"freia???" = lib.hm.dag.entryAfter ["freia"] {
hostname = "%h.hpc.l";
};
"freia*" = lib.hm.dag.entryAfter ["freia???"] {
user = "elitherl";
};
};
matchBlocks."git.*".user = "git";
};
home.packages = with pkgs; [ sshfs ];
}