-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor nix flake, based on overriding nixpkgs
Now that umu-launcher is being maintained in nixpkgs, it can be used as a starting point for the nix package here. We just need to override a few things, such as the `src`, and handle any changes that have not yet made it into a release build. The opportunity has been taken to clean up that package-args API: - Renamed `truststore` to `withTruststore` with a warning. - `cbor2` wasn't working, warn when it is used. - Added `withDeltaUpdates` Breaking changes: - The umu-launcher package in the overlay is no longer the unwrapped package (previously in `umu-launcher.nix`). - The derivation attrs for various packages are re-written from scratch, likely breaking users' custom overrides. Non-breaking changes: - The umu & umu-run packages have effectively been renamed umu-launcher. - The flake outputs for all systems supported by the nixpkgs package. - The package version now defaults to the flake's git revision.
- Loading branch information
1 parent
b887d4a
commit 8cb9879
Showing
7 changed files
with
143 additions
and
138 deletions.
There are no files selected for viewing
This file contains 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 was deleted.
Oops, something went wrong.
This file contains 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 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,44 @@ | ||
{ | ||
# Dependencies | ||
lib, | ||
umu-launcher, | ||
umu-launcher-unwrapped, | ||
# Public API | ||
version ? null, | ||
withTruststore ? args.truststore or true, | ||
withDeltaUpdates ? true, | ||
# Freeform args | ||
... | ||
} @ args: let | ||
# Args not handled here; to be passed to the nixpkgs package | ||
# E.g. to support overriding `extraPkgs` or `extraLibraries` | ||
# NOTE: All known args must be removed here | ||
unknownArgs = builtins.removeAttrs args [ | ||
"lib" | ||
"umu-launcher" | ||
"umu-launcher-unwrapped" | ||
"version" | ||
"withTruststore" | ||
"withDeltaUpdates" | ||
"truststore" | ||
"cbor2" | ||
]; | ||
|
||
# Overrides for umu-launcher-unwrapped | ||
overrides = | ||
# Warnings added in https://github.com/Open-Wine-Components/umu-launcher/pull/345 (2025-01-27) | ||
lib.warnIf (args ? truststore) "umu-launcher: the argument `truststore` has been renamed to `withTruststore`." | ||
lib.warnIf (args ? cbor2) "umu-launcher: the argument `cbor2` has never had any effect. The new argument `withDeltaUpdates` should be used instead." | ||
lib.optionalAttrs (args ? version) {inherit version;} | ||
// lib.optionalAttrs (args ? withTruststore || args ? truststore) {inherit withTruststore;} | ||
// lib.optionalAttrs (args ? withDeltaUpdates) {inherit withDeltaUpdates;}; | ||
in | ||
umu-launcher.override ( | ||
unknownArgs | ||
// { | ||
umu-launcher-unwrapped = | ||
if overrides == {} | ||
then umu-launcher-unwrapped | ||
else umu-launcher-unwrapped.override overrides; | ||
} | ||
) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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,52 @@ | ||
{ | ||
# Dependencies | ||
lib, | ||
umu-launcher-unwrapped, | ||
python3Packages, | ||
rustPlatform, | ||
cargo, | ||
zstd, | ||
# Public API | ||
version, | ||
withTruststore ? true, | ||
withDeltaUpdates ? true, | ||
}: | ||
umu-launcher-unwrapped.overridePythonAttrs (prev: { | ||
src = ../../.; | ||
inherit version; | ||
|
||
# The nixpkgs patches (in `prev.patches`) are not needed anymore | ||
# - no-umu-version-json.patch was resolved in: | ||
# https://github.com/Open-Wine-Components/umu-launcher/pull/289 | ||
# - The other is backporting: | ||
# https://github.com/Open-Wine-Components/umu-launcher/pull/343 | ||
patches = [ | ||
# Remove `umu-vendored` from the `all` target | ||
# This causes an error when building vendored dependencies: | ||
# python3 -m pip install urllib3 -t builddir | ||
# => No module named pip | ||
./0-Makefile-no-vendor.patch | ||
]; | ||
|
||
nativeBuildInputs = | ||
(prev.nativeBuildInputs or []) | ||
++ [ | ||
rustPlatform.cargoSetupHook | ||
cargo | ||
]; | ||
|
||
propagatedBuildInputs = | ||
(prev.propagatedBuildInputs or []) | ||
++ lib.optionals withTruststore [ | ||
python3Packages.truststore | ||
] | ||
++ lib.optionals withDeltaUpdates [ | ||
python3Packages.cbor2 | ||
python3Packages.xxhash | ||
zstd | ||
]; | ||
|
||
cargoDeps = rustPlatform.importCargoLock { | ||
lockFile = ../../Cargo.lock; | ||
}; | ||
}) |