From c0d5eb56b51b4e57b0b7af5d89e0dd214995d887 Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Tue, 18 Jun 2024 19:32:50 -0400 Subject: [PATCH] package-sets: init --- flake.lock | 151 +++++++++++++++++++++++++++++++++++++++++++++++++---- flake.nix | 21 ++++++++ 2 files changed, 162 insertions(+), 10 deletions(-) diff --git a/flake.lock b/flake.lock index 31e1fda5..9e6c59ae 100644 --- a/flake.lock +++ b/flake.lock @@ -659,6 +659,22 @@ "type": "github" } }, + "flake-compat_6": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" @@ -677,6 +693,23 @@ "type": "github" } }, + "flake-parts_10": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_5" + }, + "locked": { + "lastModified": 1696343447, + "narHash": "sha256-B2xAZKLkkeRFG5XcHHSXXcP7To9Xzr59KXeZiRf4vdQ=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "c9afaba3dfa4085dbd2ccb38dfade5141e33d9d4", + "type": "github" + }, + "original": { + "id": "flake-parts", + "type": "indirect" + } + }, "flake-parts_2": { "inputs": { "nixpkgs-lib": [ @@ -815,19 +848,23 @@ }, "flake-parts_9": { "inputs": { - "nixpkgs-lib": "nixpkgs-lib_5" + "nixpkgs-lib": [ + "package-sets", + "nixpkgs" + ] }, "locked": { - "lastModified": 1696343447, - "narHash": "sha256-B2xAZKLkkeRFG5XcHHSXXcP7To9Xzr59KXeZiRf4vdQ=", + "lastModified": 1717285511, + "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "c9afaba3dfa4085dbd2ccb38dfade5141e33d9d4", + "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8", "type": "github" }, "original": { - "id": "flake-parts", - "type": "indirect" + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" } }, "flake-root": { @@ -990,6 +1027,33 @@ "url": "https://gitlab.haskell.org/bgamari/ghc-utils" } }, + "git-hooks-nix": { + "inputs": { + "flake-compat": "flake-compat_5", + "gitignore": "gitignore_3", + "nixpkgs": [ + "package-sets", + "nixpkgs" + ], + "nixpkgs-stable": [ + "package-sets", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1717664902, + "narHash": "sha256-7XfBuLULizXjXfBYy/VV+SpYMHreNRHk9nKMsm1bgb4=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "cc4d466cb1254af050ff7bdf47f6d404a7c646d1", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, "gitignore": { "inputs": { "nixpkgs": [ @@ -1035,6 +1099,28 @@ } }, "gitignore_3": { + "inputs": { + "nixpkgs": [ + "package-sets", + "git-hooks-nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "gitignore_4": { "inputs": { "nixpkgs": [ "pre-commit-hooks-nix", @@ -1871,6 +1957,29 @@ "type": "github" } }, + "package-sets": { + "inputs": { + "flake-parts": "flake-parts_9", + "git-hooks-nix": "git-hooks-nix", + "nixpkgs": [ + "nixpkgs" + ], + "treefmt-nix": "treefmt-nix_3" + }, + "locked": { + "lastModified": 1718893986, + "narHash": "sha256-GWJmC3Che0mFzpZUn2w4DcUi+a3DshVRnqNfUjwGtMI=", + "owner": "ConnorBaker", + "repo": "package-sets", + "rev": "4b9effa7466e122f84ef2164f10fb4715f44afb2", + "type": "github" + }, + "original": { + "owner": "ConnorBaker", + "repo": "package-sets", + "type": "github" + } + }, "paisano": { "inputs": { "call-flake": "call-flake_2", @@ -2007,8 +2116,8 @@ }, "pre-commit-hooks-nix": { "inputs": { - "flake-compat": "flake-compat_5", - "gitignore": "gitignore_3", + "flake-compat": "flake-compat_6", + "gitignore": "gitignore_4", "nixpkgs": [ "nixpkgs" ], @@ -2106,7 +2215,7 @@ }, "pydev": { "inputs": { - "flake-parts": "flake-parts_9", + "flake-parts": "flake-parts_10", "nixpkgs": [ "nixpkgs" ], @@ -2145,12 +2254,13 @@ "nix-cargo-integration": "nix-cargo-integration", "nixpkgs": "nixpkgs_5", "ocaml-flake": "ocaml-flake", + "package-sets": "package-sets", "pre-commit-hooks-nix": "pre-commit-hooks-nix", "proc-flake": "proc-flake", "process-compose-flake": "process-compose-flake", "pydev": "pydev", "std": "std", - "treefmt-nix": "treefmt-nix_3" + "treefmt-nix": "treefmt-nix_4" } }, "rust-overlay": { @@ -2379,6 +2489,27 @@ } }, "treefmt-nix_3": { + "inputs": { + "nixpkgs": [ + "package-sets", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1718522839, + "narHash": "sha256-ULzoKzEaBOiLRtjeY3YoGFJMwWSKRYOic6VNw2UyTls=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "68eb1dc333ce82d0ab0c0357363ea17c31ea1f81", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, + "treefmt-nix_4": { "inputs": { "nixpkgs": "nixpkgs_7" }, diff --git a/flake.nix b/flake.nix index 6a1ddd17..ff6926bd 100644 --- a/flake.nix +++ b/flake.nix @@ -28,6 +28,8 @@ ocaml-flake.url = "github:9glenda/ocaml-flake"; ocaml-flake.inputs.nixpkgs.follows = "nixpkgs"; ocaml-flake.inputs.treefmt-nix.follows = "treefmt-nix"; + package-sets.url = "github:ConnorBaker/package-sets"; + package-sets.inputs.nixpkgs.follows = "nixpkgs"; pre-commit-hooks-nix.url = "github:cachix/pre-commit-hooks.nix"; pre-commit-hooks-nix.inputs.nixpkgs.follows = "nixpkgs"; proc-flake.url = "github:srid/proc-flake"; @@ -264,6 +266,25 @@ ''; }; + package-sets = { + flakeRef = "github:ConnorBaker/package-sets"; + baseUrl = "https://github.com/ConnorBaker/package-sets"; + intro = '' + Populate `packages` and `overlays` with ease. + + [package-sets](https://github.com/ConnorBaker/package-sets) was born out of frustration with the manual + process of adding packages and overlays to a flake. If your flakes have more than a few packages, + dependencies between packages, or require Nixpkgs use a non-standard configuration, this module is for you. + + ## Limitations + + A great deal of this module's functionality is based on `lib.packagesFromDirectoryRecursive`. + Unfortunately, [`flake.packages`](../options/flake-parts.html#opt-flake.packages) does not allow nested + attributes, so there are some limitations to what this module can do. See the notes on the options in + [`strategies`](#opt-packageSets.strategies) for more information. + ''; + }; + pre-commit-hooks-nix = { baseUrl = "https://github.com/cachix/pre-commit-hooks.nix/blob/master"; intro = ''