aboutsummaryrefslogtreecommitdiff
path: root/devenv.nix
blob: 213c98bbc72abbf452a7c6cf90b7e0af8c4f614f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{ pkgs, lib, config, inputs, ... }:

{
  # https://devenv.sh/basics/
  # https://devenv.sh/packages/
  packages = [ pkgs.git ];

  # https://devenv.sh/scripts/

  enterShell = ''
    git --version
    echo "devenv up : to execute the epq chat application"
  '';

  # https://devenv.sh/tests/
  enterTest = ''
    echo "Running tests"
    git --version | grep "2.42.0"
  '';

  # https://devenv.sh/services/
  # services.postgres.enable = true;

  # https://devenv.sh/languages/
  languages = {
    java = {
      enable = true;
      jdk.package = pkgs.jdk17;
      maven = {
        enable = true;
      };
    };
  };


  # https://devenv.sh/pre-commit-hooks/
  pre-commit.hooks.shellcheck.enable = true;
  pre-commit.hooks.commitizen.enable = true;

  # https://devenv.sh/processes/
  processes = {
    epqchat-dev.exec = "${pkgs.maven}/bin/mvn spring-boot:run";
  };
  services.mysql = {
    enable = true;
    package = pkgs.mariadb;
    initialDatabases = [
      { name = "epqchat"; }
    ];
    ensureUsers = [
      {
        name = "epqchatuser";
        password = "epqlevel3artifact";
        ensurePermissions = {
          "epqchat.*" = "ALL PRIVILEGES";
          "*.*" = "SELECT, LOCK TABLES";
        };
      }
    ];
  };
  # See full reference at https://devenv.sh/reference/options/
}