Import full awesome env into root env

This commit is contained in:
mediocregopher 2024-01-06 12:27:30 +01:00
parent a0e3c9325b
commit 654914d8ee
5 changed files with 40 additions and 60 deletions

View File

@ -1,3 +0,0 @@
file:///tmp
file:///home/mediocregopher/Screenshots
file:///home/mediocregopher/Downloads

View File

@ -1,2 +0,0 @@
[Settings]
gtk-icon-theme-name = Tela

View File

@ -2,12 +2,10 @@
config,
}: rec {
pkgs = (import ../pkgs.nix).stable {};
pkgs2305 = (import ../pkgs.nix).stable2305 {};
pkgsEdge = (import ../pkgs.nix).edge {};
xorgInnerEnv = pkgs.buildEnv {
name = "xorg-inner-env";
@ -41,10 +39,9 @@ EOF
done
'';
startx = pkgs.writeShellScriptBin "startx" ''
startx = pkgs.writeShellScriptBin "startx-awesome" ''
# TODO pass .xinitrc into here, somehow
export XORGCONFIG=${xorgConf}
export PATH=${xorgInnerEnv}/bin:$PATH
exec startx
'';
@ -60,43 +57,6 @@ EOF
exec "$@"
'';
browser = pkgs.writeScriptBin "browser" ''
#!${pkgs.bash}/bin/bash
exec ${nativeWrap}/bin/native-wrap ${config.browser} "$@"
'';
env = pkgs.buildEnv {
name = "awesome-env";
paths = [
pkgs.awesome
pkgs.tela-icon-theme
nativeWrap
browser
pkgs.pavucontrol
pkgs.xdg-utils
pkgs.arandr
pkgs.i3lock
pkgs.scrot
pkgs.feh
pkgs.brightnessctl
pkgs.cbatticon
pkgs.phwmon
pkgs2305.libreoffice
pkgs.gimp
pkgs.inkscape
pkgs.vlc
pkgs.sylpheed
pkgs.calibre
pkgsEdge.lagrange
];
};
wp = ../wallpapers;
dirsLua = pkgs.writeTextDir "dirs.lua" ''
@ -111,19 +71,10 @@ EOF
set -e -x
export BROWSER=${browser}/bin/browser
# Turn off powersaving (fuck the environment)
xset -dpms
xset s off
export PATH=${env}/bin:$PATH
export XDG_CONFIG_DIRS=${./config}
export XDG_DATA_DIRS=${env}/share
export XDG_DATA_DIRS=$XDG_DATA_DIRS:/home/mediocregopher/.nix-profile/share
${config.awesome.startupExtra}
# HACK: This sleep is here because phwmon actually creates a separate tray
@ -150,11 +101,35 @@ EOF
echo "New awesome session starting" > $this_log
exec awesome \
exec ${pkgs.awesome}/bin/awesome \
-c ${./rc.lua} \
--search ${dirsLua} \
--search ${./share} \
--search ${env}/share/awesome/themes \
--search ${pkgs.awesome}/share/awesome/themes \
2>&1 2>>$this_log
'';
env = pkgs.buildEnv {
name = "awesome-env";
paths = [
pkgs.tela-icon-theme
# We only include utilities in here which are directly used by awesome.
# General purpose applications go in the root default.nix env.
pkgs.pavucontrol
pkgs.xdg-utils
pkgs.arandr
pkgs.i3lock
pkgs.scrot
pkgs.feh
pkgs.brightnessctl
pkgs.cbatticon
pkgs.phwmon
xorgInnerEnv
nativeWrap
awesome
startx
];
};
}

View File

@ -4,6 +4,7 @@
pkgs ? (import ./pkgs.nix).stable {},
pkgs2305 ? (import ./pkgs.nix).stable2305 {},
pkgsEdge ? (import ./pkgs.nix).edge {},
}: let
@ -48,7 +49,7 @@ in rec {
);
};
zsh = ((import ./zsh) {}).zsh;
zsh = ((import ./zsh) { inherit config; }).zsh;
awesome = ((import ./awesome) { inherit config; });
loadout = pkgs.buildEnv {
@ -106,13 +107,19 @@ in rec {
pkgs.udiskie
pkgs.xterm # nice to have a backup
pkgs2305.libreoffice
pkgs.gimp
pkgs.inkscape
pkgs.vlc
pkgs.sylpheed
pkgs.calibre
pkgsEdge.lagrange
bin
((import ./nvim) {}).nvim
zsh
((import ./alacritty) { inherit config zsh; }).alacritty
awesome.awesome
awesome.startx
awesome.env
];
};

View File

@ -1,6 +1,7 @@
{
pkgs ? (import ../pkgs.nix).stable {},
config,
}: rec {
@ -17,6 +18,8 @@
plugins=(git vi-mode)
source $ZSH/oh-my-zsh.sh
export BROWSER=${config.browser}/bin/browser
. ${./zshrc}
. ${./aliases}
'';