1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-13 04:21:08 +01:00

nix-your-shell: add module

This commit is contained in:
Terje Larsen 2024-07-18 14:15:10 +02:00 committed by Robert Helgesson
parent 7f78e2d1c6
commit e71e678d18
No known key found for this signature in database
GPG key ID: 96E745BD17AA17ED
6 changed files with 116 additions and 0 deletions

View file

@ -0,0 +1 @@
{ nix-your-shell-enable-shells = ./enable-shells.nix; }

View file

@ -0,0 +1,48 @@
{ pkgs, config, ... }:
{
programs = {
nix-your-shell = {
enable = true;
enableFishIntegration = true;
enableNushellIntegration = true;
enableZshIntegration = true;
};
fish.enable = true;
nushell.enable = true;
zsh.enable = true;
};
test.stubs = {
nix-your-shell = { };
nushell = { };
zsh = { };
};
nmt.script = let
nushellConfigDir = if pkgs.stdenv.isDarwin && !config.xdg.enable then
"home-files/Library/Application Support/nushell"
else
"home-files/.config/nushell";
in ''
assertFileExists home-files/.config/fish/config.fish
assertFileContains \
home-files/.config/fish/config.fish \
'@nix-your-shell@/bin/nix-your-shell fish | source'
assertFileExists ${nushellConfigDir}/config.nu
assertFileContains \
${nushellConfigDir}/config.nu \
'source ${config.xdg.cacheHome}/nix-your-shell/init.nu'
assertFileExists ${nushellConfigDir}/env.nu
assertFileContains \
${nushellConfigDir}/env.nu \
'@nix-your-shell@/bin/nix-your-shell nu | save --force ${config.xdg.cacheHome}/nix-your-shell/init.nu'
assertFileExists home-files/.zshrc
assertFileContains \
home-files/.zshrc \
'@nix-your-shell@/bin/nix-your-shell zsh | source /dev/stdin'
'';
}