forums.tonybtw.com

https://git.tonybtw.com/forums.tonybtw.com.git git://git.tonybtw.com/forums.tonybtw.com.git
1,100 bytes raw
1
{
2
  description = "forums-btw - A minimal php forum";
3
  inputs = {
4
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
5
  };
6
  outputs = {
7
    self,
8
    nixpkgs,
9
  }: let
10
    systems = ["x86_64-linux" "aarch64-linux"];
11
12
    forAllSystems = fn: nixpkgs.lib.genAttrs systems (system: fn nixpkgs.legacyPackages.${system});
13
  in {
14
    devShells = forAllSystems (pkgs: {
15
      default = pkgs.mkShell {
16
        packages = [
17
          (pkgs.php.withExtensions ({enabled, all}: enabled ++ [all.pdo_sqlite]))
18
          pkgs.just
19
          pkgs.sqlite
20
        ];
21
        shellHook = ''
22
          export PS1="(forums-btw) $PS1"
23
          echo ""
24
          echo "  forums-btw dev server"
25
          echo "  ---------------------"
26
          echo "  just dev         - start php server on localhost:8889"
27
          echo "  just dev 3000    - start on custom port"
28
          echo ""
29
          echo "  FORUM_DB defaults to ./data/forum.db"
30
          echo "  just reset-db    - delete the local database"
31
          echo ""
32
        '';
33
      };
34
    });
35
36
    formatter = forAllSystems (pkgs: pkgs.alejandra);
37
  };
38
}