Revert flake.nix

This commit is contained in:
2025-02-08 10:24:14 -06:00
parent fccee3e61c
commit 5024a2be4c
4 changed files with 39 additions and 82 deletions

View File

@ -2,56 +2,46 @@
description = "tricu";
inputs = {
nh2pkgs = {
url = "https://github.com/nh2/nixpkgs/archive/ede5282c487a1fd2de64303ba59adad6726f1225.tar.gz";
type = "tarball";
flake = false;
};
static-haskell-nix = {
url = "github:nh2/static-haskell-nix";
flake = false;
};
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, flake-utils, nh2pkgs, nixpkgs, static-haskell-nix }:
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
compiler = "ghc948";
packageName = "tricu";
pkgs = nixpkgs.legacyPackages.${system};
packageName = "tricu";
containerPackageName = "${packageName}-container";
overlay = self: super: {
haskell = super.haskell // {
packages = super.haskell.packages // {
${compiler} = super.haskell.packages.${compiler}.override {
overrides = final: prev: {
${packageName} = prev.callCabal2nix packageName ./. {};
};
};
};
};
};
customGHC = pkgs.haskellPackages.ghcWithPackages (hpkgs: with hpkgs; [
megaparsec
]);
overlays = [overlay];
haskellPackages = pkgs.haskellPackages;
pkgs = import nh2pkgs { inherit overlays system; };
survey = import "${static-haskell-nix}/survey" { inherit compiler pkgs; };
tricuStatic = survey.haskellPackages.${packageName};
enableSharedExecutables = false;
enableSharedLibraries = false;
tricu = pkgs.haskell.lib.justStaticExecutables self.packages.${system}.default;
in {
packages.default = tricuStatic;
packages.${packageName} =
haskellPackages.callCabal2nix packageName self rec {};
packages.default = self.packages.${system}.${packageName};
defaultPackage = self.packages.${system}.default;
devShells.default = pkgs.mkShell {
buildInputs = with survey; [
buildInputs = with pkgs; [
haskellPackages.cabal-install
haskellPackages.ghc-events
haskellPackages.ghcid
] ++ [pkgs.upx];
customGHC
upx
];
inputsFrom = builtins.attrValues self.packages.${system};
};
devShell = self.devShells.${system}.default;
});
}