Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,17 @@ let
}:
lib.recursiveUpdate acc {
# Save our sources for each port
sources.${port} = catppuccinPackages.fetchCatppuccinPort { inherit port rev hash; };
sources.${port} = catppuccinPackages.fetchCatppuccinPort {
inherit
port
rev
hash
lastModified
;
};

# And create a default package for them
"${port}" = catppuccinPackages.buildCatppuccinPort { inherit port lastModified; };
"${port}" = catppuccinPackages.buildCatppuccinPort { inherit port; };
}
) { } (lib.importJSON ./pkgs/sources.json);

Expand Down
6 changes: 4 additions & 2 deletions pkgs/buildCatppuccinPort/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ lib.extendMkDerivation {

extendDrvArgs =
finalAttrs: args:
let
lastModified = args.lastModified or finalAttrs.src.lastModified or null;
in
args
// {
pname = args.pname or "catppuccin-${finalAttrs.port}";
version =
args.version
or ("0" + lib.optionalString (finalAttrs ? "lastModified") "-unstable-${finalAttrs.lastModified}");
args.version or ("0" + lib.optionalString (lastModified != null) "-unstable-${lastModified}");

src =
args.src or sources.${finalAttrs.port} or (fetchCatppuccinPort {
Expand Down
14 changes: 10 additions & 4 deletions pkgs/fetchCatppuccinPort/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,25 @@ lib.makeOverridable (
port,
rev,
hash,
lastModified ? null,
...
}@args:

let
arguments = [ "port" ];
arguments = [
"port"
"lastModified"
];
in

fetchFromGitHub (
{
lib.recursiveUpdate {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will probably hurt eval time but NixOS/nixpkgs#459651 this will make things more sane some day

owner = "catppuccin";
repo = port;
inherit rev hash;
}
// lib.removeAttrs args arguments
passthru = lib.optionalAttrs (lastModified != null) {
lastModified = lastModified;
};
} (lib.removeAttrs args arguments)
)
)