-
-
Notifications
You must be signed in to change notification settings - Fork 19.6k
vortex: init at 2.2.0 #491344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
caniko
wants to merge
2
commits into
NixOS:master
Choose a base branch
from
caniko:nexus-vortex
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+272
−0
Draft
vortex: init at 2.2.0 #491344
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| { | ||
| config, | ||
| lib, | ||
| pkgs, | ||
| ... | ||
| }: | ||
|
|
||
| let | ||
| cfg = config.programs.vortex; | ||
| inherit (lib) mkEnableOption mkPackageOption mkIf; | ||
| in | ||
| { | ||
| options.programs.vortex = { | ||
| enable = mkEnableOption "Vortex mod manager"; | ||
|
|
||
| package = mkPackageOption pkgs "vortex" { }; | ||
|
|
||
| nxmSchemeHandler = lib.mkEnableOption '' | ||
| registration of the nxm:// URL scheme handler for Vortex | ||
| ''; | ||
| }; | ||
|
|
||
| config = mkIf cfg.enable { | ||
| environment.systemPackages = [ cfg.package ]; | ||
|
|
||
| xdg.mime.defaultApplications = mkIf cfg.nxmSchemeHandler { | ||
| "x-scheme-handler/nxm" = "com.nexusmods.vortex.desktop"; | ||
| }; | ||
| }; | ||
|
|
||
| meta.maintainers = with lib.maintainers; [ | ||
| caniko | ||
| MattSturgeon | ||
| ]; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,236 @@ | ||
| { | ||
| lib, | ||
| cacert, | ||
| clang, | ||
| electron_42-bin, | ||
| fetchFromGitHub, | ||
| fetchPnpmDeps, | ||
| fontconfig, | ||
| jq, | ||
| librsvg, | ||
| makeBinaryWrapper, | ||
| node-gyp, | ||
| nodejs, | ||
| pkg-config, | ||
| pnpmBuildHook, | ||
| pnpmConfigHook, | ||
| pnpm_11, | ||
| python3, | ||
| stdenvNoCC, | ||
| }: | ||
| let | ||
| electron = electron_42-bin; | ||
| pnpm = pnpm_11; | ||
| in | ||
|
|
||
| stdenvNoCC.mkDerivation (finalAttrs: { | ||
|
|
||
| __structuredAttrs = true; | ||
| strictDeps = true; | ||
|
|
||
| pname = "vortex"; | ||
| version = "2.2.0"; | ||
|
|
||
| src = fetchFromGitHub { | ||
| owner = "Nexus-Mods"; | ||
| repo = "Vortex"; | ||
| tag = "v${finalAttrs.version}"; | ||
| hash = "sha256-BRzw/ziwIYJ8kaf+EQPCTxo0f8oJXn51pNWnhdfjyLw="; | ||
| }; | ||
|
|
||
| pnpmDeps = fetchPnpmDeps { | ||
| inherit pnpm; | ||
| inherit (finalAttrs) | ||
| pname | ||
| version | ||
| src | ||
| pnpmBuildScript | ||
| pnpmInstallFlags | ||
| ; | ||
| fetcherVersion = 4; | ||
| hash = "sha256-0qTAS/wF/V3vB6E0EjmCQXeemAa8mhtepCEuJKeQivo="; | ||
| }; | ||
|
|
||
| duckdbExtensions = stdenvNoCC.mkDerivation { | ||
| __structuredAttrs = true; | ||
| strictDeps = true; | ||
|
|
||
| pname = finalAttrs.pname + "-duckdb-extensions"; | ||
| inherit (finalAttrs) version src pnpmDeps; | ||
| outputHash = "sha256-LZkR9l1YA3vZVAktwqc6o19uC0d+MYPJxunZNgia+7U="; | ||
| outputHashMode = "recursive"; | ||
|
|
||
| nativeBuildInputs = [ | ||
| cacert | ||
| nodejs | ||
| jq | ||
| pnpm | ||
| pnpmConfigHook | ||
| ]; | ||
|
|
||
| buildPhase = '' | ||
| runHook preBuild | ||
| pnpm tsx src/main/download-duckdb-extensions.ts | ||
| runHook postBuild | ||
| ''; | ||
|
|
||
| installPhase = '' | ||
| runHook preInstall | ||
| dest=$(jq --raw-output .outputDir src/main/duckdb-extensions.json) | ||
| mv "src/main/$dest" "$out" | ||
| runHook postInstall | ||
| ''; | ||
| }; | ||
|
|
||
| env = { | ||
| NX_NATIVE_COMMAND_RUNNER = "false"; | ||
| NODE_PATH = "${node-gyp}/lib/node_modules"; | ||
|
|
||
| ELECTRON_SKIP_BINARY_DOWNLOAD = "1"; | ||
| ELECTRON_OVERRIDE_DIST_PATH = "${electron.dist}"; | ||
| }; | ||
|
|
||
| pnpmBuildScript = "package:nosign"; | ||
| pnpmInstallFlags = [ | ||
| "--ignore-scripts" | ||
| ]; | ||
|
|
||
| nativeBuildInputs = [ | ||
| pnpmConfigHook | ||
| pnpmBuildHook | ||
|
|
||
| clang | ||
| jq | ||
| makeBinaryWrapper | ||
| node-gyp | ||
| nodejs | ||
| pnpm | ||
|
|
||
| pkg-config | ||
| (python3.withPackages (ps: [ ps.setuptools ])) | ||
| ]; | ||
|
|
||
| buildInputs = [ | ||
| fontconfig | ||
| ]; | ||
|
|
||
| runtimeInputs = [ | ||
| nodejs | ||
| ]; | ||
|
|
||
| runtimeEnv = { | ||
| NODE_ENV = "production"; | ||
| GDK_PIXBUF_MODULE_FILE = "${librsvg}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache"; | ||
| CHROME_DEVEL_SANDBOX = "${electron}/libexec/electron/chrome-sandbox"; | ||
| }; | ||
|
|
||
| makeWrapperArgs = [ | ||
| "--inherit-argv0" | ||
| "--prefix" | ||
| "PATH" | ||
| ":" | ||
| (lib.makeBinPath finalAttrs.runtimeInputs) | ||
| ] | ||
| ++ lib.foldlAttrs ( | ||
| acc: name: value: | ||
| acc | ||
| ++ [ | ||
| "--set" | ||
| name | ||
| (if lib.isBool value then lib.optionalString value "1" else value) | ||
| ] | ||
| ) [ ] finalAttrs.runtimeEnv; | ||
|
|
||
| postPatch = '' | ||
| # Add forceLegacyDeploy workaround (pnpm 11 shared lockfile bug) | ||
| # https://github.com/pnpm/pnpm/issues/5315 | ||
| cat pnpm-workspace.yaml > pnpm-workspace.yaml.bak | ||
| echo "forceLegacyDeploy: true" >> pnpm-workspace.yaml | ||
|
|
||
| mkdir -p src/main/build | ||
| duckdbExtensionsDest=$(jq --raw-output .outputDir src/main/duckdb-extensions.json) | ||
| ln -s "$duckdbExtensions" "src/main/$duckdbExtensionsDest" | ||
|
|
||
| substituteInPlace flatpak/com.nexusmods.vortex.desktop \ | ||
| --replace-fail run.sh vortex | ||
|
|
||
| jqInPlace() { | ||
| local file="$1" | ||
| shift | ||
| local tmp=$(mktemp) | ||
| jq "$@" "$file" > "$tmp" && mv -f "$tmp" "$file" | ||
| } | ||
|
|
||
| jqInPlace src/main/electron-builder.config.json \ | ||
| --arg dist ${electron.dist} \ | ||
| --arg version ${electron.version} \ | ||
| '.electronDist = $dist | .electronVersion = $version' | ||
|
|
||
| # Ensure deploy uses legacy algorithm (pnpm 11 shared lockfile bug workaround) | ||
| # https://github.com/pnpm/pnpm/issues/5315 | ||
| substituteInPlace src/main/package.json \ | ||
| --replace-fail \ | ||
| 'deploy ./dist' \ | ||
| 'deploy --offline --frozen-lockfile ./dist' | ||
| ''; | ||
|
|
||
| preBuild = '' | ||
| # Copy metadata from store to HOME cache for offline pnpm deploy. | ||
| storeDir=$(pnpm config get store-dir 2>/dev/null) | ||
| cacheDir=''${HOME:+$HOME/.cache/pnpm} | ||
| if [ -n "$storeDir" ] && [ -d "$storeDir/v11/metadata" ] && [ -n "$cacheDir" ] && [ ! -d "$cacheDir/v11/metadata" ]; then | ||
| mkdir -p "$cacheDir/v11" | ||
| cp -r "$storeDir/v11/metadata" "$cacheDir/v11/" | ||
| fi | ||
| ''; | ||
|
|
||
| buildPhase = '' | ||
| runHook preBuild | ||
|
|
||
| pushd node_modules/.pnpm/font-scanner*/node_modules/font-scanner | ||
| node-gyp rebuild --release | ||
| popd | ||
|
|
||
| pnpmBuildHook | ||
|
|
||
| runHook postBuild | ||
| ''; | ||
|
|
||
| installPhase = '' | ||
| runHook preInstall | ||
|
|
||
| mkdir -p "$out/bin" "$out/lib" | ||
|
|
||
| install -Dm644 flatpak/com.nexusmods.vortex.desktop \ | ||
| "$out/share/applications/com.nexusmods.vortex.desktop" | ||
| install -Dm644 assets/images/vortex.png \ | ||
| "$out/share/icons/hicolor/256x256/apps/com.nexusmods.vortex.png" | ||
|
|
||
| install -d "$out/main" | ||
| cp -a dist/linux*-unpacked/. "$out/main/" | ||
|
|
||
| makeWrapper ${lib.getExe electron} "$out/bin/vortex" \ | ||
| --add-flag "$out/main/vortex" \ | ||
| "''${makeWrapperArgs[@]}" | ||
|
|
||
| runHook postInstall | ||
| ''; | ||
|
|
||
| meta = { | ||
| description = "Open-source mod manager from Nexus Mods"; | ||
| homepage = "https://github.com/Nexus-Mods/Vortex"; | ||
| changelog = "https://github.com/Nexus-Mods/Vortex/releases/tag/${finalAttrs.src.tag}"; | ||
| license = lib.licenses.gpl3Only; | ||
| mainProgram = "vortex"; | ||
| platforms = lib.platforms.linux; | ||
| maintainers = with lib.maintainers; [ | ||
| caniko | ||
| MattSturgeon | ||
| ]; | ||
| problems = [ | ||
| { | ||
| message = "The Linux build of Vortex is pre-alpha software. It lacks wine/proton integration, xdg-portals for file pickers, and several features the Windows version has. Most users should run the Windows version under wine or proton instead."; | ||
| } | ||
| ]; | ||
| }; | ||
| }) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.