Fix up some TODOs

This commit is contained in:
Brian Picciano 2023-02-15 14:58:47 +01:00
parent 8e800951a6
commit 94c6ad8774
3 changed files with 38 additions and 45 deletions

View File

@ -1,8 +1,14 @@
# TODO # TODO
# - allow injecting a bootstrap file # - allow injecting a bootstrap file
# - Set ARCH arg for appimagetool target in default.nix {
let buildSystem ? builtins.currentSystem,
hostSystem ? builtins.currentSystem,
revision ? "",
releaseName ? "debug",
}: let
pkgsNix = (import ./nix/pkgs.nix); pkgsNix = (import ./nix/pkgs.nix);
@ -10,20 +16,14 @@ let
inherit buildSystem hostSystem; inherit buildSystem hostSystem;
}; };
in { garageNix = (import ./nix/garage.nix);
buildSystem ? builtins.currentSystem, in rec {
hostSystem ? builtins.currentSystem,
selfRev ? "",
releaseName ? "debug",
}: rec {
version = pkgs.stdenv.mkDerivation { version = pkgs.stdenv.mkDerivation {
name = "cryptic-net-version"; name = "cryptic-net-version";
inherit selfRev hostSystem releaseName; inherit revision hostSystem releaseName;
repoSrc = ./.; repoSrc = ./.;
nativeBuildInputs = [ pkgs.git ]; nativeBuildInputs = [ pkgs.git ];
@ -31,22 +31,21 @@ in {
# TODO it'd be nice to be able to call `go version`, but that doesn't work # TODO it'd be nice to be able to call `go version`, but that doesn't work
# when crossSystem is being used for some unknown reason. # when crossSystem is being used for some unknown reason.
goVersion = pkgs.go.version; goVersion = pkgs.go.version;
#garageVersion = garage.version; garageVersion = garageNix.version;
garageVersion = "TODO";
builder = builtins.toFile "builder.sh" '' builder = builtins.toFile "builder.sh" ''
source $stdenv/setup source $stdenv/setup
versionFile=version versionFile=version
if [ "$selfRev" = "" ]; then if [ "$revision" = "" ]; then
cp -r "$repoSrc" repoSrcCp cp -r "$repoSrc" repoSrcCp
selfRev="$(cd repoSrcCp && git rev-parse HEAD)" revision="$(cd repoSrcCp && git rev-parse HEAD)"
fi fi
echo "Release $releaseName" >> "$versionFile" echo "Release $releaseName" >> "$versionFile"
echo "System: $hostSystem" >> "$versionFile" echo "System: $hostSystem" >> "$versionFile"
echo "Git Revision: $selfRev" >> "$versionFile" echo "Git Revision: $revision" >> "$versionFile"
echo "Go Version: $goVersion" >> "$versionFile" echo "Go Version: $goVersion" >> "$versionFile"
echo "Garage Version: $garageVersion" >> "$versionFile" echo "Garage Version: $garageVersion" >> "$versionFile"
@ -67,7 +66,7 @@ in {
hostPlatform = pkgs.stdenv.hostPlatform.parsed; hostPlatform = pkgs.stdenv.hostPlatform.parsed;
in pkgs.callPackage (import ./nix/garage.nix) { in pkgs.callPackage garageNix.package {
inherit buildSystem; inherit buildSystem;
hostSystem = "${hostPlatform.cpu.name}-unknown-${hostPlatform.kernel.name}-musl"; hostSystem = "${hostPlatform.cpu.name}-unknown-${hostPlatform.kernel.name}-musl";
@ -100,7 +99,7 @@ in {
appimagetool appimagetool
]; ];
ARCH = "x86_64"; ARCH = pkgs.stdenv.hostPlatform.parsed.cpu.name;
builder = builtins.toFile "build.sh" '' builder = builtins.toFile "build.sh" ''
source $stdenv/setup source $stdenv/setup

View File

@ -18,7 +18,7 @@
defaultAttrs = (import ./default.nix) { defaultAttrs = (import ./default.nix) {
inherit hostSystem buildSystem; inherit hostSystem buildSystem;
selfRev = if self ? rev then self.rev else "dirty"; revision = if self ? rev then self.rev else "dirty";
releaseName = "flake"; releaseName = "flake";
}; };

View File

@ -1,25 +1,20 @@
{ rec {
pkgsSrc,
buildSystem,
hostSystem,
fetchgit,
buildEnv,
minio-client,
}: let
version = "0.8.1"; version = "0.8.1";
src = fetchgit { src = builtins.fetchGit {
name = "garage-v${version}"; name = "garage-v${version}";
url = "https://git.deuxfleurs.fr/Deuxfleurs/garage.git"; url = "https://git.deuxfleurs.fr/Deuxfleurs/garage.git";
rev = "76230f20282e73a5a5afa33af68152acaf732cf5"; rev = "76230f20282e73a5a5afa33af68152acaf732cf5";
sha256 = "sha256-lpNp/jw4YaczG3NM3pVWR0cZ8u/KBQCWvvfAswO4+Do=";
}; };
compiled = (import "${src}/nix/compile.nix") { package = {
pkgsSrc,
buildSystem,
hostSystem,
}: let
compile = (import "${src}/nix/compile.nix") {
system = buildSystem; system = buildSystem;
target = hostSystem; target = hostSystem;
@ -29,11 +24,10 @@
release = true; release = true;
git_version = version; git_version = version;
}; };
in in
compile.workspace.garage {
compiled.workspace.garage {
compileMode = "build"; compileMode = "build";
} };
}