diff options
author | Franck Cuny <franck@fcuny.net> | 2023-05-02 17:50:50 -0700 |
---|---|---|
committer | Franck Cuny <franck@fcuny.net> | 2023-05-02 17:50:50 -0700 |
commit | 80b2a5ed2cf30c66ec75480c24c53c7b329c3381 (patch) | |
tree | 11c574af791e9a71ec39b03ffa682b58584bf796 /modules | |
parent | profiles/default: move default packages there (diff) | |
download | world-80b2a5ed2cf30c66ec75480c24c53c7b329c3381.tar.gz |
profiles/hardware: create a few profiles related to hardware
Diffstat (limited to '')
-rw-r--r-- | modules/default.nix | 2 | ||||
-rw-r--r-- | modules/hardware/amd/default.nix | 14 | ||||
-rw-r--r-- | modules/hardware/bluetooth/default.nix | 65 | ||||
-rw-r--r-- | modules/hardware/default.nix | 5 | ||||
-rw-r--r-- | modules/hardware/intel/default.nix | 14 | ||||
-rw-r--r-- | modules/hardware/networking/default.nix | 12 | ||||
-rw-r--r-- | modules/hardware/ssd/default.nix | 5 |
7 files changed, 1 insertions, 116 deletions
diff --git a/modules/default.nix b/modules/default.nix index 96e66fb..d08b890 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,7 +1,7 @@ { lib, ... }: { - imports = [ ./hardware ./system ./services ./programs ./secrets ]; + imports = [ ./system ./services ./programs ./secrets ]; options.my = with lib; { user = { diff --git a/modules/hardware/amd/default.nix b/modules/hardware/amd/default.nix deleted file mode 100644 index e8b80b0..0000000 --- a/modules/hardware/amd/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ config, lib, ... }: -let cfg = config.my.hardware.amd; -in -{ - options.my.hardware.amd = with lib; { - enable = mkEnableOption "AMD related configuration"; - }; - - config = lib.mkIf cfg.enable { - # Enable microcode update - hardware.cpu.amd.updateMicrocode = true; - boot.kernelModules = [ "kvm-amd" ]; - }; -} diff --git a/modules/hardware/bluetooth/default.nix b/modules/hardware/bluetooth/default.nix deleted file mode 100644 index b48c51c..0000000 --- a/modules/hardware/bluetooth/default.nix +++ /dev/null @@ -1,65 +0,0 @@ -{ config, lib, pkgs, ... }: -let cfg = config.my.hardware.bluetooth; -in -{ - options.my.hardware.bluetooth = with lib; { - enable = mkEnableOption "bluetooth configuration"; - }; - - config = lib.mkIf cfg.enable { - hardware.bluetooth.enable = true; - services.blueman.enable = true; - - hardware.pulseaudio = { - extraModules = [ pkgs.pulseaudio-modules-bt ]; - package = pkgs.pulseaudioFull; - }; - - environment.etc = { - "wireplumber/bluetooth.lua.d/50-bluez-config.lua".text = '' - bluez_monitor.properties = { - ["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]", - -- mSBC provides better audio + microphone - ["bluez5.enable-msbc"] = true, - -- SBC XQ provides better audio - ["bluez5.enable-sbc-xq"] = true, - -- Hardware volume control - ["bluez5.enable-hw-volume"] = true, - } - ''; - }; - - services.pipewire = { - media-session.config.bluez-monitor.rules = [ - { - # Matches all cards - matches = [{ "device.name" = "~bluez_card.*"; }]; - actions = { - "update-props" = { - "bluez5.reconnect-profiles" = [ "hfp_hf" "hsp_hs" "a2dp_sink" ]; - # mSBC provides better audio + microphone - "bluez5.msbc-support" = true; - # SBC XQ provides better audio - "bluez5.sbc-xq-support" = true; - }; - }; - } - { - matches = [ - # Matches all sources - { - "node.name" = "~bluez_input.*"; - } - # Matches all outputs - { "node.name" = "~bluez_output.*"; } - ]; - actions = { "node.pause-on-idle" = false; }; - } - ]; - }; - - hardware.bluetooth.settings = { - General = { Enable = "Source,Sink,Media,Socket"; }; - }; - }; -} diff --git a/modules/hardware/default.nix b/modules/hardware/default.nix deleted file mode 100644 index 6d1441f..0000000 --- a/modules/hardware/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ ... }: - -{ - imports = [ ./amd ./bluetooth ./intel ./ssd ./networking ]; -} diff --git a/modules/hardware/intel/default.nix b/modules/hardware/intel/default.nix deleted file mode 100644 index 26d9877..0000000 --- a/modules/hardware/intel/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ config, lib, ... }: -let cfg = config.my.hardware.intel; -in -{ - options.my.hardware.intel = with lib; { - enable = mkEnableOption "intel related configuration"; - }; - - config = lib.mkIf cfg.enable { - # Enable microcode update - hardware.cpu.intel.updateMicrocode = true; - boot.kernelModules = [ "kvm-intel" ]; - }; -} diff --git a/modules/hardware/networking/default.nix b/modules/hardware/networking/default.nix deleted file mode 100644 index fac6c30..0000000 --- a/modules/hardware/networking/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ config, lib, ... }: -let cfg = config.my.hardware.networking; -in -{ - options.my.hardware.networking = with lib; { - wireless = { enable = mkEnableOption "wireless configuration"; }; - }; - - config = lib.mkMerge [ - (lib.mkIf cfg.wireless.enable { networking.wireless.iwd.enable = true; }) - ]; -} diff --git a/modules/hardware/ssd/default.nix b/modules/hardware/ssd/default.nix deleted file mode 100644 index 935c217..0000000 --- a/modules/hardware/ssd/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ ... }: - -{ - services.fstrim.enable = true; -} |