diff options
author | mediocregopher <mediocregopher@gmail.com> | 2023-12-16 18:28:36 +0100 |
---|---|---|
committer | mediocregopher <mediocregopher@gmail.com> | 2023-12-16 18:28:36 +0100 |
commit | 64eb89235d395f711e8e3a5d8e4232d4a57d0900 (patch) | |
tree | c4617062db245988838a1ef06abe3890ce7f514c /x | |
parent | 878dea2de4c8f4289a9b1d08437f23d2a29021ea (diff) |
Include xorg as part of loadout, so it's not required on host system
Diffstat (limited to 'x')
-rw-r--r-- | x/default.nix | 41 | ||||
-rw-r--r-- | x/xorg.conf | 6 |
2 files changed, 47 insertions, 0 deletions
diff --git a/x/default.nix b/x/default.nix new file mode 100644 index 0000000..1807368 --- /dev/null +++ b/x/default.nix @@ -0,0 +1,41 @@ +{ + 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.xf86inputevdev + 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 +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 + ''; +} diff --git a/x/xorg.conf b/x/xorg.conf new file mode 100644 index 0000000..04f72e6 --- /dev/null +++ b/x/xorg.conf @@ -0,0 +1,6 @@ +Section "InputClass" + Identifier "system-keyboard" + MatchIsKeyboard "on" + Option "XkbLayout" "us" + Option "XkbOptions" "caps:swapescape" +EndSection |