Skip to content

Commit 5ed39d8

Browse files
Merge pull request #130 from socksy/add-nix-flake
Add nix flake
2 parents bbb31e1 + 34bf6b2 commit 5ed39d8

3 files changed

Lines changed: 120 additions & 1 deletion

File tree

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ node_modules
22
dist
33
.DS_Store
44
.idea
5-
/.history
5+
/.history
6+
result
7+
.direnv

flake.lock

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
description = "Basti - Securely connect to AWS resources in private VPCs";
3+
4+
inputs = {
5+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
6+
flake-utils.url = "github:numtide/flake-utils";
7+
};
8+
9+
outputs = { self, nixpkgs, flake-utils }:
10+
flake-utils.lib.eachDefaultSystem (system:
11+
let
12+
pkgs = nixpkgs.legacyPackages.${system};
13+
packageJson = builtins.fromJSON (builtins.readFile ./packages/basti/package.json);
14+
15+
basti = pkgs.buildNpmPackage {
16+
pname = "basti";
17+
version = packageJson.version;
18+
19+
src = self;
20+
21+
npmDepsHash = "sha256-zxXiutwNEyDNr7OPKb/0fKLXvHRFLdgCsGeBat7tpFk=";
22+
23+
npmWorkspace = "packages/basti";
24+
25+
npmBuildScript = "build-src";
26+
27+
postInstall = ''
28+
rm -rf $out/lib/node_modules/*/node_modules/{.bin,basti,basti-cdk,docs}
29+
ln -sf ../lib/node_modules/basti-monorepo/bin/run.js $out/bin/basti
30+
'';
31+
32+
meta = with pkgs.lib; {
33+
description = "Securely connect to RDS, Elasticache, and other AWS resources in VPCs with no idle cost";
34+
homepage = "https://github.com/basti-app/basti";
35+
license = licenses.mit;
36+
platforms = platforms.unix;
37+
};
38+
};
39+
in
40+
{
41+
packages.default = basti;
42+
43+
apps.default = {
44+
type = "app";
45+
program = "${basti}/bin/basti";
46+
};
47+
48+
devShells.default = pkgs.mkShell {
49+
buildInputs = [
50+
basti
51+
pkgs.awscli2
52+
];
53+
};
54+
}
55+
);
56+
}

0 commit comments

Comments
 (0)