Static linking part 2
Some checks failed
Test, Build, and Release / test (push) Failing after 3h6m55s
Test, Build, and Release / build (push) Has been cancelled

This commit is contained in:
2025-02-07 19:22:31 -06:00
parent ad1918aa6f
commit fccee3e61c
3 changed files with 68 additions and 39 deletions

View File

@ -2,7 +2,7 @@
description = "tricu";
inputs = {
nixpkgs = {
nh2pkgs = {
url = "https://github.com/nh2/nixpkgs/archive/ede5282c487a1fd2de64303ba59adad6726f1225.tar.gz";
type = "tarball";
flake = false;
@ -11,48 +11,47 @@
url = "github:nh2/static-haskell-nix";
flake = false;
};
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, static-haskell-nix }:
let
system = "x86_64-linux";
compiler = "ghc948";
packageName = "tricu";
outputs = { self, flake-utils, nh2pkgs, nixpkgs, static-haskell-nix }:
flake-utils.lib.eachDefaultSystem (system:
let
compiler = "ghc948";
packageName = "tricu";
overlay = self: super: {
haskell = super.haskell // {
packages = super.haskell.packages // {
${compiler} = super.haskell.packages.${compiler}.override {
overrides = final: prev: {
${packageName} = prev.callCabal2nix packageName ./. {};
overlay = self: super: {
haskell = super.haskell // {
packages = super.haskell.packages // {
${compiler} = super.haskell.packages.${compiler}.override {
overrides = final: prev: {
${packageName} = prev.callCabal2nix packageName ./. {};
};
};
};
};
};
};
overlays = [overlay];
overlays = [overlay];
normalPkgs = import nixpkgs { inherit overlays system; };
pkgs = import nh2pkgs { inherit overlays system; };
survey = import "${static-haskell-nix}/survey" { inherit compiler normalPkgs; };
survey = import "${static-haskell-nix}/survey" { inherit compiler pkgs; };
tricuStatic = survey.haskellPackages.${packageName};
tricuStatic = survey.haskellPackages.${packageName};
in {
packages.${system}.default = tricuStatic;
in {
packages.default = tricuStatic;
devShells.default = normalPkgs.mkShell {
buildInputs = with normalPkgs; [
normalPkgs.haskellPackages.cabal-install
normalPkgs.haskellPackages.ghc-events
normalPkgs.haskellPackages.ghcid
normalPkgs.upx
];
inputsFrom = builtins.attrValues self.packages.${system};
};
devShell = self.devShells.${system}.default;
};
devShells.default = pkgs.mkShell {
buildInputs = with survey; [
haskellPackages.cabal-install
haskellPackages.ghc-events
haskellPackages.ghcid
] ++ [pkgs.upx];
inputsFrom = builtins.attrValues self.packages.${system};
};
devShell = self.devShells.${system}.default;
});
}