wrapper-manager-fds: put more things in flake

This commit is contained in:
Gabriel Arazas 2024-07-14 11:13:08 +08:00
parent 417247ad45
commit d4056c82bc
2 changed files with 39 additions and 1 deletions

View File

@ -1,5 +1,9 @@
Copyright (c) 2024 Gabriel Arazas <foodogsquared@foodogsquared.one>
Program uses the following files/implementations from other authors;
see their respective license headers for more details:
flake.nix, specifically the eachSystem which is taken directly from flake-utils: Copyright (c) 2020 zimbatm
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights

View File

@ -1,4 +1,38 @@
{
description = "wrapper-manager-fds flake";
outputs = { ... }: import ./. { };
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
pkgs = import sources.nixos-unstable { inherit system; };
tests = import ./tests { inherit pkgs; };
in {
devShells.default = import ./shell.nix { inherit pkgs; };
checks.wrapperManagerLibrarySetPkg = tests.libTestPkg;
}));
}