Compare commits
No commits in common. "a1b3ff71b33fe2e0ae81c4e03f1f716dbc44c3b0" and "3a3bd5629590f22f1f835e32ad9b0133a9a4435e" have entirely different histories.
a1b3ff71b3
...
3a3bd56295
4
AppDir/AppRun
Executable file
4
AppDir/AppRun
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
export PATH=$APPDIR/bin
|
||||
exec entrypoint "$@"
|
33
default.nix
33
default.nix
@ -91,32 +91,19 @@ in rec {
|
||||
'';
|
||||
};
|
||||
|
||||
appDir = pkgs.stdenv.mkDerivation {
|
||||
appDir = pkgs.buildEnv {
|
||||
name = "cryptic-net-AppDir";
|
||||
paths = [
|
||||
|
||||
src = pkgs.buildEnv {
|
||||
name = "cryptic-net-AppDir-base";
|
||||
paths = [
|
||||
./AppDir
|
||||
version
|
||||
dnsmasq
|
||||
nebula
|
||||
garage
|
||||
pkgs.minio-client
|
||||
entrypoint
|
||||
|
||||
./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
|
||||
'';
|
||||
] ++ (if bootstrap != null then [ rootedBootstrap ] else []);
|
||||
};
|
||||
|
||||
appimagetool = pkgs.callPackage ./nix/appimagetool.nix {};
|
||||
|
@ -45,7 +45,7 @@ func dnsmasqPmuxProcConfig(
|
||||
|
||||
return pmuxlib.ProcessConfig{
|
||||
Name: "dnsmasq",
|
||||
Cmd: binPath("dnsmasq"),
|
||||
Cmd: "dnsmasq",
|
||||
Args: []string{"-d", "-C", confPath},
|
||||
}, nil
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ var subCmdGarageMC = subCmd{
|
||||
args = args[i:]
|
||||
}
|
||||
|
||||
args = append([]string{binPath("mc")}, args...)
|
||||
args = append([]string{"mc"}, args...)
|
||||
|
||||
var (
|
||||
mcHostVar = fmt.Sprintf(
|
||||
@ -92,7 +92,7 @@ var subCmdGarageCLI = subCmd{
|
||||
}
|
||||
|
||||
var (
|
||||
binPath = binPath("garage")
|
||||
binPath = filepath.Join(envAppDirPath, "bin/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: binPath("garage"),
|
||||
Cmd: "garage",
|
||||
Args: []string{"-c", childConfigPath, "server"},
|
||||
StartAfterFunc: func(ctx context.Context) error {
|
||||
return waitForNebula(ctx, hostBootstrap)
|
||||
|
@ -31,10 +31,6 @@ 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: binPath("nebula"),
|
||||
Cmd: "nebula",
|
||||
Args: []string{"-config", nebulaYmlPath},
|
||||
}, nil
|
||||
}
|
||||
|
21
flake.lock
21
flake.lock
@ -1,6 +1,25 @@
|
||||
{
|
||||
"nodes": {
|
||||
"root": {}
|
||||
"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",
|
||||
"version": 7
|
||||
|
@ -1,8 +1,10 @@
|
||||
{
|
||||
inputs.utils.url = "github:numtide/flake-utils";
|
||||
|
||||
description = "cryptic-net provides the foundation for an autonomous community cloud infrastructure";
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
self, utils,
|
||||
}: let
|
||||
|
||||
supportedSystems = (import ./nix/pkgs.nix).supportedSystems;
|
||||
|
@ -2,28 +2,39 @@
|
||||
|
||||
let
|
||||
|
||||
version = "765";
|
||||
version = "745";
|
||||
|
||||
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" = "${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";
|
||||
|
||||
"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=";
|
||||
};
|
||||
|
||||
}."${cpuArch}";
|
||||
|
||||
in stdenv.mkDerivation rec {
|
||||
|
||||
pname = "go-appimage";
|
||||
inherit version src;
|
||||
|
||||
sourceRoot = "squashfs-root";
|
||||
|
||||
unpackPhase = ''
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
15
nix/pkgs.nix
15
nix/pkgs.nix
@ -45,18 +45,9 @@ rec {
|
||||
default = {
|
||||
buildSystem,
|
||||
hostSystem ? buildSystem,
|
||||
}: import src ({
|
||||
|
||||
inherit overlays;
|
||||
}: import src {
|
||||
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;
|
||||
|
||||
}));
|
||||
inherit overlays;
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user