nix-module-wrapper-manager-fds/flake.nix

70 lines
1.9 KiB
Nix
Raw Normal View History

2024-07-16 10:50:29 +00:00
# As a design restriction, this flake shouldn't have any inputs whatsoever.
# We're already using the Nix projects through pinning with npins.
2024-07-02 11:39:25 +00:00
{
description = "wrapper-manager-fds flake";
2024-07-31 13:51:40 +00:00
outputs =
{ ... }:
let
sources = import ./npins;
systems = [
"x86_64-linux"
"aarch64-linux"
];
eachSystem =
systems: f:
let
# Merge together the outputs for all systems.
op =
attrs: system:
let
ret = f system;
op =
attrs: key:
attrs
// {
${key} = (attrs.${key} or { }) // {
${system} = ret.${key};
};
};
in
builtins.foldl' op attrs (builtins.attrNames ret);
in
builtins.foldl' op { } (
systems
# add the current system if --impure is used
++ (
if builtins ? currentSystem then
if builtins.elem builtins.currentSystem systems then [ ] else [ builtins.currentSystem ]
else
[ ]
)
);
in
import ./. { }
// (eachSystem systems (
system:
let
2024-07-31 13:51:40 +00:00
pkgs = import sources.nixos-unstable { inherit system; };
inherit (pkgs) lib;
2024-07-31 13:51:40 +00:00
tests = import ./tests { inherit pkgs; };
docs = import ./docs { inherit pkgs; };
in
2024-07-31 13:51:40 +00:00
{
devShells = {
default = import ./shell.nix { inherit pkgs; };
website = import ./docs/website/shell.nix { inherit pkgs; };
};
devPackages = {
2024-07-31 13:51:40 +00:00
manpage-reference = docs.outputs.manpage;
html-reference = docs.outputs.html;
2024-11-21 05:16:35 +00:00
website = docs.website { };
2024-07-31 13:51:40 +00:00
};
2025-01-12 09:58:39 +00:00
checks = {
inherit (tests) lib;
} // lib.mapAttrs' (n: v: lib.nameValuePair "config-test-${n}" v) tests.configs;
2024-07-31 13:51:40 +00:00
}
));
2024-07-02 11:39:25 +00:00
}