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
terminal = cfg.terminal; terminal = cfg.terminal;
menu = "${pkgs.dmenu}/bin/dmenu_path | ${pkgs.bemenu}/bin/bemenu | ${pkgs.findutils}/bin/xargs swaymsg exec --";
# Startup # Startup
startup = [ startup = [
# Dex for autostart # Dex for autostart
{ command = "${pkgs.dex}/bin/dex -ae sway"; } { command = "${pkgs.dex}/bin/dex -ae sway"; }
# Waybar # Waybar
{ command = "systemctl --user restart waybar"; always = true; } { 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 ### Keybindings
# #
# Main modifier # Main modifier
modifier = mod; modifier = mod;
keybindings = lib.mkOptionDefault ({ keybindings = lib.mkOptionDefault
## Splits ({
"${mod}+v" = "split v"; ## Splits
"${mod}+Shift+v" = "split h"; "${mod}+v" = "split v";
## Run "${mod}+Shift+v" = "split h";
"${mod}+r" = "exec ${config.wayland.windowManager.sway.config.menu}"; ## Run
"${mod}+Shift+r" = "mode resize"; "${mod}+r" = "exec ${config.wayland.windowManager.sway.config.menu}";
# "${mod}+d" = "exec i3-dmenu-desktop --dmenu='${pkgs.dmenu}/bin/dmenu -i'"; "${mod}+Shift+r" = "mode resize";
} // ( ## Screenshot
# Map the workspaces "Print" = "exec ${pkgs.flameshot}/bin/flameshot gui";
builtins.listToAttrs (lib.flatten (map } // (
(key: [ # Map the workspaces
{ builtins.listToAttrs (lib.flatten (map
name = "${mod}+${key}"; (key: [
value = "workspace ${builtins.getAttr key wsAttrs}"; {
} name = "${mod}+${key}";
{ value = "workspace ${builtins.getAttr key wsAttrs}";
name = "${mod}+Shift+${key}"; }
value = "move to workspace ${builtins.getAttr key wsAttrs}"; {
} name = "${mod}+Shift+${key}";
]) value = "move to workspace ${builtins.getAttr key wsAttrs}";
(builtins.attrNames wsAttrs)) }
))); ])
(builtins.attrNames wsAttrs))
)));
### Fonts ### Fonts
# #
@ -139,7 +146,7 @@ in
]; ];
}; };
focus.followMouse = true; focus.followMouse = true;
focus.mouseWarping = false; focus.mouseWarping = true;
focus.newWindow = "urgent"; focus.newWindow = "urgent";
# Gaps # Gaps
gaps.outer = 3; gaps.outer = 3;
@ -169,9 +176,26 @@ in
export QT_WAYLAND_DISABLE_WINDOWDECORATION="1" export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
''; '';
# Extra # Extra
systemdIntegration = true;
wrapperFeatures.base = true; wrapperFeatures.base = true;
wrapperFeatures.gtk = 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 { config.programs.waybar = mkIf cfg.enable {

View file

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

View file

@ -5,7 +5,8 @@
{ {
imports = 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" ]; boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci" ];
@ -14,23 +15,27 @@
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" =
{ device = "/dev/disk/by-uuid/bc8b0807-c3d6-4893-bcc2-02f059a51a80"; {
device = "/dev/disk/by-uuid/bc8b0807-c3d6-4893-bcc2-02f059a51a80";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/885D-D058"; {
device = "/dev/disk/by-uuid/885D-D058";
fsType = "vfat"; fsType = "vfat";
}; };
fileSystems."/home" = fileSystems."/home" =
{ device = "/dev/disk/by-uuid/a981870f-db1d-4441-81da-f1bab1ecc37c"; {
device = "/dev/disk/by-uuid/a981870f-db1d-4441-81da-f1bab1ecc37c";
fsType = "btrfs"; fsType = "btrfs";
}; };
swapDevices = 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.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.opengl.enable = true;
} }