Files
2026-08-20 13:53:44 +03:00

42 lines
1.1 KiB
Nix

{
description = "A very basic flake";
inputs = {
flake-utils = {
url = "github:numtide/flake-utils";
};
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachSystem ["x86_64-linux"] (system:
let pkgs = nixpkgs.legacyPackages.${system};
hp = nixpkgs.legacyPackages.${system}.haskellPackages.override (old: {
overrides = pkgs.lib.composeExtensions (old.overrides or (_: _: {})) (f: p: {
home-assistant-controller = pkgs.haskell.lib.overrideCabal (f.callPackage ./. {}) (_: {
preBuild = ''
export COMMIT="${self.rev or "unknown"}"
'';
});
});
});
in rec {
packages.home-assistant-controller = pkgs.haskell.lib.justStaticExecutables hp.home-assistant-controller;
defaultPackage = packages.home-assistant-controller;
devShell = hp.shellFor {
packages = h: [h.home-assistant-controller];
withHoogle = false;
buildInputs = with pkgs; [
cabal-install
hp.hlint
cabal2nix
ghcid
hp.graphmod
hp.haskell-language-server
];
};
}
);
}