oh-my-posh: build-time nushell config generation
This commit is contained in:
parent
287cbbbf80
commit
812a12d014
2 changed files with 14 additions and 23 deletions
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, config, ... }:
|
||||
{ lib, pkgs, realPkgs, config, ... }:
|
||||
|
||||
{
|
||||
programs = {
|
||||
|
|
@ -10,25 +10,17 @@
|
|||
};
|
||||
};
|
||||
|
||||
_module.args.pkgs = lib.mkForce realPkgs;
|
||||
|
||||
nmt.script = let
|
||||
configFile = if pkgs.stdenv.isDarwin && !config.xdg.enable then
|
||||
"home-files/Library/Application Support/nushell/config.nu"
|
||||
else
|
||||
"home-files/.config/nushell/config.nu";
|
||||
|
||||
envFile = if pkgs.stdenv.isDarwin && !config.xdg.enable then
|
||||
"home-files/Library/Application Support/nushell/env.nu"
|
||||
else
|
||||
"home-files/.config/nushell/env.nu";
|
||||
in ''
|
||||
assertFileExists "${envFile}"
|
||||
assertFileRegex \
|
||||
"${envFile}" \
|
||||
'/bin/oh-my-posh init nu --config .*--print \| save --force /.*/home-files/\.cache/oh-my-posh/init\.nu'
|
||||
|
||||
assertFileExists "${configFile}"
|
||||
assertFileRegex \
|
||||
"${configFile}" \
|
||||
'source /.*/\.cache/oh-my-posh/init\.nu'
|
||||
'source /nix/store/[^/]*-oh-my-posh-nushell-config'
|
||||
'';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue