devenv.nix 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. { pkgs, lib, config, inputs, ... }:
  2. {
  3. # https://devenv.sh/packages/
  4. packages = with pkgs; [
  5. git
  6. postgresql_16
  7. # BE and Tauri stuff
  8. libsoup
  9. webkitgtk_4_0
  10. # FE and Node stuff
  11. nodejs_22
  12. nodePackages_latest.typescript-language-server
  13. nodePackages_latest.vls
  14. nodePackages_latest.prisma
  15. prisma-engines
  16. # CI
  17. act
  18. # Cargo
  19. cargo-edit
  20. ];
  21. # https://devenv.sh/basics/
  22. env = {
  23. APP_GREET = "Hoppscotch";
  24. # NOTE: Setting these `PRISMA_*` environment variable fixes
  25. # Error: Failed to fetch sha256 checksum at https://binaries.prisma.sh/all_commits/<hash>/linux-nixos/libquery_engine.so.node.gz.sha256 - 404 Not Found
  26. # See: https://github.com/prisma/prisma/discussions/3120
  27. PRISMA_QUERY_ENGINE_LIBRARY = "${pkgs.prisma-engines}/lib/libquery_engine.node";
  28. PRISMA_QUERY_ENGINE_BINARY = "${pkgs.prisma-engines}/bin/query-engine";
  29. PRISMA_SCHEMA_ENGINE_BINARY = "${pkgs.prisma-engines}/bin/schema-engine";
  30. };
  31. # https://devenv.sh/scripts/
  32. scripts = {
  33. hello.exec = "echo hello from $APP_GREET";
  34. e.exec = "emacs";
  35. };
  36. enterShell = ''
  37. git --version
  38. '';
  39. # https://devenv.sh/tests/
  40. enterTest = ''
  41. echo "Running tests"
  42. '';
  43. # https://devenv.sh/integrations/dotenv/
  44. dotenv.enable = true;
  45. # https://devenv.sh/languages/
  46. # https://devenv.sh/languages/
  47. languages = {
  48. typescript.enable = true;
  49. javascript = {
  50. enable = true;
  51. pnpm = {
  52. enable = true;
  53. };
  54. npm = {
  55. enable = true;
  56. };
  57. };
  58. rust = {
  59. enable = true;
  60. channel = "nightly";
  61. components = [
  62. "rustc"
  63. "cargo"
  64. "clippy"
  65. "rustfmt"
  66. "rust-analyzer"
  67. "llvm-tools-preview"
  68. "rust-src"
  69. "rustc-codegen-cranelift-preview"
  70. ];
  71. };
  72. };
  73. # https://devenv.sh/pre-commit-hooks/
  74. # pre-commit.hooks.shellcheck.enable = true;
  75. # https://devenv.sh/processes/
  76. # processes.ping.exec = "ping example.com";
  77. # See full reference at https://devenv.sh/reference/options/
  78. }