This commit is contained in:
shelvacu 2025-09-30 23:15:01 +00:00 committed by GitHub
commit 4ac808ac47
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -17,17 +17,12 @@
// flake-utils.lib.eachDefaultSystem ( // flake-utils.lib.eachDefaultSystem (
system: system:
let let
pkgs = import nixpkgs { lib = import "${nixpkgs}/lib";
inherit system; inherit (self) lastModifiedDate;
config = { year = lib.toIntBase10 (builtins.substring 0 4 lastModifiedDate);
allowAliases = false; month = lib.toIntBase10 (builtins.substring 4 2 lastModifiedDate);
}; day = lib.toIntBase10 (builtins.substring 6 2 lastModifiedDate);
overlays = [ self.overlays.default ]; fullAttrs = {
};
in
{
# check that copyparty builds with all optionals turned on
checks.copyparty-full = self.packages.${system}.copyparty.override {
withHashedPasswords = true; withHashedPasswords = true;
withCertgen = true; withCertgen = true;
withThumbnails = true; withThumbnails = true;
@ -38,10 +33,45 @@
withFTPS = true; withFTPS = true;
withSMB = true; withSMB = true;
}; };
pkgs = import nixpkgs {
inherit system;
config = {
allowAliases = false;
};
overlays = [ self.overlays.default ] ++ lib.singleton (final: prev: {
# This is here in flake.nix rather than common/packages/nix because it needs to access the flake metadata to get the date of the most recent commit (lastModifiedDate)
copyparty-unstable = final.copyparty.overrideAttrs (finalAttrs: previousAttrs: {
version = "${previousAttrs.version}-unstable-${self.lastModifiedDate}";
src = self;
postPatch = ''
old_src="$(mktemp -d)"
tar -C "$old_src" -xvf ${previousAttrs.src}
cp -r "$old_src"/*/copyparty/web/deps/* copyparty/web/deps
sed -i 's/^BUILD_DT =.*$/BUILD_DT = (${toString year}, ${toString month}, ${toString day})/' copyparty/__version__.py
sed -i 's/^CODENAME =.*$/CODENAME = "unstable"/' copyparty/__version__.py
'';
});
copyparty-full = final.copyparty.overrideAttrs fullAttrs;
copyparty-unstable-full = final.copyparty-unstable.overrideAttrs fullAttrs;
});
};
in
{
# check that copyparty builds with all optionals turned on
checks = {
inherit (pkgs)
copyparty-full
copyparty-unstable-full
;
};
packages = { packages = {
inherit (pkgs) inherit (pkgs)
copyparty copyparty
copyparty-full
copyparty-unstable
copyparty-unstable-full
; ;
default = self.packages.${system}.copyparty; default = self.packages.${system}.copyparty;
}; };