From 75f71f9ad0501b1afab1cd10c543634d37601ae0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Weisbarth?= Date: Wed, 5 Jun 2024 17:31:43 +0200 Subject: [PATCH 01/10] Make tab-indentation the default for Docker due to their here-docs; --- .editorconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/.editorconfig b/.editorconfig index 4681936bde..c471783770 100644 --- a/.editorconfig +++ b/.editorconfig @@ -21,3 +21,4 @@ eclint_indent_style = unset [Dockerfile] indent_size = 4 +indent_style = tab From 5f3c2a61030f3b50ba5850ff10551fba2498c140 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Weisbarth?= Date: Wed, 5 Jun 2024 17:32:11 +0200 Subject: [PATCH 02/10] Avoid accidental commits for Nix build-results; --- .gitignore | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.gitignore b/.gitignore index 699df721f9..15d3ad5582 100644 --- a/.gitignore +++ b/.gitignore @@ -61,4 +61,12 @@ keys/ # !.vscode/extensions.json + +# ==================== 📦 Devbox ==================== .devbox + +# ==================== ❄ Nix ==================== + +# Ignore links to build-output: +/result +/result-* From 17987178ca5c9c90fc6ad1bab53dd710540c065b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Weisbarth?= Date: Wed, 5 Jun 2024 17:33:30 +0200 Subject: [PATCH 03/10] Restructure top-level-flake to not use a relative reference. --- flake.lock | 40 ++------------- flake.nix | 16 ++++-- nix/packages.nix | 49 +++++++++++++++++++ .../app-autoscaler-cli-plugin/default.nix | 0 {local-flake => nix/packages/uaac}/Gemfile | 0 .../packages/uaac}/Gemfile.lock | 0 nix/packages/uaac/default.nix | 13 +++++ {local-flake => nix/packages/uaac}/gemset.nix | 0 result | 1 - 9 files changed, 77 insertions(+), 42 deletions(-) create mode 100644 nix/packages.nix create mode 100644 nix/packages/app-autoscaler-cli-plugin/default.nix rename {local-flake => nix/packages/uaac}/Gemfile (100%) rename {local-flake => nix/packages/uaac}/Gemfile.lock (100%) create mode 100644 nix/packages/uaac/default.nix rename {local-flake => nix/packages/uaac}/gemset.nix (100%) delete mode 120000 result diff --git a/flake.lock b/flake.lock index b2b2f848e3..fc7baf8c16 100644 --- a/flake.lock +++ b/flake.lock @@ -1,27 +1,12 @@ { "nodes": { - "local-flake": { - "inputs": { - "nixpkgs": "nixpkgs" - }, - "locked": { - "lastModified": 1, - "narHash": "sha256-ZmNHp5kO8fEuq3BWOnLr6FDZRLxY8v6QkqtpDQiFG2Y=", - "path": "./local-flake", - "type": "path" - }, - "original": { - "path": "./local-flake", - "type": "path" - } - }, "nixpkgs": { "locked": { - "lastModified": 1710272261, - "narHash": "sha256-g0bDwXFmTE7uGDOs9HcJsfLFhH7fOsASbAuOzDC+fhQ=", + "lastModified": 1699099776, + "narHash": "sha256-X09iKJ27mGsGambGfkKzqvw5esP1L/Rf8H3u3fCqIiU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0ad13a6833440b8e238947e47bea7f11071dc2b2", + "rev": "85f1ba3e51676fa8cc604a3d863d729026a6b8eb", "type": "github" }, "original": { @@ -47,26 +32,9 @@ "type": "github" } }, - "nixpkgs_2": { - "locked": { - "lastModified": 1699099776, - "narHash": "sha256-X09iKJ27mGsGambGfkKzqvw5esP1L/Rf8H3u3fCqIiU=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "85f1ba3e51676fa8cc604a3d863d729026a6b8eb", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "root": { "inputs": { - "local-flake": "local-flake", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs", "nixpkgs-bosh-cli-v7-3-1": "nixpkgs-bosh-cli-v7-3-1" } } diff --git a/flake.nix b/flake.nix index 12107c6f68..bf4f98eaf8 100644 --- a/flake.nix +++ b/flake.nix @@ -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" ]; @@ -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 @@ -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. @@ -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' diff --git a/nix/packages.nix b/nix/packages.nix new file mode 100644 index 0000000000..e5fed3e92d --- /dev/null +++ b/nix/packages.nix @@ -0,0 +1,49 @@ +{ buildGoModule +, callPackage +, 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; + }; + + 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 {}; +} diff --git a/nix/packages/app-autoscaler-cli-plugin/default.nix b/nix/packages/app-autoscaler-cli-plugin/default.nix new file mode 100644 index 0000000000..e69de29bb2 diff --git a/local-flake/Gemfile b/nix/packages/uaac/Gemfile similarity index 100% rename from local-flake/Gemfile rename to nix/packages/uaac/Gemfile diff --git a/local-flake/Gemfile.lock b/nix/packages/uaac/Gemfile.lock similarity index 100% rename from local-flake/Gemfile.lock rename to nix/packages/uaac/Gemfile.lock diff --git a/nix/packages/uaac/default.nix b/nix/packages/uaac/default.nix new file mode 100644 index 0000000000..2eb644aa4d --- /dev/null +++ b/nix/packages/uaac/default.nix @@ -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"; + }; +} diff --git a/local-flake/gemset.nix b/nix/packages/uaac/gemset.nix similarity index 100% rename from local-flake/gemset.nix rename to nix/packages/uaac/gemset.nix diff --git a/result b/result deleted file mode 120000 index b0833e7111..0000000000 --- a/result +++ /dev/null @@ -1 +0,0 @@ -/nix/store/jh9qqg0h60906vbhz08h238hhsd0m632-api \ No newline at end of file From edc8a911975eaa74a2a0b2905913ba1186dcfe48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Weisbarth?= Date: Wed, 5 Jun 2024 17:38:53 +0200 Subject: [PATCH 04/10] Make local flake for devbox work; --- local-flake/flake.nix | 63 +++++-------------------------------------- 1 file changed, 7 insertions(+), 56 deletions(-) diff --git a/local-flake/flake.nix b/local-flake/flake.nix index ff108fd774..989f4c6e6d 100644 --- a/local-flake/flake.nix +++ b/local-flake/flake.nix @@ -15,60 +15,11 @@ # Nixpkgs instantiated for supported system types. nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; }); in { - packages = forAllSystems (system: { - app-autoscaler-cli-plugin = nixpkgsFor.${system}.buildGoModule rec { - pname = "app-autoscaler-cli-plugin"; - gitCommit = "f46dc1ea62c4c7bd426c82f4e2a525b3a3c42300"; - version = "${gitCommit}"; - src = nixpkgsFor.${system}.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 = nixpkgsFor.${system}.buildGoModule rec { - pname = "bosh-bootloader"; - version = "9.0.17"; - src = nixpkgsFor.${system}.fetchgit { - url = "https://github.com/cloudfoundry/bosh-bootloader"; - rev = "v${version}"; - fetchSubmodules = true; - hash = "sha256-P4rS7Nv/09+9dD198z4NOXnldSE5fx3phEK24Acatps="; - }; - doCheck = false; - vendorHash = null; - }; - - log-cache-cli-plugin = nixpkgsFor.${system}.buildGoModule rec { - pname = "log-cache-cli"; - version = "6.0.1"; - src = nixpkgsFor.${system}.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 = nixpkgsFor.${system}.bundlerApp rec { - pname = "cf-uaac"; - gemdir = ./.; - exes = ["uaac"]; - - meta = { - description = "CloudFoundry UAA Command Line Client"; - homepage = "https://github.com/cloudfoundry/cf-uaac"; - mainProgram = "uaac"; - }; - }; - }); - }; + packages = forAllSystems (system: + let + nixpkgs = nixpkgsFor.${system}; + callPackages = nixpkgs.lib.customisation.callPackagesWith nixpkgs; + in callPackages ../nix/packages.nix {} + ); + }; } From 4cce7f351e787e78c19080badb0a0ca383b17202 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Weisbarth?= Date: Wed, 5 Jun 2024 17:43:32 +0200 Subject: [PATCH 05/10] =?UTF-8?q?=F0=9F=A7=B9=20Cleanup;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nix/packages/app-autoscaler-cli-plugin/default.nix | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 nix/packages/app-autoscaler-cli-plugin/default.nix diff --git a/nix/packages/app-autoscaler-cli-plugin/default.nix b/nix/packages/app-autoscaler-cli-plugin/default.nix deleted file mode 100644 index e69de29bb2..0000000000 From 29025ca8e715edb27e119dc865b4f37a62d45f5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Weisbarth?= Date: Wed, 5 Jun 2024 17:44:32 +0200 Subject: [PATCH 06/10] =?UTF-8?q?=E2=86=91=E2=9D=84=20Update=20flake;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index fc7baf8c16..b9e57b6c0c 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1699099776, - "narHash": "sha256-X09iKJ27mGsGambGfkKzqvw5esP1L/Rf8H3u3fCqIiU=", + "lastModified": 1717196966, + "narHash": "sha256-yZKhxVIKd2lsbOqYd5iDoUIwsRZFqE87smE2Vzf6Ck0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "85f1ba3e51676fa8cc604a3d863d729026a6b8eb", + "rev": "57610d2f8f0937f39dbd72251e9614b1561942d8", "type": "github" }, "original": { From 663ff86601ce56145fbafe9f6671735a86752fcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Weisbarth?= Date: Fri, 21 Jun 2024 14:41:22 +0200 Subject: [PATCH 07/10] =?UTF-8?q?=E2=86=91=E2=9D=84=20Update=20flake-input?= =?UTF-8?q?s;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flake.lock | 6 +++--- local-flake/flake.lock | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index b9e57b6c0c..d8bb6aa635 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1717196966, - "narHash": "sha256-yZKhxVIKd2lsbOqYd5iDoUIwsRZFqE87smE2Vzf6Ck0=", + "lastModified": 1718714799, + "narHash": "sha256-FUZpz9rg3gL8NVPKbqU8ei1VkPLsTIfAJ2fdAf5qjak=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "57610d2f8f0937f39dbd72251e9614b1561942d8", + "rev": "c00d587b1a1afbf200b1d8f0b0e4ba9deb1c7f0e", "type": "github" }, "original": { diff --git a/local-flake/flake.lock b/local-flake/flake.lock index fa62f4a298..bb5d5cd8b2 100644 --- a/local-flake/flake.lock +++ b/local-flake/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1710272261, - "narHash": "sha256-g0bDwXFmTE7uGDOs9HcJsfLFhH7fOsASbAuOzDC+fhQ=", + "lastModified": 1718714799, + "narHash": "sha256-FUZpz9rg3gL8NVPKbqU8ei1VkPLsTIfAJ2fdAf5qjak=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0ad13a6833440b8e238947e47bea7f11071dc2b2", + "rev": "c00d587b1a1afbf200b1d8f0b0e4ba9deb1c7f0e", "type": "github" }, "original": { From 7607fc6efc66464840fbde92148f0813b8a63163 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Weisbarth?= Date: Fri, 21 Jun 2024 14:48:25 +0200 Subject: [PATCH 08/10] Unify inputs of the two flakes; --- flake.lock | 19 +------------------ flake.nix | 7 ++----- local-flake/flake.lock | 28 +--------------------------- 3 files changed, 4 insertions(+), 50 deletions(-) mode change 100644 => 120000 local-flake/flake.lock diff --git a/flake.lock b/flake.lock index d8bb6aa635..bb5d5cd8b2 100644 --- a/flake.lock +++ b/flake.lock @@ -16,26 +16,9 @@ "type": "github" } }, - "nixpkgs-bosh-cli-v7-3-1": { - "locked": { - "lastModified": 1689621684, - "narHash": "sha256-a7nGZZezo5s3STRCHl5e73eNTmU/Zg/QcrtzyrfZ5Qg=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "1179c6c3705509ba25bd35196fca507d2a227bd0", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "1179c6c3705509ba25bd35196fca507d2a227bd0", - "type": "github" - } - }, "root": { "inputs": { - "nixpkgs": "nixpkgs", - "nixpkgs-bosh-cli-v7-3-1": "nixpkgs-bosh-cli-v7-3-1" + "nixpkgs": "nixpkgs" } } }, diff --git a/flake.nix b/flake.nix index bf4f98eaf8..8ad0672231 100644 --- a/flake.nix +++ b/flake.nix @@ -3,10 +3,9 @@ inputs = { nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable; - nixpkgs-bosh-cli-v7-3-1.url = github:NixOS/nixpkgs/1179c6c3705509ba25bd35196fca507d2a227bd0; }; - outputs = { self, nixpkgs, nixpkgs-bosh-cli-v7-3-1 }: + outputs = { self, nixpkgs }: let supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; @@ -15,7 +14,6 @@ # Nixpkgs instantiated for supported system types. 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 @@ -36,7 +34,6 @@ devShells = forAllSystems (system: let pkgs = nixpkgsFor.${system}; - pkgs-bosh-cli-v7-3-1 = nixpkgsFor-bosh-cli-v7-3-1.${system}; in { default = pkgs.mkShell { buildInputs = with pkgs; [ @@ -51,7 +48,7 @@ # see bosh-utils change https://github.com/cloudfoundry/bosh-utils/commit/f79167bd43f3afc154065edc95799a464a80605f. # this blind bsdtar assumption by bosh-utils breaks creating bosh releases in a Nix shell on macOS. # a GitHub issue related to this problem can be found here: https://github.com/cloudfoundry/bosh-utils/issues/86. - pkgs-bosh-cli-v7-3-1.bosh-cli + bosh-cli cloudfoundry-cli credhub-cli delve # go-debugger diff --git a/local-flake/flake.lock b/local-flake/flake.lock deleted file mode 100644 index bb5d5cd8b2..0000000000 --- a/local-flake/flake.lock +++ /dev/null @@ -1,27 +0,0 @@ -{ - "nodes": { - "nixpkgs": { - "locked": { - "lastModified": 1718714799, - "narHash": "sha256-FUZpz9rg3gL8NVPKbqU8ei1VkPLsTIfAJ2fdAf5qjak=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "c00d587b1a1afbf200b1d8f0b0e4ba9deb1c7f0e", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "nixpkgs": "nixpkgs" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/local-flake/flake.lock b/local-flake/flake.lock new file mode 120000 index 0000000000..1985b6556b --- /dev/null +++ b/local-flake/flake.lock @@ -0,0 +1 @@ +../flake.lock \ No newline at end of file From 7a1a8e7b676b71d59c0de838936608ddc4078c2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Weisbarth?= Date: Fri, 21 Jun 2024 14:49:26 +0200 Subject: [PATCH 09/10] Revert "Unify inputs of the two flakes;" (Devbox does not like that.) This reverts commit 7607fc6efc66464840fbde92148f0813b8a63163. --- flake.lock | 19 ++++++++++++++++++- flake.nix | 7 +++++-- local-flake/flake.lock | 28 +++++++++++++++++++++++++++- 3 files changed, 50 insertions(+), 4 deletions(-) mode change 120000 => 100644 local-flake/flake.lock diff --git a/flake.lock b/flake.lock index bb5d5cd8b2..d8bb6aa635 100644 --- a/flake.lock +++ b/flake.lock @@ -16,9 +16,26 @@ "type": "github" } }, + "nixpkgs-bosh-cli-v7-3-1": { + "locked": { + "lastModified": 1689621684, + "narHash": "sha256-a7nGZZezo5s3STRCHl5e73eNTmU/Zg/QcrtzyrfZ5Qg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1179c6c3705509ba25bd35196fca507d2a227bd0", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1179c6c3705509ba25bd35196fca507d2a227bd0", + "type": "github" + } + }, "root": { "inputs": { - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "nixpkgs-bosh-cli-v7-3-1": "nixpkgs-bosh-cli-v7-3-1" } } }, diff --git a/flake.nix b/flake.nix index 8ad0672231..bf4f98eaf8 100644 --- a/flake.nix +++ b/flake.nix @@ -3,9 +3,10 @@ inputs = { nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable; + nixpkgs-bosh-cli-v7-3-1.url = github:NixOS/nixpkgs/1179c6c3705509ba25bd35196fca507d2a227bd0; }; - outputs = { self, nixpkgs }: + outputs = { self, nixpkgs, nixpkgs-bosh-cli-v7-3-1 }: let supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; @@ -14,6 +15,7 @@ # Nixpkgs instantiated for supported system types. 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 @@ -34,6 +36,7 @@ devShells = forAllSystems (system: let pkgs = nixpkgsFor.${system}; + pkgs-bosh-cli-v7-3-1 = nixpkgsFor-bosh-cli-v7-3-1.${system}; in { default = pkgs.mkShell { buildInputs = with pkgs; [ @@ -48,7 +51,7 @@ # see bosh-utils change https://github.com/cloudfoundry/bosh-utils/commit/f79167bd43f3afc154065edc95799a464a80605f. # this blind bsdtar assumption by bosh-utils breaks creating bosh releases in a Nix shell on macOS. # a GitHub issue related to this problem can be found here: https://github.com/cloudfoundry/bosh-utils/issues/86. - bosh-cli + pkgs-bosh-cli-v7-3-1.bosh-cli cloudfoundry-cli credhub-cli delve # go-debugger diff --git a/local-flake/flake.lock b/local-flake/flake.lock deleted file mode 120000 index 1985b6556b..0000000000 --- a/local-flake/flake.lock +++ /dev/null @@ -1 +0,0 @@ -../flake.lock \ No newline at end of file diff --git a/local-flake/flake.lock b/local-flake/flake.lock new file mode 100644 index 0000000000..bb5d5cd8b2 --- /dev/null +++ b/local-flake/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1718714799, + "narHash": "sha256-FUZpz9rg3gL8NVPKbqU8ei1VkPLsTIfAJ2fdAf5qjak=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c00d587b1a1afbf200b1d8f0b0e4ba9deb1c7f0e", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} From cfe30cd08b9569c53d0582498247a31e56198987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Weisbarth?= Date: Fri, 21 Jun 2024 15:14:53 +0200 Subject: [PATCH 10/10] Unify internal flake and top-level-flake; --- devbox.json | 10 +++++----- local-flake/flake.lock | 27 --------------------------- local-flake/flake.nix | 25 ------------------------- 3 files changed, 5 insertions(+), 57 deletions(-) delete mode 100644 local-flake/flake.lock delete mode 100644 local-flake/flake.nix diff --git a/devbox.json b/devbox.json index c303404bb1..0993aabfaa 100644 --- a/devbox.json +++ b/devbox.json @@ -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", diff --git a/local-flake/flake.lock b/local-flake/flake.lock deleted file mode 100644 index bb5d5cd8b2..0000000000 --- a/local-flake/flake.lock +++ /dev/null @@ -1,27 +0,0 @@ -{ - "nodes": { - "nixpkgs": { - "locked": { - "lastModified": 1718714799, - "narHash": "sha256-FUZpz9rg3gL8NVPKbqU8ei1VkPLsTIfAJ2fdAf5qjak=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "c00d587b1a1afbf200b1d8f0b0e4ba9deb1c7f0e", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "nixpkgs": "nixpkgs" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/local-flake/flake.nix b/local-flake/flake.nix deleted file mode 100644 index 989f4c6e6d..0000000000 --- a/local-flake/flake.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ - description = "Dependencies of app-autoscaler-release"; - - inputs = { - nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable; - }; - - outputs = { self, nixpkgs }: - let - supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; - - # Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'. - forAllSystems = nixpkgs.lib.genAttrs supportedSystems; - - # Nixpkgs instantiated for supported system types. - nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; }); - in { - packages = forAllSystems (system: - let - nixpkgs = nixpkgsFor.${system}; - callPackages = nixpkgs.lib.customisation.callPackagesWith nixpkgs; - in callPackages ../nix/packages.nix {} - ); - }; -}