1
0
Fork 0
mirror of https://github.com/malob/prefmanager.git synced 2024-12-14 11:57:49 +00:00
prefmanager/flake.nix

53 lines
1.7 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
};
2022-11-28 22:04:16 +00:00
outputs = { self, devshell, nixpkgs, flake-utils, plist-source, ... }: {
overlays.prefmanager = _: prev: {
inherit (self.packages.${prev.stdenv.system}) prefmanager;
};
} // flake-utils.lib.eachSystem [ "x86_64-darwin" "aarch64-darwin" ] (system:
let
pkgs = nixpkgs.legacyPackages.${system};
2023-05-30 17:23:20 +00:00
compiler = pkgs.haskell.packages.ghc927;
hlib = pkgs.haskell.lib;
plist = hlib.markUnbroken (hlib.overrideSrc compiler.plist { src = plist-source; });
2021-07-13 15:55:20 +00:00
prefmanager = compiler.callCabal2nix "prefmanager" ./. { inherit plist; };
2022-10-14 18:29:36 +00:00
inherit (devshell.legacyPackages.${system}) mkShell;
2022-11-28 22:04:16 +00:00
in
{
2021-01-14 01:13:58 +00:00
# Built by `nix build .`
2022-04-26 19:43:14 +00:00
packages.default = prefmanager;
packages.prefmanager = prefmanager;
2021-01-14 01:13:58 +00:00
# # This is used by `nix develop .`
2022-11-28 22:04:16 +00:00
devShells.default = mkShell {
name = "prefmanager";
packages = [
compiler.haskell-language-server
compiler.implicit-hie
2022-10-14 18:48:27 +00:00
# compiler.weeder
2021-01-14 01:13:58 +00:00
pkgs.stack
pkgs.hlint
2021-01-14 01:13:58 +00:00
];
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
};
}
);
}