From 005334a0371227be6e35e7afd85ab64475ddcf77 Mon Sep 17 00:00:00 2001 From: mediocregopher Date: Wed, 27 Dec 2023 18:37:54 +0100 Subject: Merge X subdir into awesome --- awesome/default.nix | 42 +++++++++++++++++++++++++++++++++++++++--- awesome/xorg.conf | 6 ++++++ default.nix | 5 +++-- x/default.nix | 43 ------------------------------------------- x/xorg.conf | 6 ------ 5 files changed, 48 insertions(+), 54 deletions(-) create mode 100644 awesome/xorg.conf delete mode 100644 x/default.nix delete mode 100644 x/xorg.conf diff --git a/awesome/default.nix b/awesome/default.nix index 6fbf524..3fedb87 100644 --- a/awesome/default.nix +++ b/awesome/default.nix @@ -9,6 +9,45 @@ pkgs2305 = (import ../pkgs.nix).stable2305 {}; 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" <> "$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 # nicely with it. nativeWrap = pkgs.writeScriptBin "native-wrap" '' @@ -29,15 +68,12 @@ env = pkgs.buildEnv { name = "awesome-env"; paths = [ - pkgs.awesome pkgs.tela-icon-theme nativeWrap browser - pkgs.xorg.xrandr - pkgs.xsel pkgs.pavucontrol pkgs.xdg-utils pkgs.arandr diff --git a/awesome/xorg.conf b/awesome/xorg.conf new file mode 100644 index 0000000..04f72e6 --- /dev/null +++ b/awesome/xorg.conf @@ -0,0 +1,6 @@ +Section "InputClass" + Identifier "system-keyboard" + MatchIsKeyboard "on" + Option "XkbLayout" "us" + Option "XkbOptions" "caps:swapescape" +EndSection diff --git a/default.nix b/default.nix index ee5e159..2d85f10 100644 --- a/default.nix +++ b/default.nix @@ -37,6 +37,7 @@ in rec { ''; zsh = ((import ./zsh) { inherit config; }).zsh; + awesome = ((import ./awesome) { inherit config; }); loadout = pkgs.buildEnv { name = "loadout"; @@ -96,8 +97,8 @@ in rec { ((import ./nvim) {}).nvim zsh ((import ./alacritty) { inherit config zsh; }).alacritty - ((import ./awesome) { inherit config; }).awesome - ((import ./x) { inherit config; }).startx + awesome.awesome + awesome.startx ]; }; diff --git a/x/default.nix b/x/default.nix deleted file mode 100644 index a060701..0000000 --- a/x/default.nix +++ /dev/null @@ -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" <> "$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 deleted file mode 100644 index 04f72e6..0000000 --- a/x/xorg.conf +++ /dev/null @@ -1,6 +0,0 @@ -Section "InputClass" - Identifier "system-keyboard" - MatchIsKeyboard "on" - Option "XkbLayout" "us" - Option "XkbOptions" "caps:swapescape" -EndSection -- cgit v1.2.3