Add bluetooth and audio stuff

This commit is contained in:
askiiart 2024-01-03 18:59:25 -05:00
parent ccabbaafce
commit d1e4f5bb6d
Signed by untrusted user who does not match committer: askiiart
GPG key ID: BC3800E55FB54D67
4 changed files with 87 additions and 23 deletions

@ -1 +1 @@
Subproject commit 118250f033a1574afe7162db6a02ccf2a4747648 Subproject commit 40ecaef7aa474bb868e1538d8dda17294d603489

View file

@ -36,7 +36,7 @@ in
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
# Set your time zone. # Set your time zone.
time.timeZone = "America/Chicago"; time.timeZone = "America/New_York";
# Configure network proxy if necessary # Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/"; # networking.proxy.default = "http://user:password@proxy:port/";
@ -90,7 +90,7 @@ in
# networking.firewall.allowedTCPPorts = [ ... ]; # networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ]; # networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether. # Or disable the firewall altogether.
# networking.firewall.enable = false; networking.firewall.enable = false;
# Copy the NixOS configuration file and link it from the resulting system # Copy the NixOS configuration file and link it from the resulting system
# (/run/current-system/configuration.nix). This is useful in case you # (/run/current-system/configuration.nix). This is useful in case you

View file

@ -15,7 +15,7 @@ in
# packages and other environment stuff # packages and other environment stuff
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
environment.systemPackages = [ environment.systemPackages = [
pkgs.mate.mate-polkit pkgs.polkit_gnome
pkgs.sway pkgs.sway
pkgs.swaybg pkgs.swaybg
pkgs.swaylock pkgs.swaylock
@ -80,26 +80,10 @@ in
# Define a user account. Don't forget to set a password with passwd. # Define a user account. Don't forget to set a password with passwd.
users.users.askiiart = { users.users.askiiart = {
isNormalUser = true; isNormalUser = true;
extraGroups = [ "wheel" "libvirtd" ]; # Enable sudo for the user. extraGroups = [ "wheel" "libvirtd" "audio" ]; # Enable sudo for the user.
shell = pkgs.fish; shell = pkgs.fish;
}; };
systemd = {
user.services.polkit-mate-authentication-agent-1 = {
description = "polkit-mate-authentication-agent-1";
wantedBy = [ "graphical-session.target" ];
wants = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.mate.mate-polkit}/libexec/polkit-mate-authentication-agent-1";
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
};
};
# for qemu # for qemu
boot.extraModprobeConfig = "options kvm_amd nested=1"; boot.extraModprobeConfig = "options kvm_amd nested=1";
@ -127,4 +111,65 @@ in
services.devmon.enable = true; services.devmon.enable = true;
services.gvfs.enable = true; services.gvfs.enable = true;
services.udisks2.enable = true; services.udisks2.enable = true;
# polkit config
# allow unprivileged users to reboot and poweroff
security.polkit.extraConfig = ''
polkit.addRule(function(action, subject) {
if (
subject.isInGroup("users")
&& (
action.id == "org.freedesktop.login1.reboot" ||
action.id == "org.freedesktop.login1.reboot-multiple-sessions" ||
action.id == "org.freedesktop.login1.power-off" ||
action.id == "org.freedesktop.login1.power-off-multiple-sessions"
)
)
{
return polkit.Result.YES;
}
})
'';
# polkit authentication agent (gnome_polkit)
systemd = {
user.services.polkit-gnome-authentication-agent-1 = {
description = "polkit-gnome-authentication-agent-1";
wantedBy = [ "graphical-session.target" ];
wants = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
};
};
# enable bluetooth and fix various audio issues
hardware.bluetooth.enable = true;
hardware.bluetooth.powerOnBoot = true;
services.blueman.enable = true;
# enable more codecs
hardware.bluetooth.settings = {
General = {
Enable = "Source,Sink,Media,Socket";
};
};
hardware.pulseaudio = {
enable = true;
package = pkgs.pulseaudioFull;
};
# use bluetooth headset buttons
systemd.user.services.mpris-proxy = {
description = "Mpris proxy";
after = [ "network.target" "sound.target" ];
wantedBy = [ "default.target" ];
serviceConfig.ExecStart = "${pkgs.bluez}/bin/mpris-proxy";
};
nixpkgs.config.pulseaudio = true;
hardware.pulseaudio.extraConfig = "load-module module-combine-sink module-dbus-protocol";
} }

View file

@ -4,7 +4,8 @@
home.packages = [ home.packages = [
pkgs.librewolf pkgs.librewolf
pkgs.thunderbird pkgs.thunderbird
pkgs.vscode #pkgs.vscode
pkgs.vscode-fhs
pkgs.kitty pkgs.kitty
pkgs.git pkgs.git
pkgs.file pkgs.file
@ -18,12 +19,30 @@
pkgs.virt-manager pkgs.virt-manager
pkgs.youtube-music pkgs.youtube-music
pkgs.gparted pkgs.gparted
pkgs.cinnamon.nemo-with-extensions #pkgs.cinnamon.nemo-with-extensions
pkgs.cinnamon.nemo
pkgs.cinnamon.mint-y-icons pkgs.cinnamon.mint-y-icons
pkgs.pinentry-gtk2 pkgs.pinentry-gtk2
pkgs.pass pkgs.pass
pkgs.dotnet-runtime_7 pkgs.dotnet-runtime_7
pkgs.fastfetch pkgs.fastfetch
pkgs.digikam pkgs.digikam
pkgs.gnome-hexgl
pkgs.mesa-demos
pkgs.gnumake
pkgs.gcc
pkgs.xorg.libX11
pkgs.nix-index
pkgs.drawing
pkgs.swaynotificationcenter
pkgs.brightnessctl
pkgs.pavucontrol
pkgs.python312
pkgs.blueman
pkgs.dnsutils
pkgs.docker
pkgs.gnome.gnome-keyring
pkgs.pandoc
pkgs.cinny-desktop
]; ];
} }