refactor
This commit is contained in:
parent
66c05f9093
commit
45d6f4b0f3
205 changed files with 9040 additions and 342 deletions
32
modules/nixos/hardware/networking/default.nix
Normal file
32
modules/nixos/hardware/networking/default.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
{ options, config, pkgs, lib, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.plusultra;
|
||||
let cfg = config.plusultra.hardware.networking;
|
||||
in
|
||||
{
|
||||
options.plusultra.hardware.networking = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable networking support";
|
||||
hosts = mkOpt attrs { }
|
||||
(mdDoc "An attribute set to merge with `networking.hosts`");
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
plusultra.user.extraGroups = [ "networkmanager" ];
|
||||
|
||||
networking = {
|
||||
hosts = {
|
||||
"127.0.0.1" = [ "local.test" ] ++ (cfg.hosts."127.0.0.1" or [ ]);
|
||||
} // cfg.hosts;
|
||||
|
||||
networkmanager = {
|
||||
enable = true;
|
||||
dhcp = "internal";
|
||||
};
|
||||
};
|
||||
|
||||
# Fixes an issue that normally causes nixos-rebuild to fail.
|
||||
# https://github.com/NixOS/nixpkgs/issues/180175
|
||||
systemd.services.NetworkManager-wait-online.enable = false;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue