HELPS/flake.nix

65 lines
1.8 KiB
Nix

{
description = "HELPS";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
packageName = "HELPS";
containerPackageName = "${packageName}-container";
c2n = haskellPackages.callCabal2nix packageName self rec {};
HELPS = c2n.overrideAttrs (old: {
doHaddock = true;
enableSeparateDocOutput = false;
enableSharedExecutables = false;
enableSharedLibraries = false;
});
haskellPackages = pkgs.haskellPackages;
in {
packages.${packageName} = pkgs.haskell.lib.justStaticExecutables HELPS;
packages.HELPSDocs = HELPS;
packages.default = self.packages.${system}.${packageName};
defaultPackage = self.packages.${system}.default;
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
pkgs.haskellPackages.cabal-install
pkgs.haskellPackages.ghc
pkgs.haskellPackages.ghcid
pkgs.haskellPackages.haskell-language-server
];
inputsFrom = builtins.attrValues self.packages.${system};
};
devShell = self.devShells.${system}.default;
packages.${containerPackageName} = pkgs.dockerTools.buildImage {
name = "HELPS";
copyToRoot = pkgs.buildEnv {
name = "image-root";
paths = [ HELPS ];
pathsToLink = [ "/bin" ];
};
tag = "latest";
config = {
Cmd = [
"/bin/Purr"
];
WorkingDir = "/app";
ExposedPorts = {
"3000/tcp" = {};
};
extraCommands = ''
'';
};
};
});
}