36 lines
813 B
Nix
36 lines
813 B
Nix
|
{ pkgs, lib, ... }:
|
||
|
let
|
||
|
eduroam-active = pkgs.writeShellApplication {
|
||
|
name = "eduroam-active";
|
||
|
runtimeInputs = with pkgs; [
|
||
|
networkmanager
|
||
|
];
|
||
|
text = ''
|
||
|
nmcli -g GENERAL.STATE c s interface|grep -q -E '\bactiv'
|
||
|
'';
|
||
|
};
|
||
|
in
|
||
|
{
|
||
|
programs.ssh = {
|
||
|
enable = true;
|
||
|
controlMaster = "auto";
|
||
|
|
||
|
matchBlocks = {
|
||
|
"bmo.uio.no-on-eduroam" = lib.hm.dag.entryBefore [ "bmo.uio.no" ] {
|
||
|
match = "host bmo.uio.no exec \"nmcli -g GENERAL.STATE c s eduroam|grep -q -E '\\bactiv'\"";
|
||
|
hostname = "bmo.uio.no";
|
||
|
forwardAgent = false;
|
||
|
};
|
||
|
|
||
|
"bmo.uio.no" = {
|
||
|
setEnv = {
|
||
|
# TERM = "xterm-256color";
|
||
|
};
|
||
|
hostname = "bmo.uio.no";
|
||
|
forwardAgent = false;
|
||
|
proxyJump = "torjus@rlogin.uio.no";
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
}
|