grimm-nixos-laptop/common/network/default.nix

35 lines
700 B
Nix
Raw Normal View History

2024-05-07 23:31:41 +02:00
{
pkgs,
config,
lib,
...
}:
2024-04-10 16:51:28 +02:00
let
2024-05-11 22:55:59 +02:00
inherit (config.grimmShared) enable network laptop_hardware;
2024-04-10 16:51:28 +02:00
in
{
2024-05-11 22:55:59 +02:00
config = lib.mkIf (enable && network) {
2024-09-08 14:57:15 +02:00
networking.networkmanager = {
enable = true;
plugins = with pkgs; [ networkmanager-openvpn ];
};
2024-05-11 22:55:59 +02:00
networking.useDHCP = lib.mkDefault true;
2024-03-24 16:59:47 +01:00
2024-05-11 22:55:59 +02:00
hardware.bluetooth.enable = lib.mkDefault laptop_hardware.enable;
2024-04-10 16:51:28 +02:00
2024-05-11 22:55:59 +02:00
environment.systemPackages = with pkgs; [
wireguard-tools
openconnect
];
2024-05-08 21:49:37 +02:00
2024-05-11 22:55:59 +02:00
networking.firewall = {
enable = true;
allowPing = true;
2024-05-07 23:31:41 +02:00
};
2024-05-11 22:55:59 +02:00
};
imports = [ ./bluetooth.nix ];
2024-04-26 22:03:03 +02:00
options.grimmShared.network = lib.mkEnableOption "Enables network manager, wifi and bluetooth";
2024-03-24 16:59:47 +01:00
}