Merge X subdir into awesome

This commit is contained in:
mediocregopher 2023-12-27 18:37:54 +01:00
parent d09d899d29
commit 005334a037
4 changed files with 42 additions and 48 deletions

View File

@ -9,6 +9,45 @@
pkgs2305 = (import ../pkgs.nix).stable2305 {}; pkgs2305 = (import ../pkgs.nix).stable2305 {};
pkgsEdge = (import ../pkgs.nix).edge {}; pkgsEdge = (import ../pkgs.nix).edge {};
xorgInnerEnv = pkgs.buildEnv {
name = "xorg-inner-env";
paths = [
pkgs.xorg.xorgserver
pkgs.xorg.xinit
pkgs.xorg.xauth
pkgs.xorg.xset
pkgs.xorg.xf86inputlibinput
pkgs.xorg.xrandr
pkgs.xsel
(pkgs.runCommand "xorg-conf-inner" {} ''
mkdir -p "$out"/share/X11/xorg.conf.d/
cp ${./xorg.conf} "$out"/share/X11/xorg.conf.d/99-loadout.conf
'')
];
};
xorgConf = pkgs.runCommand "xorg-conf" {} ''
cat >>"$out" <<EOF
Section "Files"
ModulePath "${xorgInnerEnv}/lib/xorg/modules"
EndSection
${config.xorgConfExtra}
EOF
for f in $(ls ${xorgInnerEnv}/share/X11/xorg.conf.d | sort); do
cat ${xorgInnerEnv}/share/X11/xorg.conf.d/"$f" >> "$out"
done
'';
startx = pkgs.writeShellScriptBin "startx" ''
# TODO pass .xinitrc into here, somehow
export XORGCONFIG=${xorgConf}
export PATH=${xorgInnerEnv}/bin:$PATH
exec startx
'';
# nativeWrap is used for apps which are not installed via nix which don't play # nativeWrap is used for apps which are not installed via nix which don't play
# nicely with it. # nicely with it.
nativeWrap = pkgs.writeScriptBin "native-wrap" '' nativeWrap = pkgs.writeScriptBin "native-wrap" ''
@ -29,15 +68,12 @@
env = pkgs.buildEnv { env = pkgs.buildEnv {
name = "awesome-env"; name = "awesome-env";
paths = [ paths = [
pkgs.awesome pkgs.awesome
pkgs.tela-icon-theme pkgs.tela-icon-theme
nativeWrap nativeWrap
browser browser
pkgs.xorg.xrandr
pkgs.xsel
pkgs.pavucontrol pkgs.pavucontrol
pkgs.xdg-utils pkgs.xdg-utils
pkgs.arandr pkgs.arandr

View File

@ -37,6 +37,7 @@ in rec {
''; '';
zsh = ((import ./zsh) { inherit config; }).zsh; zsh = ((import ./zsh) { inherit config; }).zsh;
awesome = ((import ./awesome) { inherit config; });
loadout = pkgs.buildEnv { loadout = pkgs.buildEnv {
name = "loadout"; name = "loadout";
@ -96,8 +97,8 @@ in rec {
((import ./nvim) {}).nvim ((import ./nvim) {}).nvim
zsh zsh
((import ./alacritty) { inherit config zsh; }).alacritty ((import ./alacritty) { inherit config zsh; }).alacritty
((import ./awesome) { inherit config; }).awesome awesome.awesome
((import ./x) { inherit config; }).startx awesome.startx
]; ];
}; };

View File

@ -1,43 +0,0 @@
{
config,
}: rec {
pkgs = (import ../pkgs.nix).stable {};
innerEnv = pkgs.buildEnv {
name = "x-inner-env";
paths = [
pkgs.xorg.xorgserver
pkgs.xorg.xinit
pkgs.xorg.xauth
pkgs.xorg.xset
pkgs.xorg.xf86inputlibinput
(pkgs.runCommand "xorg-conf-inner" {} ''
mkdir -p "$out"/share/X11/xorg.conf.d/
cp ${./xorg.conf} "$out"/share/X11/xorg.conf.d/99-loadout.conf
'')
];
};
conf = pkgs.runCommand "xorg-conf" {} ''
cat >>"$out" <<EOF
Section "Files"
ModulePath "${innerEnv}/lib/xorg/modules"
EndSection
${config.xorgConfExtra}
EOF
for f in $(ls ${innerEnv}/share/X11/xorg.conf.d | sort); do
cat ${innerEnv}/share/X11/xorg.conf.d/"$f" >> "$out"
done
'';
startx = pkgs.writeShellScriptBin "startx" ''
export XORGCONFIG=${conf}
export PATH=${innerEnv}/bin:$PATH
exec startx
'';
}