This commit is contained in:
2026-04-24 14:46:10 -06:00
commit 0ab53a25a7
8 changed files with 836 additions and 0 deletions

85
flake.nix Normal file
View File

@@ -0,0 +1,85 @@
{
inputs = {
haskellNix.url = "github:input-output-hk/haskell.nix";
# nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nixpkgs.follows = "haskellNix/nixpkgs-unstable";
};
outputs = { self, nixpkgs, haskellNix, ... }@inputs:
let
supportedSystems = [
"aarch64-darwin" "aarch64-linux"
"x86_64-darwin" "x86_64-linux"
];
overlays = [
haskellNix.overlay
(final: prev: {
# haskellPackages = prev.haskellPackages.override {
# qbe = final.haskell-nix.project' {
# src = final.fetchFromGitea {
# domain = "git.deertopia.net";
# owner = "msyds";
# repo = "qbe-hs";
# rev = "master";
# hash = "sha256-3Ni2xFOvw7Qjzq7BIXfnSQQ3U99OaEH0j6SdILMYizs=";
# };
# compiler-nix-name = "ghc912";
# };
# };
gyehoek = final.haskell-nix.project' {
src = ./.;
compiler-nix-name = "ghc912";
shell.tools = {
cabal = {};
haskell-language-server = {};
};
shell.buildInputs = with final; [
gcc
qbe
];
};
})
];
each-system = f: nixpkgs.lib.genAttrs supportedSystems (system: f rec {
pkgs = import nixpkgs {
inherit system overlays;
};
inherit (pkgs) lib;
inherit system;
});
hf =
let
keys = [
"packages" "apps" "devShells"
"hydraJobs" "ciJobs" "checks"
];
in nixpkgs.lib.genAttrs keys
(k: each-system ({ pkgs, ... }: (pkgs.gyehoek.flake {}).${k}));
in {
# Exposed as a REPL convenience.
_pkgs = each-system ({ pkgs, ... }: pkgs);
packages = each-system ({ pkgs, system, ... }:
hf.packages.${system} // {
default = hf.packages.${system}."gyehoek:exe:gyehoek";
});
devShells = each-system
({ pkgs, system, ... }: hf.devShells.${system});
};
nixConfig = {
extra-substituters = [
"https://cache.iog.io"
"https://cache.zw3rk.com"
];
extra-trusted-public-keys = [
"hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="
"loony-tools:pr9m4BkM/5/eSTZlkQyRt57Jz7OMBxNSUiMC4FkcNfk="
];
allow-import-from-derivation = "true";
};
}