diff --git a/flake.lock b/flake.lock index f767ca2f67..43245c58e1 100644 --- a/flake.lock +++ b/flake.lock @@ -90,11 +90,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1662143940, - "narHash": "sha256-3eJfehnZLWJGXylfpAMeLR0Q3sx8pAjGiHBQPqOH9+U=", + "lastModified": 1662158571, + "narHash": "sha256-w+iLHikl1gdbzT9bM5Iu8u9k6/e2LljoTLyTWO0c0nk=", "owner": "yusdacra", "repo": "nix-cargo-integration", - "rev": "e83f2598aecbe1114783ff9bdae0b85939de35a3", + "rev": "013350ad83767cf359882e900de381a624445947", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 885d2aa0da..c567314bd9 100644 --- a/flake.nix +++ b/flake.nix @@ -63,6 +63,30 @@ rustflags = ["-C", "link-arg=-fuse-ld=${lib.getExe pkgs.mold}"] EOF ''; + + pathsToIgnore = [ + "flake.nix" + "flake.lock" + "nix" + "assets" + "README.md" + "CONTRIBUTING.md" + "CHANGELOG.md" + "CODE_OF_CONDUCT.md" + "clippy.toml" + ]; + ignorePaths = path: type: let + split = lib.splitString "/" path; + actual = lib.drop 4 split; + _path = lib.concatStringsSep "/" actual; + in + lib.all (n: ! (lib.hasPrefix n _path)) pathsToIgnore; + filteredSource = builtins.path { + name = "veloren-source"; + path = toString ./.; + # filter out unnecessary paths + filter = ignorePaths; + }; in { veloren-common = oldAttrs: { # Disable `git-lfs` check here since we check it ourselves @@ -81,26 +105,7 @@ ''; }; veloren-voxygen = oldAttrs: { - src = builtins.path { - name = "veloren-source"; - path = toString ./.; - # filter out unnecessary paths - filter = path: type: - lib.all - (n: builtins.baseNameOf path != n) - [ - "flake.nix" - "flake.lock" - "nix" - "assets" - "README.md" - "CONTRIBUTING.md" - "CHANGELOG.md" - "CODE_OF_CONDUCT.md" - "clippy.toml" - "server-cli" - ]; - }; + src = filteredSource; buildInputs = (oldAttrs.buildInputs or []) @@ -142,9 +147,25 @@ fi ''; }; + veloren-server-cli-deps = oldAttrs: { + doCheck = false; + + postConfigure = '' + ${oldAttrs.postConfigure or ""} + ${configMoldLinker} + ''; + }; veloren-server-cli = oldAttrs: { - nativeBuildInputs = (oldAttrs.nativeBuildInputs or []) ++ [pkgs.makeWrapper]; + src = filteredSource; + VELOREN_USERDATA_STRATEGY = "system"; + + nativeBuildInputs = (oldAttrs.nativeBuildInputs or []) ++ [pkgs.makeWrapper]; + + postConfigure = '' + ${oldAttrs.postConfigure or ""} + ${configMoldLinker} + ''; postInstall = '' ${oldAttrs.postInstall or ""} if [ -f $out/bin/veloren-server-cli ]; then