bahaghari/flake: remove all inputs as a design constraint

This commit is contained in:
Gabriel Arazas 2024-08-01 09:01:49 +08:00
parent 9428bc0472
commit c19b9738f2
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360

View File

@ -1,15 +1,44 @@
# For now, it has
{ {
description = "Specialized set of Nix modules for generating and applying themes."; description = "Specialized set of Nix modules for generating and applying themes.";
inputs = { outputs = { ... }:
flake-utils.url = "github:numtide/flake-utils";
};
outputs = inputs@{ self, ... }:
let let
systems = inputs.flake-utils.lib.defaultSystems;
sources = import ./npins; sources = import ./npins;
in inputs.flake-utils.lib.eachSystem systems 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 eachSystem systems
(system: { (system: {
devShells.default = devShells.default =
import ./shell.nix { pkgs = import sources.nixos-stable { inherit system; }; }; import ./shell.nix { pkgs = import sources.nixos-stable { inherit system; }; };