Set up pulse, pipewire and flameshot

This commit is contained in:
Natsu Kagami 2022-04-25 11:54:36 -04:00
parent 615b6b26bd
commit 841c5180ba
Signed by: nki
GPG key ID: 7306B3D3C3AD6E51
3 changed files with 74 additions and 34 deletions

View file

@ -75,41 +75,48 @@ in
#
# Terminal
terminal = cfg.terminal;
menu = "${pkgs.dmenu}/bin/dmenu_path | ${pkgs.bemenu}/bin/bemenu | ${pkgs.findutils}/bin/xargs swaymsg exec --";
# Startup
startup = [
# Dex for autostart
{ command = "${pkgs.dex}/bin/dex -ae sway"; }
# Waybar
{ command = "systemctl --user restart waybar"; always = true; }
# Startup programs
{ command = "${pkgs.flameshot}/bin/flameshot"; }
{ command = "${pkgs.firefox}/bin/firefox"; }
{ command = "${pkgs.unstable.discord}/bin/discord"; }
];
### Keybindings
#
# Main modifier
modifier = mod;
keybindings = lib.mkOptionDefault ({
## Splits
"${mod}+v" = "split v";
"${mod}+Shift+v" = "split h";
## Run
"${mod}+r" = "exec ${config.wayland.windowManager.sway.config.menu}";
"${mod}+Shift+r" = "mode resize";
# "${mod}+d" = "exec i3-dmenu-desktop --dmenu='${pkgs.dmenu}/bin/dmenu -i'";
} // (
# Map the workspaces
builtins.listToAttrs (lib.flatten (map
(key: [
{
name = "${mod}+${key}";
value = "workspace ${builtins.getAttr key wsAttrs}";
}
{
name = "${mod}+Shift+${key}";
value = "move to workspace ${builtins.getAttr key wsAttrs}";
}
])
(builtins.attrNames wsAttrs))
)));
keybindings = lib.mkOptionDefault
({
## Splits
"${mod}+v" = "split v";
"${mod}+Shift+v" = "split h";
## Run
"${mod}+r" = "exec ${config.wayland.windowManager.sway.config.menu}";
"${mod}+Shift+r" = "mode resize";
## Screenshot
"Print" = "exec ${pkgs.flameshot}/bin/flameshot gui";
} // (
# Map the workspaces
builtins.listToAttrs (lib.flatten (map
(key: [
{
name = "${mod}+${key}";
value = "workspace ${builtins.getAttr key wsAttrs}";
}
{
name = "${mod}+Shift+${key}";
value = "move to workspace ${builtins.getAttr key wsAttrs}";
}
])
(builtins.attrNames wsAttrs))
)));
### Fonts
#
@ -139,7 +146,7 @@ in
];
};
focus.followMouse = true;
focus.mouseWarping = false;
focus.mouseWarping = true;
focus.newWindow = "urgent";
# Gaps
gaps.outer = 3;
@ -169,9 +176,26 @@ in
export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
'';
# Extra
systemdIntegration = true;
wrapperFeatures.base = true;
wrapperFeatures.gtk = true;
# Fix D-Bus starting up
extraConfig = ''
exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK && \
hash dbus-update-activation-environment 2>/dev/null && \
dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK && \
systemctl --user start sway-session.target
'';
};
config.systemd.user.targets.sway-session = {
Unit = {
Description = "sway compositor session";
Documentation = [ "man:systemd.special(7)" ];
BindsTo = [ "graphical-session.target" ];
Wants = [ "graphical-session-pre.target" ];
After = [ "graphical-session-pre.target" ];
};
};
config.programs.waybar = mkIf cfg.enable {

View file

@ -76,11 +76,17 @@
# Enable sound.
sound.enable = true;
hardware.pulseaudio = {
services.pipewire = {
enable = true;
extraModules = [ pkgs.pulseaudio-modules-bt ];
package = pkgs.pulseaudioFull;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
# hardware.pulseaudio = {
# enable = true;
# extraModules = [ pkgs.pulseaudio-modules-bt ];
# package = pkgs.pulseaudioFull;
# };
# Enable bluetooth
hardware.bluetooth.enable = true;
@ -122,6 +128,11 @@
VISUAL = "kak";
};
# Enable some xdg stuff
services.dbus.enable = true;
xdg.portal.enable = true;
xdg.portal.wlr.enable = true;
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;

View file

@ -5,7 +5,8 @@
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
[
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci" ];
@ -14,23 +15,27 @@
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/bc8b0807-c3d6-4893-bcc2-02f059a51a80";
{
device = "/dev/disk/by-uuid/bc8b0807-c3d6-4893-bcc2-02f059a51a80";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/885D-D058";
{
device = "/dev/disk/by-uuid/885D-D058";
fsType = "vfat";
};
fileSystems."/home" =
{ device = "/dev/disk/by-uuid/a981870f-db1d-4441-81da-f1bab1ecc37c";
{
device = "/dev/disk/by-uuid/a981870f-db1d-4441-81da-f1bab1ecc37c";
fsType = "btrfs";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/2694d189-2ff6-4719-a449-367c52ed3ad6"; }
];
[{ device = "/dev/disk/by-uuid/2694d189-2ff6-4719-a449-367c52ed3ad6"; }];
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.opengl.enable = true;
}