add network

This commit is contained in:
LordGrimmauld 2024-03-16 12:52:08 +01:00
parent 8f1b6f492d
commit 9ec27bed57
2 changed files with 31 additions and 0 deletions

View File

@ -23,11 +23,18 @@ in {
default = false; default = false;
description = "Enables portals for wlr, gtk and kde as well as fixes fonts"; description = "Enables portals for wlr, gtk and kde as well as fixes fonts";
}; };
network = mkOption {
type = types.bool;
default = false;
description = "Enables network manager, wifi and bluetooth";
};
}; };
imports = [ imports = [
./modules/localisation.nix ./modules/localisation.nix
./modules/printing.nix ./modules/printing.nix
./modules/portals.nix ./modules/portals.nix
./modules/networking.nix
]; ];
} }

24
modules/networking.nix Normal file
View File

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