move networking to modules in prep for work laptop
This commit is contained in:
parent
e1ae29834e
commit
e628f55645
9 changed files with 71 additions and 50 deletions
|
@ -144,10 +144,13 @@ in {
|
|||
};
|
||||
|
||||
poz = {
|
||||
other.home-manager = {
|
||||
other = {
|
||||
home-manager = {
|
||||
enable = true;
|
||||
enableDirenv = true;
|
||||
};
|
||||
networking.enable = true;
|
||||
};
|
||||
programs = {
|
||||
agenix.enable = true;
|
||||
nh = let
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
../../options/common/disk.nix
|
||||
../../options/common/docs.nix
|
||||
../../options/common/kernel.nix
|
||||
../../options/common/networking.nix
|
||||
../../options/common/nix.nix
|
||||
../../options/common/oomd.nix
|
||||
../../options/common/pin-registry.nix
|
||||
|
|
|
@ -46,10 +46,13 @@
|
|||
};
|
||||
|
||||
poz = {
|
||||
other.home-manager = {
|
||||
other = {
|
||||
home-manager = {
|
||||
enable = true;
|
||||
enableDirenv = true;
|
||||
};
|
||||
networking.enable = true;
|
||||
};
|
||||
programs = {
|
||||
agenix.enable = true;
|
||||
nh = let
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
../../options/common/disk.nix
|
||||
../../options/common/docs.nix
|
||||
../../options/common/kernel.nix
|
||||
../../options/common/networking.nix
|
||||
../../options/common/nix.nix
|
||||
../../options/common/oomd.nix
|
||||
../../options/common/pin-registry.nix
|
||||
|
|
|
@ -75,10 +75,13 @@ in {
|
|||
#powerManagement.powertop.enable = true;
|
||||
|
||||
poz = {
|
||||
other.home-manager = {
|
||||
other = {
|
||||
home-manager = {
|
||||
enable = true;
|
||||
enableDirenv = true;
|
||||
};
|
||||
networking.enable = true;
|
||||
};
|
||||
programs = {
|
||||
agenix.enable = true;
|
||||
nh = let
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
../../options/common/gpu/amd.nix
|
||||
../../options/common/kernel.nix
|
||||
../../options/common/libvirt.nix
|
||||
../../options/common/networking.nix
|
||||
../../options/common/nix.nix
|
||||
../../options/common/oomd.nix
|
||||
../../options/common/pin-registry.nix
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
imports = [
|
||||
./hardware.nix
|
||||
./home-manager.nix
|
||||
./networking.nix
|
||||
./system.nix
|
||||
./xdg.nix
|
||||
];
|
||||
|
|
52
modules/other/networking.nix
Normal file
52
modules/other/networking.nix
Normal file
|
@ -0,0 +1,52 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.poz.other.networking;
|
||||
inherit (config.poz.other.system) username;
|
||||
|
||||
inherit (lib.modules) mkForce mkIf;
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.types) listOf package;
|
||||
in {
|
||||
options.poz.other.networking = {
|
||||
enable = mkEnableOption "networking using NetworkManager";
|
||||
plugins = mkOption {
|
||||
description = "NetworkManager plugins";
|
||||
type = listOf package;
|
||||
default = [];
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
networking = {
|
||||
networkmanager = {
|
||||
enable = true;
|
||||
dns = "systemd-resolved";
|
||||
plugins = mkForce cfg.plugins;
|
||||
# wifi.backend = "iwd";
|
||||
};
|
||||
firewall.checkReversePath = "loose";
|
||||
};
|
||||
|
||||
services.resolved = {
|
||||
enable = true;
|
||||
fallbackDns = [
|
||||
"9.9.9.9"
|
||||
"2620:fe::fe"
|
||||
];
|
||||
};
|
||||
|
||||
# don't wait for network to boot faster
|
||||
# https://old.reddit.com/r/NixOS/comments/vdz86j/how_to_remove_boot_dependency_on_network_for_a
|
||||
systemd = {
|
||||
targets.network-online.wantedBy = mkForce []; # default is [ "multi-user.target" ]
|
||||
services.NetworkManager-wait-online.wantedBy = mkForce []; # default is [ "network-online.target" ]
|
||||
};
|
||||
|
||||
users.users.${username} = {
|
||||
extraGroups = [ "networkmanager" ];
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (config.poz.other.system) username;
|
||||
|
||||
inherit (lib.modules) mkForce;
|
||||
in {
|
||||
networking = {
|
||||
networkmanager = {
|
||||
enable = true;
|
||||
dns = "systemd-resolved";
|
||||
plugins = mkForce [];
|
||||
# wifi.backend = "iwd";
|
||||
};
|
||||
firewall.checkReversePath = "loose";
|
||||
};
|
||||
|
||||
services.resolved = {
|
||||
enable = true;
|
||||
fallbackDns = [
|
||||
"9.9.9.9"
|
||||
"2620:fe::fe"
|
||||
];
|
||||
};
|
||||
|
||||
# don't wait for network to boot faster
|
||||
# https://old.reddit.com/r/NixOS/comments/vdz86j/how_to_remove_boot_dependency_on_network_for_a
|
||||
systemd = {
|
||||
targets.network-online.wantedBy = mkForce []; # default is [ "multi-user.target" ]
|
||||
services.NetworkManager-wait-online.wantedBy = mkForce []; # default is [ "network-online.target" ]
|
||||
};
|
||||
|
||||
users.users.${username} = {
|
||||
extraGroups = [ "networkmanager" ];
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue