2024-07-30 05:26:58 +00:00
|
|
|
# All of the programs with my outside dotfiles from
|
|
|
|
# https://github.com/foo-dogsquared/dotfiles. Pretty nifty for me to have,
|
|
|
|
# yeah? This should work on both NixOS and non-NixOS system considering that
|
2024-08-24 06:01:58 +00:00
|
|
|
# parts from the config are conditionally setting up NixGL wrapping. Though,
|
|
|
|
# you have to use NixOS systems in order to actually use it. We probably should
|
|
|
|
# have a specialized launcher for this.
|
2024-07-30 05:26:58 +00:00
|
|
|
let
|
|
|
|
sources = import ./npins;
|
|
|
|
in
|
|
|
|
{ lib, pkgs, wrapperManagerLib, ... }@moduleArgs:
|
|
|
|
|
|
|
|
let
|
|
|
|
inherit (sources) dotfiles nixgl;
|
|
|
|
|
|
|
|
getDotfiles = path: "${dotfiles}/${path}";
|
|
|
|
isInNonNixOS = !(moduleArgs ? nixosConfig);
|
|
|
|
|
|
|
|
wrapNixGL = arg0:
|
|
|
|
if isInNonNixOS then {
|
|
|
|
nixgl.enable = true;
|
2024-08-01 09:27:01 +00:00
|
|
|
nixgl.wraparound.arg0 = arg0;
|
2024-07-30 05:26:58 +00:00
|
|
|
} else {
|
|
|
|
inherit arg0;
|
|
|
|
};
|
|
|
|
in
|
|
|
|
{
|
2024-08-24 06:01:58 +00:00
|
|
|
# This wrapper needs runtime expansion which is not possible with binary
|
|
|
|
# wrappers.
|
2024-10-02 05:07:49 +00:00
|
|
|
build.variant = "shell";
|
2024-08-24 06:01:58 +00:00
|
|
|
|
2024-07-30 05:26:58 +00:00
|
|
|
nixgl.src = nixgl;
|
|
|
|
|
|
|
|
wrappers.wezterm = lib.mkMerge [
|
|
|
|
{
|
|
|
|
env.WEZTERM_CONFIG_FILE.value = getDotfiles "wezterm/wezterm.lua";
|
|
|
|
}
|
|
|
|
|
|
|
|
(wrapNixGL (lib.getExe' pkgs.wezterm "wezterm"))
|
|
|
|
];
|
|
|
|
|
|
|
|
wrappers.kitty = lib.mkMerge [
|
|
|
|
{
|
|
|
|
env.KITTY_CONFIG_DIRECTORY.value = getDotfiles "kitty";
|
|
|
|
}
|
|
|
|
|
|
|
|
(wrapNixGL (lib.getExe' pkgs.kitty "kitty"))
|
|
|
|
];
|
|
|
|
|
|
|
|
wrappers.nvim = {
|
|
|
|
env.VIM.value = getDotfiles "nvim";
|
|
|
|
arg0 = lib.getExe' pkgs.neovim "nvim";
|
|
|
|
};
|
|
|
|
|
|
|
|
# Trying to create a portable Doom Emacs.
|
|
|
|
wrappers.emacs = lib.mkMerge [
|
|
|
|
{
|
2024-08-24 06:01:58 +00:00
|
|
|
env.EMACSDIR.value = builtins.toString sources.doom-emacs;
|
2024-07-30 05:26:58 +00:00
|
|
|
env.DOOMDIR.value = getDotfiles "emacs";
|
2024-08-24 06:01:58 +00:00
|
|
|
env.DOOMPROFILELOADFILE.value = lib.escapeShellArg "$XDG_CACHE_HOME/doom/profiles.el";
|
2024-07-30 05:26:58 +00:00
|
|
|
|
|
|
|
# TODO: This will be removed in Doom Emacs 3.0 as far as I can tell so we'll
|
|
|
|
# remove it once that happens.
|
2024-08-24 06:01:58 +00:00
|
|
|
env.DOOMLOCALDIR.value = lib.escapeShellArg "$XDG_CONFIG_HOME/emacs/";
|
2024-07-30 05:26:58 +00:00
|
|
|
|
|
|
|
pathAdd = wrapperManagerLib.getBin [
|
|
|
|
sources.doom-emacs
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
(wrapNixGL (lib.getExe' pkgs.emacs "emacs"))
|
|
|
|
];
|
|
|
|
|
|
|
|
build.extraSetup = ''
|
|
|
|
install -Dm0755 ${getDotfiles "bin"}/* -t $out/bin
|
|
|
|
'';
|
|
|
|
}
|