52 lines
1.7 KiB
Nix
52 lines
1.7 KiB
Nix
{
|
|
lib,
|
|
config,
|
|
userSettings,
|
|
pkgs,
|
|
...
|
|
}: {
|
|
options = {
|
|
sys.network.enable = lib.mkEnableOption "Enable networking";
|
|
sys.bluetooth.enable = lib.mkEnableOption "Enable Bluetooth support";
|
|
sys.bluetooth.blueman.enable = lib.mkEnableOption "Enable Blueman App";
|
|
sys.bluetooth.media-player-control.enable = lib.mkEnableOption "Enable Media Player Control";
|
|
};
|
|
|
|
config = lib.mkMerge [
|
|
(lib.mkIf config.sys.network.enable {
|
|
networking.hostName = "${userSettings.hostname}"; # Define your hostname.
|
|
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
|
|
|
# Configure network proxy if necessary
|
|
# networking.proxy.default = "http://user:password@proxy:port/";
|
|
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
|
|
|
# Enable networking
|
|
networking.networkmanager.enable = true;
|
|
users.users.${userSettings.username}.extraGroups = ["networkmanager"];
|
|
networking.nameservers = ["192.168.8.140" "1.1.1.1"];
|
|
})
|
|
(
|
|
lib.mkIf config.sys.bluetooth.enable {
|
|
hardware.bluetooth.enable = true; # enables support for Bluetooth
|
|
hardware.bluetooth.powerOnBoot = true; # powers up the default Bluetooth controller on boot
|
|
}
|
|
)
|
|
(
|
|
lib.mkIf config.sys.bluetooth.blueman.enable {
|
|
services.blueman.enable = true;
|
|
}
|
|
)
|
|
(
|
|
lib.mkIf config.sys.bluetooth.media-player-control.enable {
|
|
systemd.user.services.mpris-proxy = {
|
|
description = "Mpris proxy";
|
|
after = ["network.target" "sound.target"];
|
|
wantedBy = ["default.target"];
|
|
serviceConfig.ExecStart = "${pkgs.bluez}/bin/mpris-proxy";
|
|
};
|
|
}
|
|
)
|
|
];
|
|
}
|