make networking more tightly controlled by config values

This commit is contained in:
LordGrimmauld 2024-03-16 18:21:50 +01:00
parent a24bafbb17
commit 1816d49646
2 changed files with 24 additions and 19 deletions

View File

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

View File

@ -53,7 +53,7 @@ in {
glxinfo glxinfo
alacritty alacritty
vulkan-tools vulkan-tools
pdfaranger pdfarranger
nomacs nomacs
gparted gparted
]; ];