build(nix): update flake dependencies and fix flake.nix

This commit is contained in:
Yusuf Bera Ertan 2023-12-30 11:15:25 +03:00
parent 5bd089c56d
commit 4055eb15ec
No known key found for this signature in database
2 changed files with 170 additions and 189 deletions

View File

@ -3,71 +3,35 @@
"crane": {
"flake": false,
"locked": {
"lastModified": 1681175776,
"narHash": "sha256-7SsUy9114fryHAZ8p1L6G6YSu7jjz55FddEwa2U8XZc=",
"lastModified": 1699217310,
"narHash": "sha256-xpW3VFUG7yE6UE6Wl0dhqencuENSkV7qpnpe9I8VbPw=",
"owner": "ipetkov",
"repo": "crane",
"rev": "445a3d222947632b5593112bb817850e8a9cf737",
"rev": "d535642bbe6f377077f7c23f0febb78b1463f449",
"type": "github"
},
"original": {
"owner": "ipetkov",
"ref": "v0.12.1",
"ref": "v0.15.0",
"repo": "crane",
"type": "github"
}
},
"dream2nix": {
"inputs": {
"all-cabal-json": [
"nci"
],
"crane": "crane",
"devshell": [
"nci"
],
"drv-parts": "drv-parts",
"flake-compat": "flake-compat",
"flake-parts": [
"nci",
"parts"
],
"flake-utils-pre-commit": [
"nci"
],
"ghc-utils": [
"nci"
],
"gomod2nix": [
"nci"
],
"mach-nix": [
"nci"
],
"nix-pypi-fetcher": [
"nci"
],
"nixpkgs": [
"nci",
"nixpkgs"
],
"nixpkgsV1": "nixpkgsV1",
"poetry2nix": [
"nci"
],
"pre-commit-hooks": [
"nci"
],
"pruned-racket-catalog": [
"nci"
]
"purescript-overlay": "purescript-overlay",
"pyproject-nix": "pyproject-nix"
},
"locked": {
"lastModified": 1686064783,
"narHash": "sha256-qyptOk4vDut2JkRMJ+815eJNqqd8gIfjpz3l4WCCtMY=",
"lastModified": 1702457430,
"narHash": "sha256-8NQiXtYCOiC7XFayy6GPGDudCBrPROry3mfWjpdVj5g=",
"owner": "nix-community",
"repo": "dream2nix",
"rev": "0c064fa9dd025069cc215b0a8b4eb5ea734aceb0",
"rev": "262198033e23e9ee832f0cc8133d38f07598f555",
"type": "github"
},
"original": {
@ -76,54 +40,6 @@
"type": "github"
}
},
"drv-parts": {
"inputs": {
"flake-compat": [
"nci",
"dream2nix",
"flake-compat"
],
"flake-parts": [
"nci",
"dream2nix",
"flake-parts"
],
"nixpkgs": [
"nci",
"dream2nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1680698112,
"narHash": "sha256-FgnobN/DvCjEsc0UAZEAdPLkL4IZi2ZMnu2K2bUaElc=",
"owner": "davhau",
"repo": "drv-parts",
"rev": "e8c2ec1157dc1edb002989669a0dbd935f430201",
"type": "github"
},
"original": {
"owner": "davhau",
"repo": "drv-parts",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"mk-naked-shell": {
"flake": false,
"locked": {
@ -142,20 +58,22 @@
},
"nci": {
"inputs": {
"crane": "crane",
"dream2nix": "dream2nix",
"mk-naked-shell": "mk-naked-shell",
"nixpkgs": [
"nixpkgs"
],
"parts": "parts",
"rust-overlay": "rust-overlay"
"rust-overlay": "rust-overlay",
"treefmt": "treefmt"
},
"locked": {
"lastModified": 1686550289,
"narHash": "sha256-2tmTVciCJJVEMLDdd28BeTUKOYlR9Z47oEUiKl/OXKg=",
"lastModified": 1703916624,
"narHash": "sha256-sauEKoCC7xiLMb1r2d7TBDJYn9b7qRcRnR7kYKUgouA=",
"owner": "yusdacra",
"repo": "nix-cargo-integration",
"rev": "acb9cf3a5e31b791d675515eac4d73df13555061",
"rev": "d5a24e3098dd968491ac58e51b5af5728b2853d5",
"type": "github"
},
"original": {
@ -166,11 +84,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1686412476,
"narHash": "sha256-inl9SVk6o5h75XKC79qrDCAobTD1Jxh6kVYTZKHzewA=",
"lastModified": 1703438236,
"narHash": "sha256-aqVBq1u09yFhL7bj1/xyUeJjzr92fXVvQSSEx6AdB1M=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "21951114383770f96ae528d0ae68824557768e81",
"rev": "5f64a12a728902226210bf01d25ec6cbb9d9265b",
"type": "github"
},
"original": {
@ -183,11 +101,11 @@
"nixpkgs-lib": {
"locked": {
"dir": "lib",
"lastModified": 1685564631,
"narHash": "sha256-8ywr3AkblY4++3lIVxmrWZFzac7+f32ZEhH/A8pNscI=",
"lastModified": 1701253981,
"narHash": "sha256-ztaDIyZ7HrTAfEEUt9AtTDNoCYxUdSd6NrRHaYOIxtk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "4f53efe34b3a8877ac923b9350c874e3dcd5dc0a",
"rev": "e92039b55bcd58469325ded85d4f58dd5a4eaf58",
"type": "github"
},
"original": {
@ -198,21 +116,6 @@
"type": "github"
}
},
"nixpkgsV1": {
"locked": {
"lastModified": 1678500271,
"narHash": "sha256-tRBLElf6f02HJGG0ZR7znMNFv/Uf7b2fFInpTHiHaSE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5eb98948b66de29f899c7fe27ae112a47964baf8",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-22.11",
"type": "indirect"
}
},
"parts": {
"inputs": {
"nixpkgs-lib": [
@ -221,11 +124,11 @@
]
},
"locked": {
"lastModified": 1685662779,
"narHash": "sha256-cKDDciXGpMEjP1n6HlzKinN0H+oLmNpgeCTzYnsA2po=",
"lastModified": 1701473968,
"narHash": "sha256-YcVE5emp1qQ8ieHUnxt1wCZCC3ZfAS+SRRWZ2TMda7E=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "71fb97f0d875fd4de4994dfb849f2c75e17eb6c3",
"rev": "34fed993f1674c8d06d58b37ce1e0fe5eebcb9f5",
"type": "github"
},
"original": {
@ -239,11 +142,11 @@
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1685662779,
"narHash": "sha256-cKDDciXGpMEjP1n6HlzKinN0H+oLmNpgeCTzYnsA2po=",
"lastModified": 1701473968,
"narHash": "sha256-YcVE5emp1qQ8ieHUnxt1wCZCC3ZfAS+SRRWZ2TMda7E=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "71fb97f0d875fd4de4994dfb849f2c75e17eb6c3",
"rev": "34fed993f1674c8d06d58b37ce1e0fe5eebcb9f5",
"type": "github"
},
"original": {
@ -252,6 +155,46 @@
"type": "github"
}
},
"purescript-overlay": {
"inputs": {
"nixpkgs": [
"nci",
"dream2nix",
"nixpkgs"
],
"slimlock": "slimlock"
},
"locked": {
"lastModified": 1696022621,
"narHash": "sha256-eMjFmsj2G1E0Q5XiibUNgFjTiSz0GxIeSSzzVdoN730=",
"owner": "thomashoneyman",
"repo": "purescript-overlay",
"rev": "047c7933abd6da8aa239904422e22d190ce55ead",
"type": "github"
},
"original": {
"owner": "thomashoneyman",
"repo": "purescript-overlay",
"type": "github"
}
},
"pyproject-nix": {
"flake": false,
"locked": {
"lastModified": 1702448246,
"narHash": "sha256-hFg5s/hoJFv7tDpiGvEvXP0UfFvFEDgTdyHIjDVHu1I=",
"owner": "davhau",
"repo": "pyproject.nix",
"rev": "5a06a2697b228c04dd2f35659b4b659ca74f7aeb",
"type": "github"
},
"original": {
"owner": "davhau",
"ref": "dream2nix",
"repo": "pyproject.nix",
"type": "github"
}
},
"root": {
"inputs": {
"nci": "nci",
@ -262,11 +205,11 @@
"rust-overlay": {
"flake": false,
"locked": {
"lastModified": 1686537156,
"narHash": "sha256-mJD80brS6h6P4jzwdKID0S9RvfyiruxgJbXvPPIDqF0=",
"lastModified": 1703902408,
"narHash": "sha256-qXdWvu+tlgNjeoz8yQMRKSom6QyRROfgpmeOhwbujqw=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "e75da5cfc7da874401decaa88f4ccb3b4d64d20d",
"rev": "319f57cd2c34348c55970a4bf2b35afe82088681",
"type": "github"
},
"original": {
@ -274,6 +217,50 @@
"repo": "rust-overlay",
"type": "github"
}
},
"slimlock": {
"inputs": {
"nixpkgs": [
"nci",
"dream2nix",
"purescript-overlay",
"nixpkgs"
]
},
"locked": {
"lastModified": 1688610262,
"narHash": "sha256-Wg0ViDotFWGWqKIQzyYCgayeH8s4U1OZcTiWTQYdAp4=",
"owner": "thomashoneyman",
"repo": "slimlock",
"rev": "b5c6cdcaf636ebbebd0a1f32520929394493f1a6",
"type": "github"
},
"original": {
"owner": "thomashoneyman",
"repo": "slimlock",
"type": "github"
}
},
"treefmt": {
"inputs": {
"nixpkgs": [
"nci",
"nixpkgs"
]
},
"locked": {
"lastModified": 1702979157,
"narHash": "sha256-RnFBbLbpqtn4AoJGXKevQMCGhra4h6G2MPcuTSZZQ+g=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "2961375283668d867e64129c22af532de8e77734",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
}
},
"root": "root",

104
flake.nix
View File

@ -49,6 +49,7 @@
};
in
inp.parts.lib.mkFlake {inputs = inp;} {
debug = true;
imports = [inp.nci.flakeModule];
systems = ["x86_64-linux"];
perSystem = {
@ -86,7 +87,6 @@
pkgs.runCommand
old.name
{
inherit (old) pname version;
meta = old.meta or {};
passthru =
(old.passthru or {})
@ -102,12 +102,13 @@
--set VELOREN_GIT_VERSION "${git.prettyRev}" \
--set VELOREN_GIT_TAG "${git.tag}"
'';
veloren-common-ov = {
veloren-common-env = {
# We don't add in any information here because otherwise anything
# that depends on common will be recompiled. We will set these in
# our wrapper instead.
NIX_GIT_HASH = "";
NIX_GIT_TAG = "";
VELOREN_USERDATA_STRATEGY = "system";
};
voxygenOut = config.nci.outputs."veloren-voxygen";
serverCliOut = config.nci.outputs."veloren-server-cli";
@ -127,59 +128,30 @@
'';
});
nci.projects."veloren".relPath = "";
nci.crates."veloren-server-cli" = let
veloren-server-cli-deps-ov = _: {
doCheck = false;
dontCheck = true;
nci.projects."veloren" = {
export = false;
path = ./.;
};
in {
nci.crates."veloren-server-cli" = {
profiles = {
release.features = ["default-publish"];
release.runTests = false;
dev.features = ["default-publish"];
dev.runTests = false;
};
depsOverrides.fix-build.overrideAttrs = veloren-server-cli-deps-ov;
overrides = {
fix-veloren-common = veloren-common-ov;
add-deps-reqs.overrideAttrs = veloren-server-cli-deps-ov;
fix-build.override = _: {
drvConfig = {
mkDerivation = {
src = filteredSource;
VELOREN_USERDATA_STRATEGY = "system";
};
env = veloren-common-env;
};
};
};
nci.crates."veloren-voxygen" = let
veloren-voxygen-deps-ov = prev: {
buildInputs =
(prev.buildInputs or [])
++ (
with pkgs; [
alsa-lib
libxkbcommon
udev
xorg.libxcb
]
);
nativeBuildInputs =
(prev.nativeBuildInputs or [])
++ (
with pkgs; [
python3
pkg-config
cmake
gnumake
]
);
SHADERC_LIB_DIR = "${pkgs.shaderc.lib}/lib";
VELOREN_ASSETS = "${assets}";
checkPhase = ":";
};
in {
nci.crates."veloren-voxygen" = {
profiles = {
release.features = ["default-publish"];
release.runTests = false;
dev.features = ["default-publish"];
dev.runTests = false;
};
runtimeLibs = with pkgs; [
xorg.libX11
@ -194,19 +166,41 @@
vulkan-loader
stdenv.cc.cc.lib
];
depsOverrides.fix-build.overrideAttrs = veloren-voxygen-deps-ov;
overrides = {
fix-veloren-common = veloren-common-ov;
add-deps-reqs.overrideAttrs = veloren-voxygen-deps-ov;
fix-build.overrideAttrs = prev: {
src = filteredSource;
VELOREN_USERDATA_STRATEGY = "system";
depsDrvConfig = {
env =
veloren-common-env
// {
SHADERC_LIB_DIR = "${pkgs.shaderc.lib}/lib";
VELOREN_ASSETS = "${assets}";
};
mkDerivation = {
buildInputs = with pkgs; [
alsa-lib
libxkbcommon
udev
xorg.libxcb
];
nativeBuildInputs = with pkgs; [
python3
pkg-config
cmake
gnumake
];
};
};
drvConfig = let
depsConf = config.nci.crates."veloren-voxygen".depsDrvConfig;
in {
env =
depsConf.env
// {
dontUseCmakeConfigure = true;
};
mkDerivation =
depsConf.mkDerivation
// {
src = filteredSource;
preConfigure = ''
${prev.preConfigure or ""}
substituteInPlace voxygen/src/audio/soundcache.rs \
--replace \
"../../../assets/voxygen/audio/null.ogg" \