My Nix Configuration

[home.programs] Move most programs to misc-programs module

Changed files
+83 -121
homes
modules
home
programs
-6
homes/x86_64-linux/pyrox/programs/bat.nix
···
-
{
-
programs.bat = {
-
enable = true;
-
catppuccin.enable = true;
-
};
-
}
···
-34
homes/x86_64-linux/pyrox/programs/direnv.nix
···
-
{
-
programs.direnv = {
-
enable = true;
-
enableBashIntegration = true;
-
enableNushellIntegration = true;
-
enableZshIntegration = true;
-
nix-direnv.enable = true;
-
stdlib = ''
-
layout_poetry() {
-
PYPROJECT_TOML="\$\{PYPROJECT_TOML:-pyproject.toml}"
-
if [[ ! -f "$PYPROJECT_TOML" ]]; then
-
log_status "No pyproject.toml found. Executing \`poetry init\` to create a \`$PYPROJECT_TOML\` first."
-
poetry init
-
fi
-
-
if [[ -d ".venv" ]]; then
-
VIRTUAL_ENV="$(pwd)/.venv"
-
else
-
VIRTUAL_ENV=$(poetry env info --path 2>/dev/null ; true)
-
fi
-
-
if [[ -z $VIRTUAL_ENV || ! -d $VIRTUAL_ENV ]]; then
-
log_status "No virtual environment exists. Executing \`poetry install\` to create one."
-
poetry install
-
VIRTUAL_ENV=$(poetry env info --path)
-
fi
-
-
PATH_add "$VIRTUAL_ENV/bin"
-
export POETRY_ACTIVE=1
-
export VIRTUAL_ENV
-
}
-
'';
-
};
-
}
···
-8
homes/x86_64-linux/pyrox/programs/fzf.nix
···
-
{
-
programs.fzf = {
-
enable = true;
-
enableBashIntegration = true;
-
enableZshIntegration = true;
-
catppuccin.enable = true;
-
};
-
}
···
-9
homes/x86_64-linux/pyrox/programs/navi.nix
···
-
{
-
programs.navi = {
-
enable = true;
-
enableBashIntegration = true;
-
enableFishIntegration = true;
-
enableZshIntegration = true;
-
settings = {finder = {command = "fzf";};};
-
};
-
}
···
-12
homes/x86_64-linux/pyrox/programs/ncmpcpp.nix
···
-
{
-
programs.ncmpcpp = {
-
enable = true;
-
settings = {
-
visualizer_data_source = "/tmp/mpd.fifo";
-
visualizer_output_name = "viz";
-
visualizer_in_stereo = "yes";
-
visualizer_type = "ellipse";
-
visualizer_look = "+.";
-
};
-
};
-
}
···
-8
homes/x86_64-linux/pyrox/programs/nix-index.nix
···
-
{
-
programs.nix-index = {
-
enable = true;
-
enableBashIntegration = true;
-
enableFishIntegration = true;
-
enableZshIntegration = true;
-
};
-
}
···
-1
homes/x86_64-linux/pyrox/programs/pandoc.nix
···
-
{programs.pandoc.enable = true;}
···
-11
homes/x86_64-linux/pyrox/programs/senpai.nix
···
-
{
-
programs.senpai = {
-
enable = true;
-
config = {
-
addr = "chat.sr.ht";
-
nick = "thehedgeh0g";
-
password-cmd = "bw get password 'Bouncer API Token'";
-
# pane-widths
-
};
-
};
-
}
···
-8
homes/x86_64-linux/pyrox/programs/skim.nix
···
-
{
-
programs.skim = {
-
enable = true;
-
enableBashIntegration = true;
-
enableZshIntegration = true;
-
enableFishIntegration = true;
-
};
-
}
···
-8
homes/x86_64-linux/pyrox/programs/zoxide.nix
···
-
{
-
programs.zoxide = {
-
enable = true;
-
enableBashIntegration = true;
-
enableFishIntegration = true;
-
enableZshIntegration = true;
-
};
-
}
···
-16
homes/x86_64-linux/pyrox/programs/zsh.nix
···
-
{
-
programs.zsh = {
-
enable = true;
-
autosuggestion.enable = true;
-
enableCompletion = true;
-
enableVteIntegration = true;
-
syntaxHighlighting = {enable = true;};
-
history = {
-
extended = true;
-
ignoreDups = false;
-
share = true;
-
save = 50000;
-
size = 10000;
-
};
-
};
-
}
···
+57
modules/home/programs/misc-programs/default.nix
···
···
+
{
+
config,
+
lib,
+
osConfig,
+
...
+
}:
+
let
+
cfg = config.py.programs;
+
osCfg = osConfig.py.programs;
+
osPro = osConfig.py.profiles;
+
inherit (lib) mkEnableOption mkIf;
+
in
+
{
+
options.py.programs = {
+
bat.enable = mkEnableOption "bat";
+
direnv.enable = mkEnableOption "direnv";
+
fzf.enable = mkEnableOption "fzf";
+
nix-index.enable = mkEnableOption "nix-index";
+
pandoc.enable = mkEnableOption "pandoc";
+
zoxide.enable = mkEnableOption "zoxide";
+
};
+
config = {
+
programs = {
+
bat = mkIf (cfg.bat.enable && osPro.cli.enable) {
+
enable = true;
+
catppuccin.enable = true;
+
};
+
direnv = mkIf (cfg.direnv.enable && osPro.cli.enable) {
+
enable = true;
+
enableBashIntegration = true;
+
enableNushellIntegration = true;
+
enableZshIntegration = true;
+
nix-direnv.enable = true;
+
stdlib = builtins.readFile ./direnv-stdlib.sh;
+
};
+
fzf = mkIf (cfg.fzf.enable && osPro.cli.enable) {
+
enable = true;
+
enableBashIntegration = true;
+
enableZshIntegration = true;
+
catppuccin.enable = true;
+
};
+
nix-index = mkIf (cfg.nix-index.enable && osPro.cli.enable) {
+
enable = true;
+
enableBashIntegration = true;
+
enableFishIntegration = true;
+
enableZshIntegration = true;
+
};
+
pandoc = mkIf (cfg.pandoc.enable && osPro.cli.enable) { enable = true; };
+
zoxide = mkIf (cfg.zoxide.enable && osPro.cli.enable) {
+
enable = true;
+
enableBashIntegration = true;
+
enableFishIntegration = true;
+
enableZshIntegration = true;
+
};
+
};
+
};
+
}
+26
modules/home/programs/misc-programs/direnv-stdlib.sh
···
···
+
layout_poetry() {
+
PYPROJECT_TOML="\$\{PYPROJECT_TOML:-pyproject.toml}"
+
if [[ ! -f "$PYPROJECT_TOML" ]]; then
+
log_status "No pyproject.toml found. Executing \`poetry init\` to create a \`$PYPROJECT_TOML\` first."
+
poetry init
+
fi
+
+
if [[ -d ".venv" ]]; then
+
VIRTUAL_ENV="$(pwd)/.venv"
+
else
+
VIRTUAL_ENV=$(
+
poetry env info --path 2>/dev/null
+
true
+
)
+
fi
+
+
if [[ -z $VIRTUAL_ENV || ! -d $VIRTUAL_ENV ]]; then
+
log_status "No virtual environment exists. Executing \`poetry install\` to create one."
+
poetry install
+
VIRTUAL_ENV=$(poetry env info --path)
+
fi
+
+
PATH_add "$VIRTUAL_ENV/bin"
+
export POETRY_ACTIVE=1
+
export VIRTUAL_ENV
+
}