grimm-nixos-laptop/common/networking.nix

30 lines
845 B
Nix
Raw Normal View History

2024-03-24 16:59:47 +01:00
{ pkgs, config, lib, ... }: let
cfg = config.grimmShared;
in {
config = lib.mkMerge [
(with cfg; lib.mkIf (enable && network) {
networking.networkmanager.enable = true;
networking.useDHCP = lib.mkDefault true;
networking.firewall.enable = true;
hardware.bluetooth.enable = true;
environment.systemPackages = with pkgs; [
wireguard-tools
bluetuith
];
})
(with cfg; lib.mkIf (enable && network && graphical) {
services.blueman.enable = true;
})
(with cfg; lib.mkIf (enable && network && sound) {
systemd.user.services.mpris-proxy = {
description = "Mpris proxy";
after = [ "network.target" "sound.target" ];
wantedBy = [ "default.target" ];
serviceConfig.ExecStart = "${pkgs.bluez}/bin/mpris-proxy";
};
})
];
}