Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
fix(flake): build for all systems
Browse files Browse the repository at this point in the history
  • Loading branch information
florian-sanders-cc committed May 21, 2024
1 parent 4e4b6ef commit 7ee9538
Showing 1 changed file with 49 additions and 37 deletions.
86 changes: 49 additions & 37 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,56 @@

inputs = {
nixpkgs.url = "github:Nixos/nixpkgs/nixos-unstable";

systems.url = "github:nix-systems/default-linux";
};

outputs = inputs @ { self, nixpkgs, systems, ... }: {
defaultPackage.x86_64-linux = with import nixpkgs { system = "x86_64-linux"; };
buildNpmPackage rec {
pname = "clever-tools";

version = "0.0.0";

nodejs = nodejs-18_x;

src = fetchFromGitHub {
owner = "CleverCloud";
repo = "clever-tools";
rev = "${version}";
hash = "sha256-v60evwLnMxU5EGILAvCTtMsO0fWpjfc0TA7upHcrq9U=";
outputs = { self, nixpkgs }:
let
# Systems supported
allSystems = [
"x86_64-linux" # 64-bit Intel/AMD Linux
"aarch64-linux" # 64-bit ARM Linux
"x86_64-darwin" # 64-bit Intel macOS
"aarch64-darwin" # 64-bit ARM macOS
];

# Helper to provide system-specific attributes
forAllSystems = f: nixpkgs.lib.genAttrs allSystems (system: f {
pkgs = import nixpkgs { inherit system; };
});
in
{
packages = forAllSystems ({ pkgs }: {
default = pkgs.buildNpmPackage rec {
pname = "clever-tools";

version = "0.0.0";

nodejs = pkgs.nodejs-18_x;

src = pkgs.fetchFromGitHub {
owner = "CleverCloud";
repo = "clever-tools";
rev = "${version}";
hash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
};

npmDepsHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";

dontNpmBuild = true;

postInstall = ''
mkdir -p $out/share/{bash-completion/completions,zsh/site-functions}
$out/bin/clever --bash-autocomplete-script $out/bin/clever > $out/share/bash-completion/completions/clever
$out/bin/clever --zsh-autocomplete-script $out/bin/clever > $out/share/zsh/site-functions/_clever
'';

meta = {
description = "";
homepage = "";
maintainers = with pkgs.lib.maintainers;
[ ];
};
};

npmDepsHash = "sha256-AK1CNtFTM3wgel5L2ekmXWHZhIerqKPd5i7X/kJm7No=";

dontNpmBuild = true;

postInstall = ''
mkdir -p $out/share/{bash-completion/completions,zsh/site-functions}
$out/bin/clever --bash-autocomplete-script $out/bin/clever > $out/share/bash-completion/completions/clever
$out/bin/clever --zsh-autocomplete-script $out/bin/clever > $out/share/zsh/site-functions/_clever
'';

meta = {
description = "";
homepage = "";
# license = lib.licenses.apache;
maintainers = with lib.maintainers;
[ ];
};
};
};

});
};
}

0 comments on commit 7ee9538

Please sign in to comment.