mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-09-11 15:08:33 +01:00
Merge pull request #49687 from gnidorah/sway
sway-beta module: add missing pieces
This commit is contained in:
commit
f319c7fc89
|
@ -5,6 +5,15 @@ with lib;
|
||||||
let
|
let
|
||||||
cfg = config.programs.sway-beta;
|
cfg = config.programs.sway-beta;
|
||||||
swayPackage = cfg.package;
|
swayPackage = cfg.package;
|
||||||
|
|
||||||
|
swayWrapped = pkgs.writeShellScriptBin "sway" ''
|
||||||
|
${cfg.extraSessionCommands}
|
||||||
|
exec ${pkgs.dbus.dbus-launch} --exit-with-session ${swayPackage}/bin/sway
|
||||||
|
'';
|
||||||
|
swayJoined = pkgs.symlinkJoin {
|
||||||
|
name = "sway-joined";
|
||||||
|
paths = [ swayWrapped swayPackage ];
|
||||||
|
};
|
||||||
in {
|
in {
|
||||||
options.programs.sway-beta = {
|
options.programs.sway-beta = {
|
||||||
enable = mkEnableOption ''
|
enable = mkEnableOption ''
|
||||||
|
@ -20,13 +29,30 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extraSessionCommands = mkOption {
|
||||||
|
type = types.lines;
|
||||||
|
default = "";
|
||||||
|
example = ''
|
||||||
|
export SDL_VIDEODRIVER=wayland
|
||||||
|
# needs qt5.qtwayland in systemPackages
|
||||||
|
export QT_QPA_PLATFORM=wayland
|
||||||
|
export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
|
||||||
|
# Fix for some Java AWT applications (e.g. Android Studio),
|
||||||
|
# use this if they aren't displayed properly:
|
||||||
|
export _JAVA_AWT_WM_NONREPARENTING=1
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
Shell commands executed just before Sway is started.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
extraPackages = mkOption {
|
extraPackages = mkOption {
|
||||||
type = with types; listOf package;
|
type = with types; listOf package;
|
||||||
default = with pkgs; [
|
default = with pkgs; [
|
||||||
xwayland dmenu
|
xwayland rxvt_unicode dmenu
|
||||||
];
|
];
|
||||||
defaultText = literalExample ''
|
defaultText = literalExample ''
|
||||||
with pkgs; [ xwayland dmenu ];
|
with pkgs; [ xwayland rxvt_unicode dmenu ];
|
||||||
'';
|
'';
|
||||||
example = literalExample ''
|
example = literalExample ''
|
||||||
with pkgs; [
|
with pkgs; [
|
||||||
|
@ -42,7 +68,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
environment.systemPackages = [ swayPackage ] ++ cfg.extraPackages;
|
environment.systemPackages = [ swayJoined ] ++ cfg.extraPackages;
|
||||||
security.pam.services.swaylock = {};
|
security.pam.services.swaylock = {};
|
||||||
hardware.opengl.enable = mkDefault true;
|
hardware.opengl.enable = mkDefault true;
|
||||||
fonts.enableDefaultFonts = mkDefault true;
|
fonts.enableDefaultFonts = mkDefault true;
|
||||||
|
@ -51,4 +77,3 @@ in {
|
||||||
|
|
||||||
meta.maintainers = with lib.maintainers; [ gnidorah primeos colemickens ];
|
meta.maintainers = with lib.maintainers; [ gnidorah primeos colemickens ];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue