Skip to content

Commit

Permalink
Merge pull request #2990 from cloudfoundry/fix-flake
Browse files Browse the repository at this point in the history
Fix flake
  • Loading branch information
joergdw authored Jun 21, 2024
2 parents 9246818 + cfe30cd commit d75e8fd
Show file tree
Hide file tree
Showing 13 changed files with 116 additions and 172 deletions.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ eclint_indent_style = unset

[Dockerfile]
indent_size = 4
indent_style = tab
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,12 @@ keys/
# <https://code.visualstudio.com/docs/editor/extension-marketplace#_workspace-recommended-extensions>
!.vscode/extensions.json


# ==================== 📦 Devbox ====================
.devbox

# ==================== ❄ Nix ====================

# Ignore links to build-output:
/result
/result-*
10 changes: 5 additions & 5 deletions devbox.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"packages": {
"path:local-flake#bosh-bootloader": "",
"path:local-flake#app-autoscaler-cli-plugin": "",
"path:local-flake#log-cache-cli-plugin": "",
"path:local-flake#cloud-mta-build-tool": "",
"path:local-flake#uaac": "",
"path:.#bosh-bootloader": "",
"path:.#app-autoscaler-cli-plugin": "",
"path:.#log-cache-cli-plugin": "",
"path:.#cloud-mta-build-tool": "",
"path:.#uaac": "",
"credhub-cli": "2.9.29",
"delve": "latest",
"gh": "latest",
Expand Down
40 changes: 4 additions & 36 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 11 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
inputs = {
nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable;
nixpkgs-bosh-cli-v7-3-1.url = github:NixOS/nixpkgs/1179c6c3705509ba25bd35196fca507d2a227bd0;
local-flake.url = "path:./local-flake";
};

outputs = { self, nixpkgs, nixpkgs-bosh-cli-v7-3-1, local-flake }:
outputs = { self, nixpkgs, nixpkgs-bosh-cli-v7-3-1 }:
let
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];

Expand All @@ -18,6 +17,13 @@
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
nixpkgsFor-bosh-cli-v7-3-1 = forAllSystems (system: import nixpkgs-bosh-cli-v7-3-1 { inherit system; });
in {
packages = forAllSystems (system:
let
nixpkgs = nixpkgsFor.${system};
callPackages = nixpkgs.lib.customisation.callPackagesWith nixpkgs;
in callPackages ./nix/packages.nix {}
);

openapi-specifications = {
app-autoscaler-api =
let
Expand All @@ -36,8 +42,8 @@
buildInputs = with pkgs; [
act
actionlint
local-flake.packages.${system}.app-autoscaler-cli-plugin
local-flake.packages.${system}.bosh-bootloader
self.packages.${system}.app-autoscaler-cli-plugin
self.packages.${system}.bosh-bootloader
# to make `bosh create-release` work in a Nix shell on macOS, use an older bosh-cli version that reuses
# a bosh-utils version under the hood that doesn't use the tar option `--no-mac-metadata`.
# unfortunately, Nix provides gnutar by default, which doesn't have the `--no-mac-metadata` option.
Expand Down Expand Up @@ -92,7 +98,7 @@
shellHook = ''
# install required CF CLI plugins
cf install-plugin -f \
'${local-flake.packages.${system}.app-autoscaler-cli-plugin}/bin/app-autoscaler-cli-plugin'
'${self.packages.${system}.app-autoscaler-cli-plugin}/bin/app-autoscaler-cli-plugin'
aes_terminal_font_yellow='\e[38;2;255;255;0m'
aes_terminal_font_blink='\e[5m'
Expand Down
27 changes: 0 additions & 27 deletions local-flake/flake.lock

This file was deleted.

98 changes: 0 additions & 98 deletions local-flake/flake.nix

This file was deleted.

74 changes: 74 additions & 0 deletions nix/packages.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{ buildGoModule
, callPackage
, fetchFromGitHub
, fetchgit
, lib
}: {
app-autoscaler-cli-plugin = buildGoModule rec {
pname = "app-autoscaler-cli-plugin";
gitCommit = "f46dc1ea62c4c7bd426c82f4e2a525b3a3c42300";
version = "${gitCommit}";
src = fetchgit {
url = "https://github.com/cloudfoundry/app-autoscaler-cli-plugin";
rev = "${gitCommit}";
hash = "sha256-j8IAUhjYjEFvtRbA6o2vA7P2uUmKVYsd9uJmN0WtVCM=";
fetchSubmodules = true;
};
doCheck = false;
vendorHash = "sha256-NzEStcOv8ZQsHOA8abLABKy+ZE3/SiYbRD/ZVxo0CEk=";
};

# this bosh-bootloader custom build can be removed once https://github.com/cloudfoundry/bosh-bootloader/issues/596 is implemented.
bosh-bootloader = buildGoModule rec {
pname = "bosh-bootloader";
version = "9.0.17";
src = fetchgit {
url = "https://github.com/cloudfoundry/bosh-bootloader";
rev = "v${version}";
fetchSubmodules = true;
hash = "sha256-P4rS7Nv/09+9dD198z4NOXnldSE5fx3phEK24Acatps=";
};
doCheck = false;
vendorHash = null;
};

cloud-mta-build-tool = buildGoModule rec {
pname = "Cloud MTA Build Tool";
version = "1.2.26";

src = fetchFromGitHub {
owner = "SAP";
repo = "cloud-mta-build-tool";
rev = "v${version}";
hash = "sha256-DKZ9Nj/sNC9dRjyiu4MKjLrIJWluYlZzUHWqEqtrNt4=";
};

vendorHash = "sha256-h8LPsuxvbr/aRhH1vR1fYgBot37yrfiemZTJMKj0zbk=";

ldflags = ["-s" "-w" "-X main.Version=${version}"];

doCheck = false;

postInstall = ''
pushd "$out/bin" &> /dev/null
ln -s 'cloud-mta-build-tool' 'mbt'
popd
'';
};

log-cache-cli-plugin = buildGoModule rec {
pname = "log-cache-cli";
version = "6.0.1";
src = fetchgit {
url = "https://github.com/cloudfoundry/log-cache-cli";
rev = "v${version}";
hash = "sha256-XMxZPmqjOo/yaMFHY+zTjamB2FmPn2eh0zEtwQevt+I=";
fetchSubmodules = true;
};
doCheck = false;
vendorHash = null;
ldflags = ["-s" "-w" "-X main.version=${version}"];
};

uaac = callPackage ./packages/uaac {};
}
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions nix/packages/uaac/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{ bundlerApp }:

bundlerApp {
pname = "cf-uaac";
gemdir = ./.;
exes = ["uaac"];

meta = {
description = "CloudFoundry UAA Command Line Client";
homepage = "https://github.com/cloudfoundry/cf-uaac";
mainProgram = "uaac";
};
}
File renamed without changes.
1 change: 0 additions & 1 deletion result

This file was deleted.

0 comments on commit d75e8fd

Please sign in to comment.