refactor(nixos): move networking config to its own module
This commit is contained in:
parent
b7e9cdf51d
commit
5f71bc8925
3 changed files with 23 additions and 28 deletions
|
@ -10,7 +10,6 @@ in
|
||||||
imports = [
|
imports = [
|
||||||
./nvidia.nix
|
./nvidia.nix
|
||||||
./audio.nix
|
./audio.nix
|
||||||
./networking.nix
|
|
||||||
];
|
];
|
||||||
|
|
||||||
options.hardware = {
|
options.hardware = {
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
{ config, lib, ... }:
|
|
||||||
let
|
|
||||||
inherit (lib) singleton;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
config = {
|
|
||||||
networking = {
|
|
||||||
enableIPv6 = false;
|
|
||||||
useDHCP = lib.mkDefault true;
|
|
||||||
hostName = config.system.hostname;
|
|
||||||
networkmanager.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
services.openssh = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
PrintMotd = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.tailscale = {
|
|
||||||
enable = true;
|
|
||||||
authKeyFile = config.sops.secrets."keys/tailscale".path;
|
|
||||||
};
|
|
||||||
persistDirs = singleton "/var/lib/tailscale";
|
|
||||||
};
|
|
||||||
}
|
|
23
modules/nixos/networking/default.nix
Normal file
23
modules/nixos/networking/default.nix
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
inherit (lib) mkDefault singleton;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
networking = {
|
||||||
|
enableIPv6 = false;
|
||||||
|
useDHCP = mkDefault true;
|
||||||
|
hostName = config.system.hostname;
|
||||||
|
networkmanager.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
services.openssh = {
|
||||||
|
enable = true;
|
||||||
|
settings.PrintMotd = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
services.tailscale = {
|
||||||
|
enable = true;
|
||||||
|
authKeyFile = config.sops.secrets."keys/tailscale".path;
|
||||||
|
};
|
||||||
|
persistDirs = singleton "/var/lib/tailscale";
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue