1
0
Fork 0
mirror of https://github.com/malob/prefmanager.git synced 2024-12-15 17:50:46 +00:00
prefmanager/flake.nix

75 lines
2.3 KiB
Nix
Raw Normal View History

2021-01-14 01:13:58 +00:00
{
description = "Tool for working with macOS defaults.";
inputs = {
2021-07-13 15:55:20 +00:00
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
devshell.url = "github:numtide/devshell/";
2021-01-14 01:13:58 +00:00
flake-compat = { url = "github:edolstra/flake-compat"; flake = false; };
flake-utils.url = "github:numtide/flake-utils";
plist-source = { url = "github:malob/plist/monadfail"; flake = false; };
2022-04-26 19:43:14 +00:00
devshell.inputs.nixpkgs.follows = "nixpkgs";
2021-01-14 01:13:58 +00:00
};
2023-06-28 23:24:31 +00:00
outputs = { self, devshell, nixpkgs, flake-utils, plist-source, ... }:
2022-11-28 22:04:16 +00:00
let
2023-06-28 23:24:31 +00:00
inherit (import ./constants.nix) name ghcVersions defaultGhcVersion;
2022-11-28 22:04:16 +00:00
in
{
2023-06-28 23:24:31 +00:00
overlays.${name} = final: prev: {
haskell = prev.haskell // {
packageOverrides = final.lib.composeExtensions
prev.haskell.packageOverrides
(hfinal: hprev: {
plist = final.haskell.lib.markUnbroken (final.haskell.lib.overrideSrc hprev.plist {
src = plist-source;
});
2023-06-29 01:02:44 +00:00
${name} = hfinal.generateOptparseApplicativeCompletions
[ name ]
(hfinal.callCabal2nix name ./. { });
2023-06-28 23:24:31 +00:00
});
};
${name} = final.haskell.packages.${defaultGhcVersion}.${name};
2021-01-14 01:13:58 +00:00
};
2023-06-28 23:24:31 +00:00
} // flake-utils.lib.eachSystem [ "x86_64-darwin" "aarch64-darwin" ] (system:
let
pkgs = import nixpkgs { inherit system; overlays = [ self.overlays.${name} ]; };
in
{
packages = {
default = pkgs.${name};
${name} = pkgs.${name};
# Create package for all `ghcVersions`.
} // builtins.listToAttrs (map
(v: { name = "${name}-${v}"; value = pkgs.haskell.packages.${v}.${name}; })
ghcVersions
);
devShells.default = devshell.legacyPackages.${system}.mkShell {
inherit name;
packages = builtins.attrValues {
inherit (pkgs.haskell.packages.${defaultGhcVersion})
haskell-language-server
hlint
implicit-hie
weeder
;
inherit (pkgs) stack;
};
commands = [
{
help = "Regenerate hie.yaml (run from project root)";
name = "hie";
category = "project";
command = "gen-hie > hie.yaml";
}
];
};
}
);
2021-01-14 01:13:58 +00:00
}