2023-01-25 17:50:36 +00:00
|
|
|
{
|
|
|
|
|
2023-01-29 14:31:11 +00:00
|
|
|
inputs.pkgsSrc.url = "nixpkgs/nixos-22.11";
|
2023-01-25 17:50:36 +00:00
|
|
|
|
|
|
|
inputs.utils.url = "github:numtide/flake-utils";
|
|
|
|
|
|
|
|
# v0.8.1
|
|
|
|
inputs.garage.url = "git+https://git.deuxfleurs.fr/Deuxfleurs/garage.git?ref=main&rev=76230f20282e73a5a5afa33af68152acaf732cf5";
|
|
|
|
|
2023-01-29 17:57:55 +00:00
|
|
|
description = "cryptic-net provides the foundation for an autonomous community cloud infrastructure";
|
2023-01-25 17:50:36 +00:00
|
|
|
|
|
|
|
outputs = {
|
|
|
|
|
|
|
|
self, pkgsSrc, utils, garage,
|
|
|
|
|
|
|
|
}: let
|
|
|
|
|
|
|
|
supportedSystems = [
|
|
|
|
"x86_64-linux"
|
2023-01-29 14:31:11 +00:00
|
|
|
"aarch64-linux"
|
|
|
|
"armv7l-linux" # rpi, I think?
|
|
|
|
"i686-linux"
|
2023-01-25 17:50:36 +00:00
|
|
|
];
|
|
|
|
|
2023-01-29 17:57:55 +00:00
|
|
|
mkPkg = (buildSystem: hostSystem: let
|
|
|
|
|
|
|
|
pkgs = import pkgsSrc {
|
|
|
|
system = buildSystem;
|
|
|
|
|
|
|
|
crossSystem = {
|
|
|
|
config = hostSystem;
|
|
|
|
};
|
|
|
|
|
|
|
|
overlays = [
|
|
|
|
(import ./nix/overlays/go.nix)
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
defaultAttrs = (import ./default.nix) {
|
|
|
|
inherit pkgs;
|
|
|
|
hostSystem = hostSystem;
|
|
|
|
garage = garage.packages."${hostSystem}".default;
|
|
|
|
selfRev = if self ? rev then self.rev else "UNKNOWN";
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
2023-01-29 18:08:16 +00:00
|
|
|
defaultAttrs.appImage
|
2023-01-29 17:57:55 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
# TODO Once everything else is prepared for cross compilation this can be
|
|
|
|
# re-enabled. Things left to do:
|
|
|
|
#
|
|
|
|
# - Revert to not using flake for garage, we'll need to compile it
|
|
|
|
# ourselves because flakes don't actually support cross-compilation in a
|
|
|
|
# nice way.
|
|
|
|
#
|
|
|
|
# - Set ARCH arg for appimagetool target in default.nix
|
|
|
|
#
|
|
|
|
# - Test builds in QEMU or something.
|
|
|
|
#
|
|
|
|
# - Probably other things which will come up
|
|
|
|
#pkgsForBuildSystem = (buildSystem: builtins.foldl'
|
|
|
|
# (sysPkgs: hostSystem:
|
|
|
|
# sysPkgs // { "compiled-for-${hostSystem}" = mkPkg buildSystem hostSystem; })
|
|
|
|
# { default = mkPkg buildSystem buildSystem; }
|
|
|
|
# supportedSystems
|
|
|
|
#);
|
|
|
|
|
|
|
|
pkgsForBuildSystem = (buildSystem:
|
|
|
|
{ default = mkPkg buildSystem buildSystem; });
|
2023-01-25 17:50:36 +00:00
|
|
|
|
|
|
|
in {
|
|
|
|
|
2023-01-29 17:57:55 +00:00
|
|
|
packages = (builtins.foldl'
|
|
|
|
(pkgs: buildSystem:
|
|
|
|
pkgs // { "${buildSystem}" = pkgsForBuildSystem buildSystem; })
|
|
|
|
{}
|
|
|
|
supportedSystems
|
|
|
|
);
|
2023-01-25 17:50:36 +00:00
|
|
|
|
2023-01-29 17:57:55 +00:00
|
|
|
};
|
2023-01-25 17:50:36 +00:00
|
|
|
}
|