2023-07-19 01:53:49 +00:00
|
|
|
{
|
2023-07-21 03:38:26 +00:00
|
|
|
description = "Github Action for caching Nix derivations with attic";
|
2023-07-19 01:53:49 +00:00
|
|
|
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "nixpkgs/nixos-unstable";
|
|
|
|
};
|
|
|
|
|
2023-07-20 01:08:36 +00:00
|
|
|
outputs = {nixpkgs, ...}: let
|
|
|
|
mkSystems = sys: builtins.map (arch: "${arch}-${sys}") ["x86_64" "aarch64"];
|
|
|
|
systems =
|
|
|
|
mkSystems "linux"
|
|
|
|
++ mkSystems "darwin";
|
2023-07-19 01:53:49 +00:00
|
|
|
|
2023-07-20 01:08:36 +00:00
|
|
|
forAllSystems = nixpkgs.lib.genAttrs systems;
|
|
|
|
nixpkgsFor = forAllSystems (system: import nixpkgs {inherit system;});
|
2023-07-19 01:53:49 +00:00
|
|
|
|
2023-07-20 01:08:36 +00:00
|
|
|
forEachSystem = fn:
|
|
|
|
forAllSystems (s: fn nixpkgsFor.${s});
|
|
|
|
in {
|
|
|
|
devShells = forEachSystem (pkgs: {
|
|
|
|
default = pkgs.mkShell {
|
|
|
|
packages = with pkgs; [
|
|
|
|
actionlint
|
|
|
|
nodePackages.pnpm
|
|
|
|
];
|
|
|
|
};
|
|
|
|
});
|
2023-07-19 01:53:49 +00:00
|
|
|
|
2023-07-21 03:38:26 +00:00
|
|
|
formatter = forEachSystem (p: p.alejandra);
|
|
|
|
|
|
|
|
packages = forEachSystem (p: let
|
|
|
|
time = toString builtins.currentTime;
|
|
|
|
test = p.runCommand "test-${time}" {} ''
|
|
|
|
echo ${time} > $out
|
|
|
|
'';
|
|
|
|
in {
|
|
|
|
inherit test;
|
|
|
|
default = test;
|
|
|
|
});
|
2023-07-20 01:08:36 +00:00
|
|
|
};
|
2023-07-19 01:53:49 +00:00
|
|
|
}
|