Add flake-utils

This commit is contained in:
Paul Brinkmeier 2025-07-15 18:11:11 +02:00
parent 8ddeb8a61a
commit 79085906a5
2 changed files with 41 additions and 6 deletions

34
flake.lock generated
View File

@ -1,5 +1,23 @@
{ {
"nodes": { "nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1752536923, "lastModified": 1752536923,
@ -18,8 +36,24 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View File

@ -2,11 +2,11 @@
description = "An opionated Postgres library"; description = "An opionated Postgres library";
inputs.nixpkgs.url = "github:nixos/nixpkgs/release-25.05"; inputs.nixpkgs.url = "github:nixos/nixpkgs/release-25.05";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs }: outputs = { self, nixpkgs, flake-utils }: flake-utils.lib.eachDefaultSystem (system:
let let
system = "aarch64-darwin"; pkgs = import nixpkgs { inherit system; };
pkgs = nixpkgs.legacyPackages.${system};
opium = pkgs.haskellPackages.developPackage { opium = pkgs.haskellPackages.developPackage {
root = ./.; root = ./.;
modifier = drv: modifier = drv:
@ -17,12 +17,13 @@
]; ];
}; };
in { in {
packages.${system}.opium = pkgs.haskell.lib.overrideCabal opium { packages.opium = pkgs.haskell.lib.overrideCabal opium {
# Currently the tests require a running Postgres instance. # Currently the tests require a running Postgres instance.
# This is not automated yet, so don't export the tests. # This is not automated yet, so don't export the tests.
doCheck = false; doCheck = false;
}; };
devShells.${system}.default = opium.env; devShells.default = opium.env;
}; }
);
} }