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";
|
2021-01-25 18:39:15 +00:00
|
|
|
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";
|
2021-01-25 18:39:15 +00:00
|
|
|
plist-source = { url = "github:malob/plist/monadfail"; flake = false; };
|
2022-04-26 19:43:14 +00:00
|
|
|
devshell.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
devshell.inputs.flake-utils.follows = "flake-utils";
|
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
|
2021-01-25 18:39:15 +00:00
|
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
2023-02-26 20:22:01 +00:00
|
|
|
compiler = pkgs.haskell.packages.ghc926;
|
2021-01-25 18:39:15 +00:00
|
|
|
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
|
|
|
|
2021-01-25 18:39:15 +00:00
|
|
|
# # This is used by `nix develop .`
|
2022-11-28 22:04:16 +00:00
|
|
|
devShells.default = mkShell {
|
2021-01-25 18:39:15 +00:00
|
|
|
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
|
2021-01-28 02:22:20 +00:00
|
|
|
pkgs.hlint
|
2021-01-14 01:13:58 +00:00
|
|
|
];
|
2021-01-25 18:39:15 +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
|
|
|
};
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|