st derivation and startx in hm

This commit is contained in:
Sam 2024-06-13 17:31:49 +01:00
parent 108f9b7028
commit 326d8fbae7
6 changed files with 81 additions and 21 deletions

View File

@ -12,6 +12,7 @@
# Global packages for desktop environments
home.packages = [
pkgs.alacritty
pkgs.st
pkgs.libnotify
pkgs.zathura
pkgs.xfce.thunar

View File

@ -0,0 +1,27 @@
{
imports = [
../common
];
# TODO configure x11 to look in .config/x11
#home.file."${config.xdg.configHome}/x11/xinitrc" = {
home.file.".xinitrc" = {
recursive = true;
text = ''
if test -z "$DBUS_SESSION_BUS_ADDRESS"; then
eval $(dbus-launch --exit-with-session --sh-syntax)
fi
systemctl --user import-environment DISPLAY XAUTHORITY
if command -v dbus-update-activation-environment >/dev/null 2>&1; then
dbus-update-activation-environment DISPLAY XAUTHORITY
fi
export XSESSION_PID="$$"
exec dwm
'';
};
}

View File

@ -11,6 +11,7 @@
./common/optional/git.nix
./common/optional/sops.nix
./common/optional/syncthing.nix
./common/optional/desktop/startx
];

View File

@ -54,27 +54,6 @@
qt.style.name = "adwaita-dark";
qt.style.package = pkgs.adwaita-qt;
# TODO configure x11 to look in .config/x11
#home.file."${config.xdg.configHome}/x11/xinitrc" = {
home.file.".xinitrc" = {
recursive = true;
text = ''
if test -z "$DBUS_SESSION_BUS_ADDRESS"; then
eval $(dbus-launch --exit-with-session --sh-syntax)
fi
systemctl --user import-environment DISPLAY XAUTHORITY
if command -v dbus-update-activation-environment >/dev/null 2>&1; then
dbus-update-activation-environment DISPLAY XAUTHORITY
fi
export XSESSION_PID="$$"
exec dwm
'';
};
home.sessionVariables = {
EDITOR = "nvim";
TERMINAL = "alacritty";

View File

@ -2,4 +2,5 @@
# You can build them using 'nix build .#example'
pkgs: {
sddm-theme = pkgs.callPackage ./sddm-theme { };
st = pkgs.callPackage ./st { };
}

51
pkgs/st/default.nix Normal file
View File

@ -0,0 +1,51 @@
{ pkgs ? import <nixpkgs> { }
, fetchFromGitea ? pkgs.fetchFromGitea
, stdenv ? pkgs.stdenv
, pkg-config ? pkgs.pkg-config
, fontconfig ? pkgs.fontconfig
, freetype ? pkgs.freetype
, libX11 ? pkgs.xorg.libX11
, libXft ? pkgs.xorg.libXft
, ncurses ? pkgs.ncurses
, extraLibs ? [ ]
}:
pkgs.stdenv.mkDerivation {
pname = "st";
name = "st";
src = fetchFromGitea {
domain = "git.bitlab21.com";
owner = "sam";
repo = "st";
rev = "1cde288ca34ad05984a0251a7879005128be085c";
sha256 = "sha256-4W9w/Efk+YCSP1VuUFr+jPXIyrlpktwxRPUOZHTAtx8=";
};
makeFlags = [
"PKG_CONFIG=${stdenv.cc.targetPrefix}pkg-config"
];
nativeBuildInputs = [
pkg-config
ncurses
fontconfig
freetype
];
buildInputs = [
libX11
libXft
] ++ extraLibs;
installFlags = [ "PREFIX=$(out)" ];
buildPhase = ''
make
'';
installPhase = ''
mkdir -p $out/usr/local/bin
mv st $out/usr/local/bin
'';
}