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:
parent
7f78e2d1c6
commit
e71e678d18
6 changed files with 116 additions and 0 deletions
1
tests/modules/programs/nix-your-shell/default.nix
Normal file
1
tests/modules/programs/nix-your-shell/default.nix
Normal file
|
|
@ -0,0 +1 @@
|
|||
{ nix-your-shell-enable-shells = ./enable-shells.nix; }
|
||||
48
tests/modules/programs/nix-your-shell/enable-shells.nix
Normal file
48
tests/modules/programs/nix-your-shell/enable-shells.nix
Normal 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'
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue