2023-05-02 18:35:04 -05:00
|
|
|
{
|
|
|
|
description = "purr - a web application for generating and sharing secrets ";
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs";
|
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
|
|
};
|
|
|
|
|
2023-05-07 13:08:47 -05:00
|
|
|
outputs = { self, nixpkgs, flake-utils }:
|
2023-05-02 18:35:04 -05:00
|
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
|
|
let
|
2023-05-04 07:45:02 -05:00
|
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
|
|
packageName = "purr";
|
2024-02-17 08:34:26 -06:00
|
|
|
containerPackageName = "${packageName}-container";
|
2023-05-02 18:35:04 -05:00
|
|
|
|
|
|
|
haskellPackages = pkgs.haskellPackages;
|
|
|
|
|
2023-05-04 07:45:02 -05:00
|
|
|
enableSharedExecutables = false;
|
2023-05-05 19:38:59 -05:00
|
|
|
enableSharedLibraries = false;
|
|
|
|
|
|
|
|
purr = pkgs.haskell.lib.justStaticExecutables self.packages.${system}.default;
|
2023-05-02 18:35:04 -05:00
|
|
|
in {
|
2023-05-05 19:38:59 -05:00
|
|
|
|
2023-05-02 18:35:04 -05:00
|
|
|
packages.${packageName} =
|
2023-05-05 19:38:59 -05:00
|
|
|
haskellPackages.callCabal2nix packageName self rec {};
|
2023-05-02 18:35:04 -05:00
|
|
|
|
|
|
|
packages.default = self.packages.${system}.${packageName};
|
|
|
|
defaultPackage = self.packages.${system}.default;
|
|
|
|
|
|
|
|
devShells.default = pkgs.mkShell {
|
|
|
|
buildInputs = with pkgs; [
|
|
|
|
ghcid
|
|
|
|
cabal-install
|
2023-05-07 13:08:47 -05:00
|
|
|
ghc
|
2023-05-02 18:35:04 -05:00
|
|
|
];
|
2023-05-07 13:08:47 -05:00
|
|
|
inputsFrom = builtins.attrValues self.packages.${system};
|
2023-05-02 18:35:04 -05:00
|
|
|
};
|
|
|
|
devShell = self.devShells.${system}.default;
|
2023-05-05 19:38:59 -05:00
|
|
|
|
2024-02-17 08:34:26 -06:00
|
|
|
packages.${containerPackageName} = pkgs.dockerTools.buildImage {
|
2023-05-02 18:35:04 -05:00
|
|
|
name = "purr";
|
2023-05-05 19:38:59 -05:00
|
|
|
|
2023-05-02 18:35:04 -05:00
|
|
|
copyToRoot = pkgs.buildEnv {
|
|
|
|
name = "image-root";
|
2023-05-05 19:38:59 -05:00
|
|
|
paths = [ purr ];
|
2023-05-02 18:35:04 -05:00
|
|
|
pathsToLink = [ "/bin" ];
|
|
|
|
};
|
|
|
|
tag = "latest";
|
|
|
|
config = {
|
|
|
|
Cmd = [
|
2023-05-05 19:38:59 -05:00
|
|
|
"/bin/Purr"
|
2023-05-02 18:35:04 -05:00
|
|
|
];
|
2024-02-17 08:34:26 -06:00
|
|
|
WorkingDir = "/app";
|
2023-05-02 18:35:04 -05:00
|
|
|
ExposedPorts = {
|
|
|
|
"3000/tcp" = {};
|
|
|
|
};
|
|
|
|
extraCommands = ''
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|