maid/flake.nix
Christina Sørensen 39ae2ff6d2
Some checks failed
/ Build Nix targets (push) Has been cancelled
fix: deprecated url literals
Signed-off-by: Christina Sørensen <christina@cafkafk.com>
2024-09-15 18:40:47 +02:00

61 lines
1.4 KiB
Nix

{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
treefmt-nix.url = "github:numtide/treefmt-nix";
};
outputs = {
self,
nixpkgs,
utils,
treefmt-nix,
systems,
...
}:
utils.lib.eachDefaultSystem (
system: let
config = {};
overlay = pkgsNew: pkgsOld: {
maid =
pkgsNew.haskell.lib.justStaticExecutables
pkgsNew.haskellPackages.maid;
haskellPackages = pkgsOld.haskellPackages.override (old: {
overrides = pkgsNew.haskell.lib.packageSourceOverrides {
maid = ./.;
};
});
};
pkgs = import nixpkgs {
inherit config system;
overlays = [overlay];
};
treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix;
buildInputs = with pkgs; lib.optionals stdenv.isDarwin [libiconv darwin.apple_sdk.frameworks.Security];
in rec {
# For `nix fmt`
formatter = treefmtEval.config.build.wrapper;
# For `nix flake check`
checks = {
formatting = treefmtEval.config.build.check self;
};
packages.default = pkgs.haskellPackages.maid;
apps.default = {
type = "app";
program = "${pkgs.maid}/bin/maid";
};
devShells.default = pkgs.haskellPackages.maid.env;
}
);
}