affection/flake.nix

55 lines
1.6 KiB
Nix
Raw Normal View History

2022-09-14 16:53:44 +00:00
{
description = "A game stub written in Haskell";
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};
2022-09-14 17:30:22 +00:00
haskellPackages = pkgs.haskellPackages;
2022-09-14 16:53:44 +00:00
jailbreakUnbreak = pkg:
pkgs.haskell.lib.doJailbreak (pkg.overrideAttrs (_: { meta = { }; }));
packageName = "affection";
2022-12-01 15:23:43 +00:00
in rec {
2022-09-14 16:53:44 +00:00
packages.${packageName} = # (ref:haskell-package-def)
2022-12-01 18:56:25 +00:00
haskellPackages.callCabal2nixWithOptions packageName self "--flag examples" {
2022-09-14 16:53:44 +00:00
# Dependency overrides go here
};
defaultPackage = self.packages.${system}.${packageName};
2022-12-01 18:56:25 +00:00
apps = {
example00 = {
type = "app";
program = "${self.packages.${system}.${packageName}}/bin/example00";
};
example01 = {
type = "app";
program = "${self.packages.${system}.${packageName}}/bin/example01";
};
example02 = {
type = "app";
program = "${self.packages.${system}.${packageName}}/bin/example02";
};
};
devShell = haskellPackages.shellFor {
packages = p: [ defaultPackage ];
withHoogle = true;
2022-12-01 18:56:25 +00:00
buildInputs = with haskellPackages; [
haskell-language-server
ghcid
cabal-install
] ++ (builtins.attrValues self.packages.${system});
2022-12-01 18:56:25 +00:00
};
2022-09-14 16:53:44 +00:00
});
}