Compare commits
3 Commits
3a3bd56295
...
a1b3ff71b3
Author | SHA1 | Date | |
---|---|---|---|
|
a1b3ff71b3 | ||
|
57f63750f3 | ||
|
1180540ce3 |
@ -1,4 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
export PATH=$APPDIR/bin
|
||||
exec entrypoint "$@"
|
33
default.nix
33
default.nix
@ -91,19 +91,32 @@ in rec {
|
||||
'';
|
||||
};
|
||||
|
||||
appDir = pkgs.buildEnv {
|
||||
appDir = pkgs.stdenv.mkDerivation {
|
||||
name = "cryptic-net-AppDir";
|
||||
paths = [
|
||||
|
||||
./AppDir
|
||||
version
|
||||
dnsmasq
|
||||
nebula
|
||||
garage
|
||||
pkgs.minio-client
|
||||
entrypoint
|
||||
src = pkgs.buildEnv {
|
||||
name = "cryptic-net-AppDir-base";
|
||||
paths = [
|
||||
|
||||
] ++ (if bootstrap != null then [ rootedBootstrap ] else []);
|
||||
./AppDir
|
||||
version
|
||||
dnsmasq
|
||||
nebula
|
||||
garage
|
||||
pkgs.minio-client
|
||||
entrypoint
|
||||
|
||||
] ++ (if bootstrap != null then [ rootedBootstrap ] else []);
|
||||
};
|
||||
|
||||
builder = builtins.toFile "build.sh" ''
|
||||
source $stdenv/setup
|
||||
cp -rL "$src" "$out"
|
||||
chmod +w "$out" -R
|
||||
|
||||
cd "$out"
|
||||
cp ./bin/entrypoint ./AppRun
|
||||
'';
|
||||
};
|
||||
|
||||
appimagetool = pkgs.callPackage ./nix/appimagetool.nix {};
|
||||
|
@ -45,7 +45,7 @@ func dnsmasqPmuxProcConfig(
|
||||
|
||||
return pmuxlib.ProcessConfig{
|
||||
Name: "dnsmasq",
|
||||
Cmd: "dnsmasq",
|
||||
Cmd: binPath("dnsmasq"),
|
||||
Args: []string{"-d", "-C", confPath},
|
||||
}, nil
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ var subCmdGarageMC = subCmd{
|
||||
args = args[i:]
|
||||
}
|
||||
|
||||
args = append([]string{"mc"}, args...)
|
||||
args = append([]string{binPath("mc")}, args...)
|
||||
|
||||
var (
|
||||
mcHostVar = fmt.Sprintf(
|
||||
@ -92,7 +92,7 @@ var subCmdGarageCLI = subCmd{
|
||||
}
|
||||
|
||||
var (
|
||||
binPath = filepath.Join(envAppDirPath, "bin/garage")
|
||||
binPath = binPath("garage")
|
||||
args = append([]string{"garage"}, subCmdCtx.args...)
|
||||
cliEnv = append(
|
||||
os.Environ(),
|
||||
|
@ -168,7 +168,7 @@ func garagePmuxProcConfigs(
|
||||
|
||||
pmuxProcConfigs = append(pmuxProcConfigs, pmuxlib.ProcessConfig{
|
||||
Name: fmt.Sprintf("garage-%d", alloc.RPCPort),
|
||||
Cmd: "garage",
|
||||
Cmd: binPath("garage"),
|
||||
Args: []string{"-c", childConfigPath, "server"},
|
||||
StartAfterFunc: func(ctx context.Context) error {
|
||||
return waitForNebula(ctx, hostBootstrap)
|
||||
|
@ -31,6 +31,10 @@ var (
|
||||
envDataDirPath = filepath.Join(xdg.DataHome, "cryptic-net")
|
||||
)
|
||||
|
||||
func binPath(name string) string {
|
||||
return filepath.Join(envAppDirPath, "bin", name)
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
||||
logger := mlog.NewLogger(&mlog.LoggerOpts{
|
||||
|
@ -111,7 +111,7 @@ func nebulaPmuxProcConfig(
|
||||
|
||||
return pmuxlib.ProcessConfig{
|
||||
Name: "nebula",
|
||||
Cmd: "nebula",
|
||||
Cmd: binPath("nebula"),
|
||||
Args: []string{"-config", nebulaYmlPath},
|
||||
}, nil
|
||||
}
|
||||
|
21
flake.lock
21
flake.lock
@ -1,25 +1,6 @@
|
||||
{
|
||||
"nodes": {
|
||||
"root": {
|
||||
"inputs": {
|
||||
"utils": "utils"
|
||||
}
|
||||
},
|
||||
"utils": {
|
||||
"locked": {
|
||||
"lastModified": 1667395993,
|
||||
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
"root": {}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
|
@ -1,10 +1,8 @@
|
||||
{
|
||||
inputs.utils.url = "github:numtide/flake-utils";
|
||||
|
||||
description = "cryptic-net provides the foundation for an autonomous community cloud infrastructure";
|
||||
|
||||
outputs = {
|
||||
self, utils,
|
||||
self,
|
||||
}: let
|
||||
|
||||
supportedSystems = (import ./nix/pkgs.nix).supportedSystems;
|
||||
|
@ -2,39 +2,28 @@
|
||||
|
||||
let
|
||||
|
||||
version = "745";
|
||||
version = "765";
|
||||
|
||||
cpuArch = stdenv.buildPlatform.parsed.cpu.name;
|
||||
|
||||
srcDir = ./go-appimage;
|
||||
|
||||
# https://github.com/probonopd/go-appimage
|
||||
# The author of go-appimage has set up some crazy continuous integration build
|
||||
# system with github, which is really cool, except that it doesn't preserve
|
||||
# any older builds of the project. And it's pretty difficult to build it
|
||||
# ourselves. So fuck it, just embed a tarball into the repo.
|
||||
src = {
|
||||
|
||||
"x86_64" = fetchurl {
|
||||
url = "https://github.com/probonopd/go-appimage/releases/download/continuous/appimagetool-${version}-x86_64.AppImage";
|
||||
sha256 = "sha256-HQ7d9LQDaPm6sGZ5boWZdmGTNqiGN9NWHUWPiDhl2Xc=";
|
||||
};
|
||||
|
||||
"aarch64" = fetchurl {
|
||||
url = "https://github.com/probonopd/go-appimage/releases/download/continuous/appimagetool-${version}-aarch64.AppImage";
|
||||
sha256 = "sha256-VvH2qXULliCiyFrisaIJbM0ApXp++ZAtxHiS6FM3XT0=";
|
||||
};
|
||||
|
||||
"armv7l" = fetchurl {
|
||||
url = "https://github.com/probonopd/go-appimage/releases/download/continuous/appimagetool-${version}-armhf.AppImage";
|
||||
sha256 = "sha256-ytJjN2dLYOSwqCCFZvqnt+wt2wX/lZ1R+nVz5C+Akvo=";
|
||||
};
|
||||
|
||||
"i686" = fetchurl {
|
||||
url = "https://github.com/probonopd/go-appimage/releases/download/continuous/appimagetool-${version}-i686.AppImage";
|
||||
sha256 = "sha256-GLEhn3dcrwdU3mG0lB6H7PQ5JwEIGqWlGrO1IifeQv4=";
|
||||
};
|
||||
|
||||
"x86_64" = "${srcDir}/appimagetool-${version}-x86_64.AppImage";
|
||||
"aarch64" = "${srcDir}/go-appimage/appimagetool-${version}-aarch64.AppImage";
|
||||
"armv7l" = "${srcDir}/go-appimage/appimagetool-${version}-armhf.AppImage";
|
||||
"i686" = "${srcDir}/go-appimage/appimagetool-${version}-i686.AppImage";
|
||||
}."${cpuArch}";
|
||||
|
||||
in stdenv.mkDerivation rec {
|
||||
|
||||
pname = "go-appimage";
|
||||
inherit version src;
|
||||
|
||||
sourceRoot = "squashfs-root";
|
||||
|
||||
unpackPhase = ''
|
||||
|
BIN
nix/go-appimage/appimagetool-765-aarch64.AppImage
Executable file
BIN
nix/go-appimage/appimagetool-765-aarch64.AppImage
Executable file
Binary file not shown.
BIN
nix/go-appimage/appimagetool-765-armhf.AppImage
Executable file
BIN
nix/go-appimage/appimagetool-765-armhf.AppImage
Executable file
Binary file not shown.
BIN
nix/go-appimage/appimagetool-765-i686.AppImage
Executable file
BIN
nix/go-appimage/appimagetool-765-i686.AppImage
Executable file
Binary file not shown.
BIN
nix/go-appimage/appimagetool-765-x86_64.AppImage
Executable file
BIN
nix/go-appimage/appimagetool-765-x86_64.AppImage
Executable file
Binary file not shown.
17
nix/pkgs.nix
17
nix/pkgs.nix
@ -45,9 +45,18 @@ rec {
|
||||
default = {
|
||||
buildSystem,
|
||||
hostSystem ? buildSystem,
|
||||
}: import src {
|
||||
system = buildSystem;
|
||||
crossSystem.config = hostSystem;
|
||||
}: import src ({
|
||||
|
||||
inherit overlays;
|
||||
};
|
||||
system = buildSystem;
|
||||
|
||||
} // (if buildSystem == hostSystem then {} else {
|
||||
|
||||
# The nixpkgs cache doesn't have any packages where cross-compiling has been
|
||||
# enabled, even if the target platform is actually the same as the build
|
||||
# platform (and therefore it's not really cross-compiling). So we only set
|
||||
# up the cross-compiling config if the target platform is different.
|
||||
crossSystem.config = hostSystem;
|
||||
|
||||
}));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user