oauth2-mock-server/flake.nix
2024-01-19 01:07:08 +00:00

45 lines
1.2 KiB
Nix

# SPDX-FileCopyrightText: 2024 UniWorX Systems
# SPDX-FileContributor: David Mosbach <david.mosbach@uniworx.de>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
{
description = "Insecure mock server for OAuth2";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
};
outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
name = "oauth2-mock-server";
pkgs = import nixpkgs { inherit system; };
stackWrapper = pkgs.symlinkJoin {
name = "stack";
paths = [ pkgs.stack ];
buildInputs = with pkgs; [ makeWrapper ];
postBuild = ''
wrapProgram $out/bin/stack \
--add-flags "--no-install-ghc"
'';
};
buildInputs = [ stackWrapper ] ++ (
with pkgs; [ reuse zlib postgresql_16 ] ++ (
with haskell.packages."ghc927"; [ ghc haskell-language-server ]
)
);
in {
packages.${system}.${name} = nixpkgs.legacyPackages.${system}.${name};
packages.${system}.default = self.packages.${system}.${name};
devShells.${system}.default = pkgs.mkShell {
buildInputs = buildInputs;
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
shellHook = builtins.readFile ./mkDB.sh;
};
};
}