purr/flake.nix

57 lines
1.6 KiB
Nix

{
description = "purr - a web application for generating and sharing secrets ";
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 = "purr";
dockerPackageName = "${packageName}-docker";
haskellPackages = pkgs.haskellPackages;
enableSharedExecutables = false;
in {
packages.${packageName} =
haskellPackages.callCabal2nix packageName self rec {
};
packages.default = self.packages.${system}.${packageName};
defaultPackage = self.packages.${system}.default;
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
ghcid
cabal-install
];
inputsFrom = map (__getAttr "env") (__attrValues self.packages.${system});
};
devShell = self.devShells.${system}.default;
packages.${dockerPackageName} = pkgs.dockerTools.buildImage {
name = "purr";
copyToRoot = pkgs.buildEnv {
name = "image-root";
paths = [ self.packages.${system}.default ];
pathsToLink = [ "/bin" ];
};
tag = "latest";
config = {
Cmd = [
"/bin/Purr-musl"
];
ExposedPorts = {
"3000/tcp" = {};
};
extraCommands = ''
'';
};
};
});
}