nix-matrix-pkgs/flake.nix
Abel Luck 5e3f3f0a9d
Some checks failed
buildbot/nix-eval Build done.
buildbot/nix-build gitea:ops/nix-matrix-pkgs#checks.x86_64-linux."matrix-synapse@1.143.0" Build done.
buildbot/nix-build gitea:ops/nix-matrix-pkgs#checks.x86_64-linux."matrix-synapse@1.144.0" Build done.
buildbot/nix-build gitea:ops/nix-matrix-pkgs#checks.x86_64-linux."matrix-synapse@1.145.0" Build done.
buildbot/nix-build gitea:ops/nix-matrix-pkgs#checks.x86_64-linux."matrix-synapse@1.146.0" Build done.
buildbot/nix-build gitea:ops/nix-matrix-pkgs#checks.x86_64-linux."matrix-synapse@1.147.1" Build done.
buildbot/nix-build gitea:ops/nix-matrix-pkgs#checks.x86_64-linux."matrix-synapse@1.129.0" Build done.
buildbot/nix-build Build done.
trigger build
2026-02-25 17:18:43 +01:00

72 lines
1.9 KiB
Nix

{
description = "Pinned matrix package versions";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
outputs =
{ self, nixpkgs, ... }:
let
forAllSystems = nixpkgs.lib.genAttrs [
"x86_64-linux"
];
# Discover child flake directories automatically
childFlakeDirs =
let
entries = builtins.readDir ./.;
in
builtins.filter (
name: entries.${name} == "directory" && builtins.pathExists (./. + "/${name}/flake.nix")
) (builtins.attrNames entries);
in
{
packages = forAllSystems (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
update = pkgs.writeShellApplication {
name = "update-pins";
runtimeInputs = [
pkgs.git
pkgs.nix
pkgs.jq
pkgs.coreutils
];
text = builtins.readFile ./update.sh;
};
}
);
apps = forAllSystems (system: {
update = {
type = "app";
program = "${self.packages.${system}.update}/bin/update-pins";
};
});
checks = forAllSystems (
system:
builtins.listToAttrs (
map (
name:
let
lock = builtins.fromJSON (builtins.readFile (./. + "/${name}/flake.lock"));
nixpkgsNode = lock.nodes.${lock.nodes.root.inputs.nixpkgs};
nixpkgsSrc = builtins.fetchTarball {
url = "https://github.com/${nixpkgsNode.locked.owner}/${nixpkgsNode.locked.repo}/archive/${nixpkgsNode.locked.rev}.tar.gz";
sha256 = nixpkgsNode.locked.narHash;
};
pkgs = import nixpkgsSrc { inherit system; };
in
{
inherit name;
value = pkgs.matrix-synapse;
}
) childFlakeDirs
)
);
};
}