grimm-nix-shared/modules/networking.nix

30 lines
845 B
Nix
Raw Permalink Normal View History

2024-03-16 12:52:08 +01:00
{ pkgs, config, lib, ... }: let
cfg = config.grimmShared;
in {
2024-03-16 18:24:37 +01:00
config = lib.mkMerge [
(with cfg; lib.mkIf (enable && network) {
networking.networkmanager.enable = true;
networking.useDHCP = lib.mkDefault true;
networking.firewall.enable = true;
2024-03-16 12:52:08 +01:00
hardware.bluetooth.enable = true;
2024-03-16 12:52:08 +01:00
environment.systemPackages = with pkgs; [
wireguard-tools
bluetuith
];
2024-03-16 18:24:37 +01:00
})
(with cfg; lib.mkIf (enable && network && graphical) {
services.blueman.enable = true;
})
2024-03-16 18:24:37 +01:00
(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";
};
})
];
2024-03-16 12:52:08 +01:00
}