devenv.nix

 1{ pkgs, lib, config, inputs, ... }:
 2
 3{
 4  # https://devenv.sh/basics/
 5  env.ENV = "development";
 6
 7  # https://devenv.sh/packages/
 8  packages = [
 9    pkgs.jujutsu
10    pkgs.gnumake
11    pkgs.go
12    pkgs.golangci-lint
13    pkgs.bash
14    pkgs.bashInteractive
15    pkgs.bash-completion
16  ];
17
18  # https://devenv.sh/languages/
19  # languages.rust.enable = true;
20
21  # https://devenv.sh/processes/
22  # processes.dev.exec = "${lib.getExe pkgs.watchexec} -n -- ls -la";
23
24  # https://devenv.sh/services/
25  # services.postgres.enable = true;
26
27
28  # https://devenv.sh/basics/
29  enterShell = ''
30    # Configure bash with fish-like features
31    bind 'set completion-ignore-case on'  # Case-insensitive completion
32    bind 'set show-all-if-ambiguous on'   # Show all completions on first tab
33    bind 'set menu-complete-display-prefix on'
34    bind 'TAB:menu-complete'              # Tab cycles through completions
35    bind '\e[A:history-search-backward'   # Up arrow searches history
36    bind '\e[B:history-search-forward'    # Down arrow searches history
37    bind 'set colored-completion-prefix on'  # Color the completion prefix
38    bind 'set colored-stats on'           # Color the completion stats
39
40    # Enable bash-completion if available
41    if [ -f ${pkgs.bash-completion}/etc/profile.d/bash_completion.sh ]; then
42      source ${pkgs.bash-completion}/etc/profile.d/bash_completion.sh
43    fi
44
45    # Better directory navigation
46    shopt -s autocd 2>/dev/null          # Type directory name to cd
47    shopt -s dirspell 2>/dev/null        # Correct spelling of dir names
48    shopt -s cdspell 2>/dev/null         # Correct spelling of cd args
49
50    # Enable ** globbing for recursive directory matching
51    shopt -s globstar 2>/dev/null
52  '';
53
54  # https://devenv.sh/tasks/
55  # tasks = {
56  #   "myproj:setup".exec = "mytool build";
57  #   "devenv:enterShell".after = [ "myproj:setup" ];
58  # };
59
60  # https://devenv.sh/tests/
61  enterTest = ''
62  '';
63
64  # https://devenv.sh/git-hooks/
65  # git-hooks.hooks.shellcheck.enable = true;
66
67  # See full reference at https://devenv.sh/reference/options/
68}