-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
84 lines (71 loc) · 2.36 KB
/
flake.nix
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
flake-parts.url = "github:hercules-ci/flake-parts";
process-compose-flake.url = "github:Platonic-Systems/process-compose-flake";
services-flake.url = "github:juspay/services-flake";
};
outputs = { self, nixpkgs, flake-parts, process-compose-flake, services-flake }@inputs:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" "aarch64-darwin" ];
imports = [
inputs.process-compose-flake.flakeModule
];
flake = {
nixosModules = { };
};
perSystem = { config, system, ... }:
let
pkgs = import nixpkgs { inherit system; };
haskellPackages = pkgs.haskell.packages.ghc910;
in
{
process-compose.dev-services = {
imports = [ inputs.services-flake.processComposeModules.default ];
services.postgres."db" = {
enable = true;
package = pkgs.postgresql_17;
initialScript.before = ''
CREATE USER test LOGIN PASSWORD 'test' SUPERUSER;
'';
initialDatabases = [
{ name = "test_db"; schemas = [ ]; }
];
};
};
devShells = {
default =
haskellPackages.shellFor {
POSTGRES_HOST = "127.0.0.1";
POSTGRES_USER = "test";
POSTGRES_PASSWORD = "test";
POSTGRES_DB_NAME = "test_db";
packages = p: [ ];
buildInputs = [
haskellPackages.haskell-language-server
haskellPackages.fourmolu
haskellPackages.cabal-install
haskellPackages.cabal-fmt
pkgs.postgresql_17
pkgs.watchexec
pkgs.zlib
pkgs.git
pkgs.nil
pkgs.nixpkgs-fmt
];
};
ci =
haskellPackages.shellFor {
packages = p: [];
buildInputs = [
haskellPackages.fourmolu
haskellPackages.cabal-install
haskellPackages.cabal-fmt
pkgs.zlib
pkgs.nixpkgs-fmt
];
};
};
};
};
}