devenv.nix 2.2 KB

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