Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into HEAD
- Loading branch information
Showing
294 changed files
with
3,050 additions
and
2,091 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,68 @@ | ||
{ config, pkgs, lib, ... }: | ||
|
||
with lib; | ||
|
||
let | ||
cfg = config.programs.sway; | ||
sway = pkgs.sway; | ||
|
||
swayWrapped = pkgs.writeScriptBin "sway" '' | ||
#! ${pkgs.stdenv.shell} | ||
${cfg.extraSessionCommands} | ||
PATH="${sway}/bin:$PATH" | ||
exec ${pkgs.dbus.dbus-launch} --exit-with-session "${sway}/bin/sway" | ||
''; | ||
swayJoined = pkgs.symlinkJoin { | ||
name = "sway-wrapped"; | ||
paths = [ swayWrapped sway ]; | ||
}; | ||
in | ||
{ | ||
options.programs.sway.enable = mkEnableOption "sway"; | ||
options.programs.sway = { | ||
enable = mkEnableOption "sway"; | ||
|
||
extraSessionCommands = mkOption { | ||
default = ""; | ||
type = types.lines; | ||
example = '' | ||
export XKB_DEFAULT_LAYOUT=us,de | ||
export XKB_DEFAULT_VARIANT=,nodeadkeys | ||
export XKB_DEFAULT_OPTIONS=grp:alt_shift_toggle, | ||
''; | ||
description = '' | ||
Shell commands executed just before sway is started. | ||
''; | ||
}; | ||
|
||
config = mkIf config.programs.sway.enable { | ||
environment.systemPackages = [ pkgs.sway pkgs.xwayland ]; | ||
extraPackages = mkOption { | ||
type = with types; listOf package; | ||
default = with pkgs; [ | ||
i3status xwayland rxvt_unicode dmenu | ||
]; | ||
example = literalExample '' | ||
with pkgs; [ | ||
i3status xwayland rxvt_unicode dmenu | ||
] | ||
''; | ||
description = '' | ||
Extra packages to be installed system wide. | ||
''; | ||
}; | ||
}; | ||
|
||
config = mkIf cfg.enable { | ||
environment.systemPackages = [ swayJoined ] ++ cfg.extraPackages; | ||
security.wrappers.sway = { | ||
source = "${pkgs.sway}/bin/sway"; | ||
source = "${swayJoined}/bin/sway"; | ||
capabilities = "cap_sys_ptrace,cap_sys_tty_config=eip"; | ||
owner = "root"; | ||
group = "sway"; | ||
permissions = "u+rx,g+rx"; | ||
}; | ||
|
||
users.extraGroups.sway = {}; | ||
|
||
hardware.opengl.enable = mkDefault true; | ||
fonts.enableDefaultFonts = mkDefault true; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.