Fix up some TODOs
This commit is contained in:
parent
8e800951a6
commit
94c6ad8774
35
default.nix
35
default.nix
@ -1,8 +1,14 @@
|
||||
# TODO
|
||||
# - 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);
|
||||
|
||||
@ -10,20 +16,14 @@ let
|
||||
inherit buildSystem hostSystem;
|
||||
};
|
||||
|
||||
in {
|
||||
garageNix = (import ./nix/garage.nix);
|
||||
|
||||
buildSystem ? builtins.currentSystem,
|
||||
hostSystem ? builtins.currentSystem,
|
||||
|
||||
selfRev ? "",
|
||||
releaseName ? "debug",
|
||||
|
||||
}: rec {
|
||||
in rec {
|
||||
|
||||
version = pkgs.stdenv.mkDerivation {
|
||||
name = "cryptic-net-version";
|
||||
|
||||
inherit selfRev hostSystem releaseName;
|
||||
inherit revision hostSystem releaseName;
|
||||
repoSrc = ./.;
|
||||
|
||||
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
|
||||
# when crossSystem is being used for some unknown reason.
|
||||
goVersion = pkgs.go.version;
|
||||
#garageVersion = garage.version;
|
||||
garageVersion = "TODO";
|
||||
garageVersion = garageNix.version;
|
||||
|
||||
builder = builtins.toFile "builder.sh" ''
|
||||
source $stdenv/setup
|
||||
|
||||
versionFile=version
|
||||
|
||||
if [ "$selfRev" = "" ]; then
|
||||
if [ "$revision" = "" ]; then
|
||||
cp -r "$repoSrc" repoSrcCp
|
||||
selfRev="$(cd repoSrcCp && git rev-parse HEAD)"
|
||||
revision="$(cd repoSrcCp && git rev-parse HEAD)"
|
||||
fi
|
||||
|
||||
echo "Release $releaseName" >> "$versionFile"
|
||||
echo "System: $hostSystem" >> "$versionFile"
|
||||
echo "Git Revision: $selfRev" >> "$versionFile"
|
||||
echo "Git Revision: $revision" >> "$versionFile"
|
||||
echo "Go Version: $goVersion" >> "$versionFile"
|
||||
echo "Garage Version: $garageVersion" >> "$versionFile"
|
||||
|
||||
@ -67,7 +66,7 @@ in {
|
||||
|
||||
hostPlatform = pkgs.stdenv.hostPlatform.parsed;
|
||||
|
||||
in pkgs.callPackage (import ./nix/garage.nix) {
|
||||
in pkgs.callPackage garageNix.package {
|
||||
|
||||
inherit buildSystem;
|
||||
hostSystem = "${hostPlatform.cpu.name}-unknown-${hostPlatform.kernel.name}-musl";
|
||||
@ -100,7 +99,7 @@ in {
|
||||
appimagetool
|
||||
];
|
||||
|
||||
ARCH = "x86_64";
|
||||
ARCH = pkgs.stdenv.hostPlatform.parsed.cpu.name;
|
||||
|
||||
builder = builtins.toFile "build.sh" ''
|
||||
source $stdenv/setup
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
defaultAttrs = (import ./default.nix) {
|
||||
inherit hostSystem buildSystem;
|
||||
selfRev = if self ? rev then self.rev else "dirty";
|
||||
revision = if self ? rev then self.rev else "dirty";
|
||||
releaseName = "flake";
|
||||
};
|
||||
|
||||
|
@ -1,25 +1,20 @@
|
||||
{
|
||||
|
||||
pkgsSrc,
|
||||
buildSystem,
|
||||
hostSystem,
|
||||
|
||||
fetchgit,
|
||||
buildEnv,
|
||||
minio-client,
|
||||
|
||||
}: let
|
||||
rec {
|
||||
|
||||
version = "0.8.1";
|
||||
|
||||
src = fetchgit {
|
||||
src = builtins.fetchGit {
|
||||
name = "garage-v${version}";
|
||||
url = "https://git.deuxfleurs.fr/Deuxfleurs/garage.git";
|
||||
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;
|
||||
target = hostSystem;
|
||||
@ -29,11 +24,10 @@
|
||||
|
||||
release = true;
|
||||
git_version = version;
|
||||
|
||||
};
|
||||
|
||||
in
|
||||
|
||||
compiled.workspace.garage {
|
||||
in
|
||||
compile.workspace.garage {
|
||||
compileMode = "build";
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user