grimm-nixos-laptop/common/networking.nix

33 lines
824 B
Nix
Raw Normal View History

2024-04-10 16:51:28 +02:00
{ pkgs, config, lib, ... }:
let
2024-03-24 16:59:47 +01:00
cfg = config.grimmShared;
2024-04-10 16:51:28 +02:00
in
{
config = with cfg; lib.mkIf (enable && network) {
networking.networkmanager.enable = true;
networking.useDHCP = lib.mkDefault true;
2024-03-24 16:59:47 +01:00
hardware.bluetooth.enable = true;
2024-04-10 16:51:28 +02:00
environment.systemPackages = with pkgs; [
wireguard-tools
bluetuith
];
2024-04-13 19:16:33 +02:00
services.blueman.enable = lib.mkIf graphical true;
systemd.user.services.mpris-proxy = lib.mkIf sound {
description = "Mpris proxy";
after = [ "network.target" "sound.target" ];
wantedBy = [ "default.target" ];
serviceConfig.ExecStart = "${pkgs.bluez}/bin/mpris-proxy";
};
};
options.grimmShared.network = with lib; mkOption {
type = types.bool;
default = false;
description = "Enables network manager, wifi and bluetooth";
};
2024-03-24 16:59:47 +01:00
}