From a00f3583af789a3d3419013f32ab1f99654b2fa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20=E2=80=9CAd=C3=A6dra=E2=80=9D=20Hamel?= Date: Tue, 28 May 2024 23:48:26 +0200 Subject: [PATCH] genSystems function --- flake.lock | 25 +++++++++++++++++++++++++ flake.nix | 12 ++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..02a1eab --- /dev/null +++ b/flake.lock @@ -0,0 +1,25 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1716715802, + "narHash": "sha256-usk0vE7VlxPX8jOavrtpOqphdfqEQpf9lgedlY/r66c=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e2dd4e18cc1c7314e24154331bae07df76eb582f", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..0f745ec --- /dev/null +++ b/flake.nix @@ -0,0 +1,12 @@ +{ + outputs = { self, nixpkgs }: { + lib = rec { + mergeFlakes = flakes: nixpkgs.lib.attrsets.foldAttrs (prev: i: prev // i) {} flakes; + genSystems = (systems: f: + (mergeFlakes (map (system: + builtins.mapAttrs (k: v: { "${system}" = v; }) (f (import nixpkgs { inherit system; })) + ) systems)) + ); + }; + }; +}