From b9a252f07aed2bd6f65d5ef86862c9f9de75273c Mon Sep 17 00:00:00 2001 From: Kiana Sheibani Date: Mon, 30 Jan 2023 22:21:14 -0500 Subject: [PATCH] Initial commit --- flake.lock | 42 ++++++++++++++++++++++++++++++++++++++++++ flake.nix | 20 ++++++++++++++++++++ 2 files changed, 62 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..785f948 --- /dev/null +++ b/flake.lock @@ -0,0 +1,42 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1675132057, + "narHash": "sha256-lq7VYB8J2wn35CeByP9760tR6mwQtztPze+J8O4fHdU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5b374db81f4a26de2cef6dae71b4478b362866a4", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..1d96fbe --- /dev/null +++ b/flake.nix @@ -0,0 +1,20 @@ +{ + description = "The Sieve of Eratosthenes implemented in many different languages"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils, ... }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + + currentDir = builtins.readDir ./.; + dirs = pkgs.lib.filterAttrs (_: v: v == "directory") currentDir; + in { + packages = builtins.mapAttrs (dir: _: pkgs.callPackage ./${dir} {}) dirs; + } + ); +}