nix: fix build failing when on tag, combine nixpkgs.nix and common.nix

This commit is contained in:
Yusuf Bera Ertan 2020-11-28 17:45:58 +03:00
parent bce6e1c6e9
commit 3c7f0e4375
No known key found for this signature in database
GPG Key ID: 1D8F8FAF2294D6EA
4 changed files with 29 additions and 30 deletions

View File

@ -1,5 +1,24 @@
{ pkgs }:
with pkgs;
{ system, sources ? import ./sources.nix { inherit system; }
, nixpkgs ? sources.nixpkgs }:
let
mozPkgs = import "${sources.nixpkgsMoz}/package-set.nix" {
pkgs = import nixpkgs { inherit system; };
};
rustChannel = mozPkgs.rustChannelOf {
rustToolchain = ../rust-toolchain;
hash = "sha256-P4FTKRe0nM1FRDV0Q+QY2WcC8M9IR7aPMMLWDfv+rEk=";
};
pkgs = import nixpkgs {
inherit system;
overlays = [
(self: super: {
rustc = rustChannel.rust;
inherit (rustChannel)
;
})
];
};
in with pkgs;
let
xorgLibraries = with xorg; [ libX11 libXcursor libXrandr libXi ];
otherLibraries = [
@ -19,4 +38,4 @@ let
veloren-network = [ pkg-config openssl ];
veloren-voxygen = [ atk cairo glib gtk3 pango ];
};
in { inherit neededLibPaths crateDeps; }
in { inherit pkgs neededLibPaths crateDeps; }

View File

@ -12,8 +12,8 @@ let
isBuildingVoxygen = isBuildingCrate "veloren-voxygen";
isBuildingServerCli = isBuildingCrate "veloren-server-cli";
pkgs = import ./nixpkgs.nix { inherit sources system; };
common = import ./common.nix { inherit pkgs; };
common = import ./common.nix { inherit sources system; };
inherit (common) pkgs;
meta = with pkgs; {
description = "Veloren is a multiplayer voxel RPG written in Rust.";
@ -42,7 +42,7 @@ let
name = "git";
}
}
${pkgs.git}/bin/git ${subcommands} > $out
(${pkgs.git}/bin/git ${subcommands}) > $out
'')
else
abort ''

View File

@ -1,21 +0,0 @@
{ system, sources ? import ./sources.nix { inherit system; }
, nixpkgs ? sources.nixpkgs }:
let
mozPkgs = import "${sources.nixpkgsMoz}/package-set.nix" {
pkgs = import nixpkgs { inherit system; };
};
rustChannel = mozPkgs.rustChannelOf {
rustToolchain = ../rust-toolchain;
hash = "sha256-P4FTKRe0nM1FRDV0Q+QY2WcC8M9IR7aPMMLWDfv+rEk=";
};
in import nixpkgs {
inherit system;
overlays = [
(self: super: {
rustc = rustChannel.rust;
inherit (rustChannel)
;
})
];
}

View File

@ -1,13 +1,14 @@
{ nixpkgs ? <nixpkgs>, sources ? import ./sources.nix { }
, system ? builtins.currentSystem }:
let
pkgs = import ./nixpkgs.nix { inherit sources nixpkgs system; };
common = import ./common.nix { inherit pkgs; };
common = import ./common.nix { inherit nixpkgs sources system; };
inherit (common) pkgs;
crate2nix = pkgs.callPackage sources.crate2nix { inherit pkgs; };
in with pkgs;
mkShell {
name = "veloren-shell";
nativeBuildInputs = [ git git-lfs niv nixfmt crate2nix cargo rustc ];
nativeBuildInputs =
[ git git-lfs niv nixfmt crate2nix cargo rustc rustfmt clippy ];
buildInputs = lib.concatLists (lib.attrValues common.crateDeps);
shellHook = ''
export LD_LIBRARY_PATH=${common.neededLibPaths}