forked from t0yv0/pulumi-flake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
30 lines (29 loc) · 941 Bytes
/
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
{
inputs = {
nixpkgs.url = github:NixOS/nixpkgs?rev=b7cde1c47b7316f6138a2b36ef6627f3d16d645c;
};
outputs = {
self,
nixpkgs,
}: let
sources = builtins.fromJSON (builtins.readFile ./sources.json);
pulumiPackage = system: let
pkgs = nixpkgs.legacyPackages.${system};
source = sources.${system};
in
pkgs.stdenv.mkDerivation {
pname = "pulumi";
version = source.version;
src = pkgs.fetchurl {
url = source.url;
hash = source.hash;
};
installPhase = "mkdir -p $out/bin && cp pulumi* $out/bin/ && $out/bin/pulumi version > $out/version.txt";
};
in {
packages.x86_64-linux.default = pulumiPackage "x86_64-linux";
packages.aarch64-linux.default = pulumiPackage "aarch64-linux";
packages.x86_64-darwin.default = pulumiPackage "x86_64-darwin";
packages.aarch64-darwin.default = pulumiPackage "aarch64-darwin";
};
}