forked from schemahero/schemahero
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
78 lines (68 loc) · 2.21 KB
/
Copy pathflake.nix
File metadata and controls
78 lines (68 loc) · 2.21 KB
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
{
description = "SchemaHero - A cloud-native database schema management tool";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
schemahero = pkgs.callPackage ./nix/schemahero.nix { };
in
{
packages = {
default = schemahero;
schemahero = schemahero;
};
apps = {
default = flake-utils.lib.mkApp {
drv = schemahero;
name = "schemahero";
};
schemahero = flake-utils.lib.mkApp {
drv = schemahero;
name = "schemahero";
};
kubectl-schemahero = flake-utils.lib.mkApp {
drv = schemahero;
name = "kubectl-schemahero";
};
};
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
go_1_24
gnumake
kubectl
schemahero
];
shellHook = ''
echo "SchemaHero development environment"
echo "Available commands:"
echo " - go: Go ${pkgs.go_1_24.version}"
echo " - make: GNU Make for building"
echo " - kubectl: Kubernetes CLI"
echo " - schemahero: SchemaHero CLI (from Nix package)"
echo ""
echo "To build from source: make bin/kubectl-schemahero"
echo "To test Nix package: nix run"
'';
};
checks = {
# Build check - ensures the package builds successfully
build = schemahero;
# Basic functionality test
schemahero-test = pkgs.runCommand "schemahero-test" {
buildInputs = [ schemahero ];
} ''
# Test that the binary exists and runs
schemahero --help > $out
# Test that version command works
schemahero version || true
# Test kubectl plugin mode
kubectl-schemahero --help >> $out || true
echo "All basic tests passed" >> $out
'';
};
});
}