From 64eb89235d395f711e8e3a5d8e4232d4a57d0900 Mon Sep 17 00:00:00 2001 From: mediocregopher Date: Sat, 16 Dec 2023 18:28:36 +0100 Subject: Include xorg as part of loadout, so it's not required on host system --- awesome/default.nix | 5 +++-- base/00-keyboard.conf | 6 ------ default.nix | 1 + x/default.nix | 41 +++++++++++++++++++++++++++++++++++++++++ x/xorg.conf | 6 ++++++ 5 files changed, 51 insertions(+), 8 deletions(-) delete mode 100644 base/00-keyboard.conf create mode 100644 x/default.nix create mode 100644 x/xorg.conf diff --git a/awesome/default.nix b/awesome/default.nix index 423c98d..6fbf524 100644 --- a/awesome/default.nix +++ b/awesome/default.nix @@ -50,7 +50,6 @@ pkgs.cbatticon pkgs.phwmon - pkgs.castor pkgs2305.libreoffice pkgs.gimp pkgs.inkscape @@ -74,6 +73,8 @@ awesome = pkgs.writeScriptBin "awesome" '' #!${pkgs.bash}/bin/bash + set -e -x + export BROWSER=${browser}/bin/browser # Turn off powersaving (fuck the environment) @@ -98,7 +99,7 @@ # Init awesome data_dir="$HOME/.local/share/awesome"; - mkdir -p "$dataDir" + mkdir -p "$data_dir" log_dir="$data_dir"/logs mkdir -p $log_dir diff --git a/base/00-keyboard.conf b/base/00-keyboard.conf deleted file mode 100644 index 04f72e6..0000000 --- a/base/00-keyboard.conf +++ /dev/null @@ -1,6 +0,0 @@ -Section "InputClass" - Identifier "system-keyboard" - MatchIsKeyboard "on" - Option "XkbLayout" "us" - Option "XkbOptions" "caps:swapescape" -EndSection diff --git a/default.nix b/default.nix index 2d8d951..e78f4c5 100644 --- a/default.nix +++ b/default.nix @@ -91,6 +91,7 @@ in rec { zsh ((import ./alacritty) { inherit config zsh; }).alacritty ((import ./awesome) { inherit config; }).awesome + ((import ./x) { inherit config; }).startx ]; }; 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" <> "$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 -- cgit v1.2.3