2020-12-11 12:00:04 +00:00
|
|
|
{
|
|
|
|
description = "Flake providing Veloren, a multiplayer voxel RPG written in Rust.";
|
|
|
|
|
|
|
|
inputs = {
|
2021-03-23 13:02:47 +00:00
|
|
|
naersk = {
|
|
|
|
url = "github:yusdacra/naersk/veloren";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
2020-12-11 12:00:04 +00:00
|
|
|
};
|
2021-03-23 13:02:47 +00:00
|
|
|
flakeUtils.url = "github:numtide/flake-utils";
|
|
|
|
rustOverlay = {
|
|
|
|
url = "github:oxalica/rust-overlay";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
2020-12-11 12:00:04 +00:00
|
|
|
};
|
2021-03-23 13:02:47 +00:00
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
2020-12-11 12:00:04 +00:00
|
|
|
};
|
|
|
|
|
2021-03-23 13:02:47 +00:00
|
|
|
outputs = inputs: with inputs; with flakeUtils.lib;
|
|
|
|
eachSystem [ "x86_64-linux" ] (system:
|
2020-12-11 12:00:04 +00:00
|
|
|
let
|
2021-03-23 13:02:47 +00:00
|
|
|
common = import ./nix/common.nix {
|
|
|
|
sources = {
|
|
|
|
inherit
|
|
|
|
naersk
|
|
|
|
nixpkgs
|
|
|
|
rustOverlay
|
|
|
|
;
|
|
|
|
};
|
|
|
|
inherit system;
|
2020-12-11 12:00:04 +00:00
|
|
|
};
|
|
|
|
|
2021-03-23 13:02:47 +00:00
|
|
|
mkPackage = crateName: import ./nix/build.nix {
|
|
|
|
inherit common;
|
|
|
|
crateToBuild = crateName;
|
2020-12-11 12:00:04 +00:00
|
|
|
sourceInfo =
|
2021-03-23 13:02:47 +00:00
|
|
|
if self.sourceInfo ? rev
|
|
|
|
then self.sourceInfo // {
|
2020-12-11 12:00:04 +00:00
|
|
|
# Tag would have to be set manually for stable releases flake
|
|
|
|
# because there's currently no way to get the tag via the interface.
|
|
|
|
# tag = v0.8.0;
|
2021-03-23 13:02:47 +00:00
|
|
|
}
|
|
|
|
else (throw "Can't get revision because the git tree is dirty");
|
2020-12-11 12:00:04 +00:00
|
|
|
};
|
|
|
|
|
2021-03-23 13:02:47 +00:00
|
|
|
cratesToPackage = [ "veloren-voxygen" "veloren-server-cli" ];
|
2020-12-11 12:00:04 +00:00
|
|
|
|
2021-03-23 13:02:47 +00:00
|
|
|
genAttrs = names: f:
|
|
|
|
builtins.listToAttrs (map (n: { name = n; value = f n; }) names);
|
|
|
|
in
|
|
|
|
rec {
|
|
|
|
packages = genAttrs cratesToPackage mkPackage;
|
2020-12-11 12:00:04 +00:00
|
|
|
defaultPackage = packages.veloren-voxygen;
|
|
|
|
|
2021-03-23 13:02:47 +00:00
|
|
|
apps = builtins.mapAttrs (n: v: mkApp { name = n; drv = v; }) packages;
|
|
|
|
defaultApp = apps.veloren-voxygen;
|
|
|
|
|
2020-12-11 12:00:04 +00:00
|
|
|
devShell = import ./nix/devShell.nix {
|
2021-03-23 13:02:47 +00:00
|
|
|
inherit common;
|
2020-12-11 12:00:04 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|