🚚 [shared] Added shared config that shared desktop config inherits from
This commit is contained in:
3
shared/base/home-manager/default.nix
Normal file
3
shared/base/home-manager/default.nix
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
imports = [ ./ssh.nix ];
|
||||
}
|
27
shared/base/home-manager/ssh.nix
Normal file
27
shared/base/home-manager/ssh.nix
Normal file
@ -0,0 +1,27 @@
|
||||
# ~/.ssh/config
|
||||
{
|
||||
systemConfig,
|
||||
systems,
|
||||
common,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
matchBlocks =
|
||||
let
|
||||
block = hostname: {
|
||||
port = 22;
|
||||
user = systemConfig.username;
|
||||
hostname = "${hostname}.dns.${common.domain}";
|
||||
};
|
||||
in
|
||||
{
|
||||
desktop = block "desktop";
|
||||
homelab = block "admin"; # TODO rename to homelab
|
||||
pi4 = block "pi4";
|
||||
thinkpad = block "thinkpad";
|
||||
};
|
||||
};
|
||||
}
|
3
shared/base/modules/default.nix
Normal file
3
shared/base/modules/default.nix
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
imports = [ ./networking.nix ];
|
||||
}
|
26
shared/base/modules/networking.nix
Normal file
26
shared/base/modules/networking.nix
Normal file
@ -0,0 +1,26 @@
|
||||
{ pkgs, systemConfig, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
wget
|
||||
];
|
||||
|
||||
networking = {
|
||||
networkmanager.enable = true;
|
||||
hostName = systemConfig.hostName;
|
||||
# wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||
};
|
||||
|
||||
# Configure network proxy if necessary
|
||||
# networking.proxy.default = "http://user:password@proxy:port/";
|
||||
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
||||
# Open ports in the firewall.
|
||||
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||
# Or disable the firewall altogether.
|
||||
# networking.firewall.enable = false;
|
||||
|
||||
programs.ssh.enableAskPassword = false;
|
||||
|
||||
services.tailscale.enable = true;
|
||||
}
|
Reference in New Issue
Block a user