main @ 32 LINES
[ HISTORY ] [ UP ]
┌─ NIX ──────────────────────────────────────────────────────────────────────┐
│ { │
│ self, │
│ pkgs, │
│ ... │
│ }: let │
│ # get devshell names from flake │
│ devShellNames = builtins.concatStringsSep " " (builtins.attrNames self.devShells │
│ .${pkgs.stdenv.hostPlatform.system}); │
│ in { │
│ programs.fish = { │
│ # add devshells completions to init script │
│ interactiveShellInit = '' │
│ complete -c develop -f -a "${devShellNames}" │
│ ''; │
│ functions.develop = { │
│ description = "Easily jump into any of the ooknet devshells"; │
│ body = │
│ #fish │
│ '' │
│ if test -n "$argv[1]" │
│ if test -n "$FLAKE" │
│ nix develop $FLAKE#$argv[1] │
│ else │
│ echo "error: FLAKE variable is not set"; │
│ end │
│ else │
│ echo "error: No argument was provided"; │
│ end │
│ ''; │
│ }; │
│ }; │
│ } │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ NIX ────────────────────────────────┐
│ { │
│ self, │
│ pkgs, │
│ ... │
│ }: let │
│ # get devshell names from flake │
│ devShellNames = builtins.concatStringsSep │
│ " " (builtins.attrNames self.devShells.${pkg │
│ s.stdenv.hostPlatform.system}); │
│ in { │
│ programs.fish = { │
│ # add devshells completions to init scri │
│ pt │
│ interactiveShellInit = '' │
│ complete -c develop -f -a "${devShellN │
│ ames}" │
│ ''; │
│ functions.develop = { │
│ description = "Easily jump into any of │
│ the ooknet devshells"; │
│ body = │
│ #fish │
│ '' │
│ if test -n "$argv[1]" │
│ if test -n "$FLAKE" │
│ nix develop $FLAKE#$argv[1] │
│ else │
│ echo "error: FLAKE variable is │
│ not set"; │
│ end │
│ else │
│ echo "error: No argument was pro │
│ vided"; │
│ end │
│ ''; │
│ }; │
│ }; │
│ } │
└──────────────────────────────────────────────┘
──────────────────────────────────────────────────────────────────────────────────────
OOKNET
────────────────────────────────────────────────
OOKNET