Skip to content

Commit d62b7ab

Browse files
committed
refactor: use a constant for the devshell menu command name
1 parent 06bef75 commit d62b7ab

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

modules/devshell.nix

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ let
1010

1111
# Because we want to be able to push pure JSON-like data into the
1212
# environment.
13-
strOrPackage = import ../nix/strOrPackage.nix { inherit lib pkgs; };
13+
strOrPackage = import ../nix/strOrPackage.nix { inherit pkgs; };
14+
15+
inherit (import ../nix/commands/lib.nix { inherit pkgs; }) devshellMenuCommandName;
1416

1517
# Use this to define a flake app for the environment.
1618
mkFlakeApp = bin: {
@@ -255,7 +257,7 @@ in
255257
type = types.str;
256258
default = ''
257259
{202}🔨 Welcome to ${cfg.name}{reset}
258-
$(type -p menu &>/dev/null && menu)
260+
$(type -p ${devshellMenuCommandName} &>/dev/null && ${devshellMenuCommandName})
259261
'';
260262
apply = replaceStrings
261263
(map (key: "{${key}}") (attrNames ansi))

tests/core/commands.nix

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{ pkgs, devshell, runTest }:
2-
{
2+
rec {
3+
inherit (import ../../nix/commands/lib.nix { inherit pkgs; }) devshellMenuCommandName;
4+
35
# Basic devshell usage
46
commands-1 =
57
let
@@ -33,7 +35,7 @@
3335
# Load the devshell
3436
source ${shell}/env.bash
3537
36-
menu
38+
${devshellMenuCommandName}
3739
3840
# Checks that all the commands are available
3941
type -p bash-script

0 commit comments

Comments
 (0)