chore: make zims separate packages
buildbot/nix-eval Build done.
buildbot/nix-build gitea:greg/nixos#checks.x86_64-linux.hm-exodus Build done.
buildbot/nix-build gitea:greg/nixos#checks.x86_64-linux.hm-icdm-root Build done.
buildbot/nix-build gitea:greg/nixos#checks.x86_64-linux.hm-jeremiah Build done.
buildbot/nix-build gitea:greg/nixos#checks.x86_64-linux.nixos-genesis Build done.
buildbot/nix-build gitea:greg/nixos#checks.x86_64-linux.hm-zeke Build done.
buildbot/nix-build gitea:greg/nixos#checks.x86_64-linux.nixos-linode Build done.
buildbot/nix-build gitea:greg/nixos#checks.aarch64-darwin.hm-gregs-MacBook-Pro-16-inch-Nov-2024 Build done.
buildbot/nix-build gitea:greg/nixos#checks.aarch64-darwin.hm-ivr Build done.
buildbot/nix-build gitea:greg/nixos#checks.x86_64-linux."pkg-zim-wikipedia-wikipedia_ht_all_maxi.zim" Build done.
buildbot/nix-build gitea:greg/nixos#checks.x86_64-linux."pkg-zim-phet-phet_fr_all.zim" Build done.
buildbot/nix-build gitea:greg/nixos#checks.x86_64-linux."pkg-zim-phet-phet_en_all.zim" Build done.
buildbot/nix-build gitea:greg/nixos#checks.x86_64-linux."pkg-zim-wikiversity-wikiversity_fr_all_maxi.zim" Build done.
buildbot/nix-build gitea:greg/nixos#checks.x86_64-linux."pkg-zim-wikibooks-wikibooks_fr_all_maxi.zim" Build done.
buildbot/nix-build gitea:greg/nixos#checks.x86_64-linux."pkg-zim-wiktionary-wiktionary_fr_all_nopic.zim" Build done.
buildbot/nix-build gitea:greg/nixos#checks.x86_64-linux."pkg-zim-wikiversity-wikiversity_en_all_maxi.zim" Build done.
buildbot/nix-build gitea:greg/nixos#checks.x86_64-linux."pkg-zim-wikibooks-wikibooks_en_all_maxi.zim" Build done.
buildbot/nix-build gitea:greg/nixos#checks.x86_64-linux."pkg-zim-wiktionary-wiktionary_en_all_nopic.zim" Build done.
buildbot/nix-build gitea:greg/nixos#checks.x86_64-linux."pkg-zim-gutenberg-gutenberg_fr_all.zim" Build done.
buildbot/nix-build gitea:greg/nixos#checks.x86_64-linux."pkg-zim-wikisource-wikisource_en_all_maxi.zim" Build done.
buildbot/nix-build gitea:greg/nixos#checks.x86_64-linux."pkg-zim-wikisource-wikisource_fr_all_maxi.zim" Build done.
buildbot/nix-build gitea:greg/nixos#checks.x86_64-linux."pkg-zim-wikipedia-wikipedia_fr_all_maxi.zim" Build done.
buildbot/nix-build Build done.
buildbot/nix-build gitea:greg/nixos#checks.x86_64-linux."pkg-zim-wikipedia-wikipedia_en_all_maxi.zim" Build done.

This commit is contained in:
Greg Hellings
2026-05-13 08:06:57 -05:00
parent 985dd927c4
commit f735423d98
10 changed files with 143 additions and 61 deletions
Generated
+16
View File
@@ -428,6 +428,21 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-lib_2": {
"locked": {
"lastModified": 1778379128,
"narHash": "sha256-+yjPmoKsTqe/FQHriXzIfI0ELuEt3+1LXc0BE8nU/Yc=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "e361b0ff94723bc94283566dc2a13a46f07eaf5c",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1769461804, "lastModified": 1769461804,
@@ -561,6 +576,7 @@
"minecraft": "minecraft", "minecraft": "minecraft",
"niks3": "niks3", "niks3": "niks3",
"nix-hardware": "nix-hardware", "nix-hardware": "nix-hardware",
"nixpkgs-lib": "nixpkgs-lib_2",
"nixunstable": "nixunstable", "nixunstable": "nixunstable",
"nixvimunstable": "nixvimunstable", "nixvimunstable": "nixvimunstable",
"nurpkgs": "nurpkgs", "nurpkgs": "nurpkgs",
+4 -2
View File
@@ -26,6 +26,7 @@
minecraft.url = "github:Infinidoge/nix-minecraft"; minecraft.url = "github:Infinidoge/nix-minecraft";
niks3.url = "github:Mic92/niks3"; niks3.url = "github:Mic92/niks3";
nix-hardware.url = "github:nixos/nixos-hardware"; nix-hardware.url = "github:nixos/nixos-hardware";
nixpkgs-lib.url = "github:nix-community/nixpkgs.lib";
nixvimunstable = { nixvimunstable = {
url = "github:nix-community/nixvim/main"; url = "github:nix-community/nixvim/main";
inputs.nixpkgs.follows = "nixunstable"; inputs.nixpkgs.follows = "nixunstable";
@@ -146,16 +147,17 @@
pkgs = imported_packages.${system}; pkgs = imported_packages.${system};
}; };
packages = (import ./pkgs { inherit pkgs; }); packages = (import ./pkgs { inherit pkgs top; });
checks = import ./checks.nix { checks = import ./checks.nix {
inherit system top self'; inherit system top self';
inherit (pkgs) lib; inherit (top.nixpkgs-lib) lib;
}; };
devShells = import ./shells.nix { devShells = import ./shells.nix {
inherit pkgs; inherit pkgs;
inherit (top) colmena; inherit (top) colmena;
inherit (self') packages;
}; };
}; };
}; };
-8
View File
@@ -4,14 +4,6 @@ builds:
- "homeConfigurations.*" - "homeConfigurations.*"
- "nixosConfigurations.*" - "nixosConfigurations.*"
- "packages.*" - "packages.*"
# bitwarden-cli package is broken on aarch64-darwin
- "packages.aarch64-darwin.img-bitwarden"
# kmod-31 is not a thing on Darwin
- "packages.aarch64-darwin.qemu-hook"
- "packages.aarch64-darwin.vfio_shutdown"
- "packages.aarch64-darwin.vfio_startup"
# This one is a bit of a beast and shouldn't take up Garnix time
- "packages.aarch64-darwin.zim"
# These are just images which I will build when # These are just images which I will build when
# I feel like it # I feel like it
- "devShells.*" - "devShells.*"
+1 -2
View File
@@ -31,10 +31,9 @@
efibootmgr efibootmgr
findutils findutils
file file
gcc-tune
git git
gnupatch gnupatch
hms # My own home manager switcher top.self.packages.${pkgs.stdenv.hostPlatform.system}.hms # My own home manager switcher
iperf iperf
killall killall
nano nano
-1
View File
@@ -30,4 +30,3 @@ final: prev:
tpmSupport = true; tpmSupport = true;
}; };
} }
// (import ../pkgs { pkgs = prev; })
+29 -28
View File
@@ -1,36 +1,37 @@
{ {
pkgs, pkgs,
system ? pkgs.stdenv.hostPlatform.system, system ? pkgs.stdenv.hostPlatform.system,
top,
... ...
}: }:
let let
c = pkgs.callPackage; c = pkgs.newScope packages;
packages = if system == "x86_64-linux" then (allSys // x86Linux) else allSys;
allSys = {
#default = iso;
#iso = top.self.nixosConfigurations.iso.config.system.build.isoImage;
#iso-beta = self.nixosConfigurations.iso-beta.config.system.build.isoImage;
aacs = c ./aacs.nix { };
adblock_update = c ./adblock_update.nix { };
brew = c ./homebrew.nix { };
create_ssl = c ./create_ssl.nix { };
gcc-tune = c ./gcc-tune.nix { };
#gen-build = c ./gen-build { };
hms = c ./hms { };
inject-darwin = c ./inject-darwin.nix { };
inject = c ./inject.nix { };
setup-ssh = c ./setup-ssh { };
upgrade-pg-cluster = c ./upgrade-pg-cluster.nix { };
};
x86Linux = {
qemu-hook = c ./qemu-hook.nix { };
vfio_startup = c ./vfio_startup.nix { };
vfio_shutdown = c ./vfio_shutdown.nix { };
}
// (import ./zim {
inherit (top.nixpkgs-lib) lib;
inherit pkgs;
});
in in
{ packages
#default = iso;
#iso = top.self.nixosConfigurations.iso.config.system.build.isoImage;
#iso-beta = self.nixosConfigurations.iso-beta.config.system.build.isoImage;
aacs = c ./aacs.nix { };
adblock_update = c ./adblock_update.nix { };
brew = c ./homebrew.nix { };
create_ssl = c ./create_ssl.nix { };
gcc-tune = c ./gcc-tune.nix { };
#gen-build = c ./gen-build { };
hms = c ./hms { };
inject-darwin = c ./inject-darwin.nix { };
inject = c ./inject.nix { };
setup-ssh = c ./setup-ssh { };
upgrade-pg-cluster = c ./upgrade-pg-cluster.nix { };
}
// (
if system == "x86_64-linux" then
{
qemu-hook = c ./qemu-hook.nix { };
vfio_startup = c ./vfio_startup.nix { };
vfio_shutdown = c ./vfio_shutdown.nix { };
zim = c ./zim.nix { };
}
else
{ }
)
+33 -17
View File
@@ -1,71 +1,87 @@
{ {
"en": { "en": {
"gutenberg": { "gutenberg": {
"name": "gutenberg_en_all_2023-08.zim", "name": "gutenberg_en_all",
"version": "2023-08",
"hash": "sha256-wWi0vTyMD/Es0w/jk9uyg4DN94080thPfT5uphEqbUc=" "hash": "sha256-wWi0vTyMD/Es0w/jk9uyg4DN94080thPfT5uphEqbUc="
}, },
"phet": { "phet": {
"name": "phet_en_all_2025-03.zim", "name": "phet_en_all",
"version": "2025-03",
"hash": "sha256-HT/gVNydkOitny6oUl2A+JvbFDGAIeb0h+xbMeQ2Rqs=" "hash": "sha256-HT/gVNydkOitny6oUl2A+JvbFDGAIeb0h+xbMeQ2Rqs="
}, },
"wikibooks": { "wikibooks": {
"name": "wikibooks_en_all_maxi_2025-10.zim", "name": "wikibooks_en_all_maxi",
"version": "2025-10",
"hash": "sha256-zmcvrvGO+LEHt7x8/SoguBDODUyRXy9x5LUGAkS+fF8=" "hash": "sha256-zmcvrvGO+LEHt7x8/SoguBDODUyRXy9x5LUGAkS+fF8="
}, },
"wikipedia": { "wikipedia": {
"name": "wikipedia_en_all_maxi_2025-08.zim", "name": "wikipedia_en_all_maxi",
"version": "2025-08",
"hash": "sha256-r7Cd0vjEb84Ftw+EwZSlqb8qhqm8WA3LAPdHAav7wrg=" "hash": "sha256-r7Cd0vjEb84Ftw+EwZSlqb8qhqm8WA3LAPdHAav7wrg="
}, },
"wikisource": { "wikisource": {
"name": "wikisource_en_all_maxi_2025-11.zim", "name": "wikisource_en_all_maxi",
"version": "2025-11",
"hash": "sha256-jPHh/C20PARN6K7aPNw3k9fFHhpwzsREi/1o1DIISS4=" "hash": "sha256-jPHh/C20PARN6K7aPNw3k9fFHhpwzsREi/1o1DIISS4="
}, },
"wikiversity": { "wikiversity": {
"name": "wikiversity_en_all_maxi_2025-11.zim", "name": "wikiversity_en_all_maxi",
"version": "2025-11",
"hash": "sha256-0DaE2EUdHvaX3XqD3f0lwurSAaDZ4hEKtrMEutL5xt0=" "hash": "sha256-0DaE2EUdHvaX3XqD3f0lwurSAaDZ4hEKtrMEutL5xt0="
}, },
"wiktionary": { "wiktionary": {
"name": "wiktionary_en_all_nopic_2025-09.zim", "name": "wiktionary_en_all_nopic",
"version": "2025-09",
"hash": "sha256-EzrrruJQWY/3pP93WCTeCCfaPvpshqdkR0TFxVz7bEI=" "hash": "sha256-EzrrruJQWY/3pP93WCTeCCfaPvpshqdkR0TFxVz7bEI="
} }
}, },
"fr": { "fr": {
"gutenberg": { "gutenberg": {
"name": "gutenberg_fr_all_2025-10.zim", "name": "gutenberg_fr_all",
"version": "2025-10",
"hash": "sha256-1gU7v//LYX/2LyIRjO02A1fWPQz9Y7Qt5ftgeazd3G8=" "hash": "sha256-1gU7v//LYX/2LyIRjO02A1fWPQz9Y7Qt5ftgeazd3G8="
}, },
"phet": { "phet": {
"name": "phet_fr_all_2025-03.zim", "name": "phet_fr_all",
"version": "2025-03",
"hash": "sha256-K56i55WPu5EMQHIrnnqhgJ32WozZ6oYD9X3IBytGA0A=" "hash": "sha256-K56i55WPu5EMQHIrnnqhgJ32WozZ6oYD9X3IBytGA0A="
}, },
"wikibooks": { "wikibooks": {
"name": "wikibooks_fr_all_maxi_2025-09.zim", "name": "wikibooks_fr_all_maxi",
"version": "2025-09",
"hash": "sha256-PQSdPbBHwK3IfFPH5GsKaxkNGTlZVJNJEI8gNioBl1U=" "hash": "sha256-PQSdPbBHwK3IfFPH5GsKaxkNGTlZVJNJEI8gNioBl1U="
}, },
"wikipedia": { "wikipedia": {
"name": "wikipedia_fr_all_maxi_2025-06.zim", "name": "wikipedia_fr_all_maxi",
"version": "2025-06",
"hash": "sha256-zzDhITMd1nRMYTUlvn56l4VBnpFuhiNrhhYMcrrBuOQ=" "hash": "sha256-zzDhITMd1nRMYTUlvn56l4VBnpFuhiNrhhYMcrrBuOQ="
}, },
"wikisource": { "wikisource": {
"name": "wikisource_fr_all_maxi_2025-09.zim", "name": "wikisource_fr_all_maxi",
"version": "2025-09",
"hash": "sha256-2gEY5nTBecrmg61VJerxO4/oV7dZJmRgzLkqrcocW/0=" "hash": "sha256-2gEY5nTBecrmg61VJerxO4/oV7dZJmRgzLkqrcocW/0="
}, },
"wikiversity": { "wikiversity": {
"name": "wikiversity_fr_all_maxi_2025-09.zim", "name": "wikiversity_fr_all_maxi",
"version": "2025-09",
"hash": "sha256-4vOxYiX3TYht7ARY+PeCJ0ArVZZn9TeGtwCieqn3xUw=" "hash": "sha256-4vOxYiX3TYht7ARY+PeCJ0ArVZZn9TeGtwCieqn3xUw="
}, },
"wiktionary": { "wiktionary": {
"name": "wiktionary_fr_all_nopic_2025-11.zim", "name": "wiktionary_fr_all_nopic",
"version": "2025-11",
"hash": "sha256-oQS8DzKioceCER1p1oAvaS1gRooMLJLYnCqy1aLARi4=" "hash": "sha256-oQS8DzKioceCER1p1oAvaS1gRooMLJLYnCqy1aLARi4="
} }
}, },
"ht": { "ht": {
"phet": { "phet": {
"name": "phet_ht_all_2025-03.zim", "name": "phet_ht_all",
"hash": "sha256-UjC0REJ5d5wIKccutZADX74IxvZuF+CD/caVzZfHg9s=" "version": "2025-03",
"hash": "sha256-bHrPzE8H7ptrP6r5wPlXSsXNlTiKxJ9KatABC4kwx+s="
}, },
"wikipedia": { "wikipedia": {
"name": "wikipedia_ht_all_maxi_2025-09.zim", "name": "wikipedia_ht_all_maxi",
"version": "2025-09",
"hash": "sha256-spT7EFXLnI0FWT9Vlvp7QEP0urntmQ2C+fQB5bVLoLE=" "hash": "sha256-spT7EFXLnI0FWT9Vlvp7QEP0urntmQ2C+fQB5bVLoLE="
} }
} }
+24
View File
@@ -0,0 +1,24 @@
{ pkgs, lib, ... }:
let
zimMetadata = builtins.fromJSON (builtins.readFile ./blobs.json);
oneZim =
sourceType: info:
pkgs.callPackage ./one_zim.nix {
inherit sourceType;
sourceName = info.name;
sourceHash = info.hash;
sourceVersion = info.version;
};
# Preserves structure in the blobs.json file, turning leaves into drvs
zimFileDrvs = builtins.mapAttrs (
_language: types: (builtins.mapAttrs (sourceType: info: oneZim sourceType info) types)
) zimMetadata;
# Flattens leaf drvs into the structure that flake packages expects
zimFilePkgs = builtins.listToAttrs (
lib.mapAttrsToListRecursiveCond (_path: x: !(x ? "name")) (_path: drv: {
inherit (drv) name;
value = drv;
}) zimFileDrvs
);
in
zimFilePkgs
+32
View File
@@ -0,0 +1,32 @@
{
sourceType,
sourceName,
sourceVersion,
sourceHash,
fetchurl,
stdenvNoCC,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
name = "zim-${sourceType}-${sourceName}.zim";
version = sourceVersion;
src = (
fetchurl {
url = "https://download.kiwix.org/zim/${sourceType}/${sourceName}_${sourceVersion}.zim";
hash = sourceHash;
}
# fetchtorrent {
# inherit (val) hash;
# url = "https://download.kiwix.org/zim/${type}/${val.name}.torrent";
# backend = "transmission";
# postUnpack = "mkdir -p $downloadedDirectory/tmp; mv $downloadedDirectory/*.zim $downloadedDirectory/tmp";
# }
);
phases = [ "installPhase" ];
installPhase = ''
set -x
ln -s ${finalAttrs.src} $out
'';
})
+4 -3
View File
@@ -1,6 +1,7 @@
{ {
pkgs,
colmena, colmena,
packages,
pkgs,
... ...
}: }:
let let
@@ -16,8 +17,8 @@ in
git git
gnutar gnutar
gzip gzip
inject packages.inject
inject-darwin packages.inject-darwin
nano nano
]; ];
}; };