home-manager/configs: Add macsimum and use SSH extraConfig

This commit is contained in:
Jack O'Sullivan 2022-02-21 13:19:21 +00:00
parent 953770f339
commit 7180d265c4
5 changed files with 64 additions and 43 deletions

6
flake.lock generated
View File

@ -210,11 +210,11 @@
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1644613700,
"narHash": "sha256-wLRPJclMH8vsHuFtyI78aF09lw5mbi3lMB6uiK5S2wE=",
"lastModified": 1645334861,
"narHash": "sha256-We9ECiMglthzbZ5S6Myqqf+RHzBFZPoM2qL5/jDkUjs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "23d785aa6f853e6cf3430119811c334025bbef55",
"rev": "d5f237872975e6fb6f76eef1368b5634ffcd266f",
"type": "github"
},
"original": {

View File

@ -97,6 +97,7 @@
# Homes
home-manager/configs/castle.nix
home-manager/configs/macsimum.nix
];
nixfiles = evalModules {

View File

@ -15,6 +15,9 @@
hostname = "h.nul.ie";
sshOpts = [ "-4" "-p" "8022" ];
};
};
programs = {
ssh.matchBlocks = {
home = {
host =
@ -23,9 +26,7 @@
user = "root";
};
};
};
programs = {
kakoune.enable = true;
};
};

View File

@ -0,0 +1,19 @@
{
home-manager.homes."jack@macsimum" = {
system = "x86_64-darwin";
nixpkgs = "unstable";
homeDirectory = "/Users/jack";
username = "jack";
configuration = { pkgs, ... }:
{
my = {
deploy.enable = false;
};
programs = {
ssh.enable = false;
};
};
};
}

View File

@ -24,7 +24,6 @@ in
literal = mkOpt' (listOf singleLineStr) [ ] "List of OpenSSH keys to allow";
files = mkOpt' (listOf str) [ ] "List of OpenSSH key files to allow";
};
matchBlocks = mkOpt' (attrsOf anything) { } "SSH match blocks";
};
};
@ -48,35 +47,6 @@ in
isStandalone = !(args ? osConfig);
shell = mkDefault "${config.programs.fish.package}/bin/fish";
ssh = {
matchBlocks = {
nix-dev-vm = {
user = "dev";
hostname = "localhost";
port = 2222;
extraOptions = {
StrictHostKeyChecking = "no";
UserKnownHostsFile = "/dev/null";
};
};
"rsync.net" = {
host = "rsyncnet";
user = "16413";
hostname = "ch-s010.rsync";
};
shoe = {
host = "shoe.netsoc.tcd.ie shoe";
user = "netsoc";
};
netsocBoxes = {
host = "cube spoon napalm gandalf saruman";
user = "root";
};
};
};
};
home.file.".ssh/authorized_keys" = with config.my.ssh.authKeys;
@ -152,16 +122,38 @@ in
ssh = {
enable = mkDefault true;
matchBlocks = (mapAttrs (_: b: dag.entryBefore [ "all" ] b) config.my.ssh.matchBlocks) // {
all = {
host = "*";
identityFile = [
"~/.ssh/id_rsa"
"~/.ssh/netsoc"
"~/.ssh/borg"
];
matchBlocks = {
nix-dev-vm = {
user = "dev";
hostname = "localhost";
port = 2222;
extraOptions = {
StrictHostKeyChecking = "no";
UserKnownHostsFile = "/dev/null";
};
};
"rsync.net" = {
host = "rsyncnet";
user = "16413";
hostname = "ch-s010.rsync";
};
shoe = {
host = "shoe.netsoc.tcd.ie shoe";
user = "netsoc";
};
netsocBoxes = {
host = "cube spoon napalm gandalf saruman";
user = "root";
};
};
extraConfig =
''
IdentityFile ~/.ssh/id_rsa
IdentityFile ~/.ssh/netsoc
IdentityFile ~/.ssh/borg
'';
};
direnv = {
@ -197,6 +189,7 @@ in
file
tree
iperf3
mosh
];
sessionVariables = {
@ -256,5 +249,12 @@ in
};
})
]))
(mkIf (pkgs.stdenv.isDarwin && config.my.isStandalone) {
home = {
packages = with pkgs; [
cacert
];
};
})
];
}