From c88a1ca201d61bee80ffc7c9008b2db890cd48d1 Mon Sep 17 00:00:00 2001 From: sadan <117494111+sadan4@users.noreply.github.com> Date: Wed, 2 Oct 2024 15:05:29 -0400 Subject: [PATCH] 262 current 2024-10-02 15:05:19 24.11.20240916.99dc878 6.11.0 * --- boxes/desktop/configuration.nix | 47 +++++---------------------------- common/modules/audio.nix | 14 ++++++++++ common/util.nix | 16 +++++++++++ 3 files changed, 36 insertions(+), 41 deletions(-) create mode 100644 common/modules/audio.nix create mode 100644 common/util.nix diff --git a/boxes/desktop/configuration.nix b/boxes/desktop/configuration.nix index c3b38b4..4a80597 100644 --- a/boxes/desktop/configuration.nix +++ b/boxes/desktop/configuration.nix @@ -6,46 +6,16 @@ let _v = import ../../common/programs/virt.nix { }; - wireshark = import ../../common/programs/wireshark.nix {}; + wireshark = import ../../common/programs/wireshark.nix { }; + # audio = import ../../common/modules/audio.nix { }; + util = import ../../common/util.nix { inherit pkgs; }; in { - fileSystems."/mnt/d" = { - device = "/dev/disks/by-uuid/A02A12F22A12C566"; - options = [ - "nofail" - "uid=1000" - "gid=100" - ]; - }; - fileSystems."/mnt/c" = { - device = "/dev/disks/by-uuid/046C2BB16C2B9D04"; - options = [ - "nofail" - "uid=1000" - "gid=100" - "noauto" - ]; - }; - fileSystems."/mnt/f" = { - device = "/dev/disks/by-uuid/2E06B65306B61C31"; - options = [ - "nofail" - "uid=1000" - "gid=100" - ]; - }; - fileSystems."/mnt/h" = { - device = "/dev/disks/by-uuid/E0A4F8C1A4F89B6C"; - options = [ - "nofail" - "uid=1000" - "gid=100" - ]; - }; imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix + ../../common/modules/audio.nix inputs.sops-nix.nixosModules.sops ]; sops.defaultSopsFile = ../../secrets.yaml; @@ -56,6 +26,7 @@ in isNormalUser = true; hashedPasswordFile = config.sops.secrets.password.path; extraGroups = [ + "wireshark" "kvm" "libvirtd" "wheel" # Enable ‘sudo’ for the user. @@ -139,12 +110,6 @@ in nix.settings.experimental-features = [ "nix-command" "flakes" ]; # Enable sound. # sound.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - }; # hardware.pulseaudio.enable = true; # Enable touchpad support (enabled default in most desktopManager). @@ -171,7 +136,7 @@ in # List packages installed in system profile. To search, run: # $ nix search wget environment.systemPackages = with pkgs; [ - clinfo + clinfo fuse ifuse ddcutil diff --git a/common/modules/audio.nix b/common/modules/audio.nix new file mode 100644 index 0000000..ef27fb2 --- /dev/null +++ b/common/modules/audio.nix @@ -0,0 +1,14 @@ +{...}: { + services = { + pipewire = { + enable = true; + alsa = { + enable = true; + support32Bit = true; + }; + pulse = { + enable = true; + }; + }; + }; +} diff --git a/common/util.nix b/common/util.nix new file mode 100644 index 0000000..e2c2db6 --- /dev/null +++ b/common/util.nix @@ -0,0 +1,16 @@ +{ pkgs }: with pkgs.lib; { + merge = attrList: + let + f = attrPath: + zipAttrsWith (n: values: + if tail values == [ ] + then head values + else if all isList values + then unique (concatLists values) + else if all isAttrs values + then f (attrPath ++ [ n ]) values + else last values + ); + in + f [ ] attrList; +}