Skip to content

Commit 984deb9

Browse files
committed
Add flake;
1 parent 503a5d9 commit 984deb9

File tree

4 files changed

+131
-7
lines changed

4 files changed

+131
-7
lines changed

.envrc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
1-
export GOPATH=$PWD
2-
export PATH=$GOPATH/bin:$PATH
1+
use_strict
2+
3+
# export GOPATH=$PWD
4+
# export PATH=$GOPATH/bin:$PATH
5+
6+
if has nix
7+
then
8+
use flake
9+
fi

.gitignore

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
/out/
2-
/pkg/
3-
/bin/
4-
.idea
5-
build
1+
# Nix build-results
2+
/result
3+
/result-*
64

flake.lock

Lines changed: 60 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: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
description = ''
3+
Flake for the cf-cli-plugin for app-autoscaler
4+
5+
For more on app-autoscaler, see: <https://github.com/cloudfoundry/app-autoscaler-release>
6+
'';
7+
8+
inputs = {
9+
nixpkgs.url = github:NixOS/nixpkgs/nixos-23.11;
10+
};
11+
12+
outputs = { self, nixpkgs, flake-utils }:
13+
let
14+
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
15+
16+
# Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
17+
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
18+
19+
# Nixpkgs instantiated for supported system types.
20+
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
21+
in flake-utils.lib.eachSystem supportedSystems (system: {
22+
packages = {
23+
app-autoscaler-cli-plugin = nixpkgsFor.${system}.buildGoModule rec {
24+
pname = "app-autoscaler-cli-plugin";
25+
version =
26+
let
27+
lastModifiedDate = self.lastModifiedDate or self.lastModified or "19700101";
28+
in "${builtins.substring 0 8 lastModifiedDate}-dev";
29+
src = ./.;
30+
vendorHash = "sha256-NzEStcOv8ZQsHOA8abLABKy+ZE3/SiYbRD/ZVxo0CEk=";
31+
32+
doCheck = false;
33+
34+
meta = {
35+
description = ''
36+
App-AutoScaler plug-in provides the command line interface to manage
37+
[App AutoScaler](<https://github.com/cloudfoundry-incubator/app-autoscaler>)
38+
policies, retrieve metrics and scaling event history.
39+
'';
40+
homepage = "https://github.com/cloudfoundry/app-autoscaler-cli-plugin";
41+
license = [nixpkgsLib.licenses.apsl20];
42+
};
43+
};
44+
};
45+
46+
devShells =
47+
let
48+
nixpkgs = nixpkgsFor.${system};
49+
in {
50+
default = nixpkgs.mkShell {
51+
buildInputs = with nixpkgs; [
52+
delve
53+
go
54+
gopls
55+
];
56+
};
57+
};
58+
});
59+
}

0 commit comments

Comments
 (0)