-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
43 lines (40 loc) · 1.44 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
{
description = "Dev shell for pulumi";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
};
outputs = inputs @ { self, nixpkgs, flake-parts }:
flake-parts.lib.mkFlake { inherit inputs; }
{
# systems that this flake can be used on
systems = [ "aarch64-darwin" "x86_64-linux" ];
perSystem = { config, pkgs, system, ... }:
let
# Bundle the Pulumi binary with the language package to remove the
# warning about them not being in the same directory.
# See: https://github.com/pulumi/pulumi/issues/14525
pulumiBundle = pkgs.stdenv.mkDerivation {
name = "pulumi-bundle";
phases = [ "installPhase" "fixupPhase" ];
buildInputs = with pkgs; [ pulumi pulumiPackages.pulumi-language-go ];
installPhase = ''
mkdir -p $out/bin
mkdir -p $out/share
cp ${pkgs.pulumi}/bin/* $out/bin/
cp -r ${pkgs.pulumi}/share $out/share
cp ${pkgs.pulumiPackages.pulumi-language-go}/bin/* $out/bin/
'';
};
in
{
formatter = pkgs.nixpkgs-fmt;
devShells.default = pkgs.mkShell {
packages = with pkgs; [
go
pulumiBundle
];
};
};
};
}