Skip to content

Commit

Permalink
Update to ghc 9.6.2 and nixpkgs 23.05
Browse files Browse the repository at this point in the history
Various cleanup.
  • Loading branch information
u-quark committed Oct 22, 2023
1 parent b911019 commit 593ad1e
Show file tree
Hide file tree
Showing 13 changed files with 92 additions and 232 deletions.
29 changes: 28 additions & 1 deletion NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ library:
- -dcore-lint
```

To build with nix (using workers):

`nix-build --show-trace --max-jobs 0`

To debug the GHC runtime (scheduler, gc, capabilities):

`+RTS -N -Dg -DG -Ds -Di -RTS`
Expand All @@ -44,6 +48,30 @@ To get the binary before it is striped from it's debugging information in nix:
> NIX_PATH='' nix-build -K --show-trace
and it will keep and print the build directory.

To inspect a derivation:

```
> nix repl
nix-repl> d = import ./nix/default.nix { inputs = (import ./default.nix).inputs; }
nix-repl> d.unmodified_static-haskell.haskellPackages.callPackage
```

alternatively:

`nix repl --extra-experimental-features repl-flake .#`

To debug a derivation:

`nix show-derivation /nix/store/hngwpk25qnj35r6pkdb3zy5mnhlrfzrf-test-0.1.0.0.drv`

To update a flake input:

`nix flake lock --update-input vty`

To push to cachix cache:

`nix-build --show-trace --max-jobs 0 | cachix push gg`

Alternatives
============

Expand Down Expand Up @@ -119,4 +147,3 @@ https://discourse.nixos.org/t/static-libraries-discarded/991
https://sourceware.org/binutils/docs/binutils/nm.html
https://renenyffenegger.ch/notes/development/languages/C-C-plus-plus/GCC/create-libraries/index
https://github.com/NixOS/nixpkgs/issues/36883

68 changes: 15 additions & 53 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 9 additions & 20 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,25 @@
description = "gg - git (G)UI";

inputs = {
MissingH = {
url = "github:haskell-hvr/missingh?ref=v1.4.2.0";
flake = false;
};
base16-schemes = {
url = "github:tinted-theming/base16-schemes?rev=9a4002f78dd1094c123169da243680b2fda3fe69";
flake = false;
};
brick = {
url = "github:jtdaugherty/brick?rev=3d34ef115631700ab6d46088357f7e2ab13c424e";
nixpkgs.url = "github:NixOS/nixpkgs?rev=9e49f8f1f37bc906cda1adb33064c325d760819a";
static-haskell = {
url = "github:nh2/static-haskell-nix";
flake = false;
};
libgit2 = {
url = "github:libgit2/libgit2?ref=v1.6.4";
flake = false;
};
nh2-nixpkgs = {
url = "github:nh2/nixpkgs?rev=11aa987ea5b5a593c9ca7a38b391804959f905e5";
flake = false;
};
static-haskell = {
url = "github:nh2/static-haskell-nix?rev=e3823be4caba6917c7c9f9dde9bece8ed8a4179b";
flake = false;
};
vty = {
url = "github:u-quark/vty?ref=gg";
flake = false;
};
yesodweb-authenticate = {
url = "github:yesodweb/authenticate?ref=authenticate-1.3.5";
brick = {
url = "github:jtdaugherty/brick?rev=3d34ef115631700ab6d46088357f7e2ab13c424e";
flake = false;
};
base16-schemes = {
url = "github:tinted-theming/base16-schemes?rev=9a4002f78dd1094c123169da243680b2fda3fe69";
flake = false;
};
flake-compat = {
Expand Down
94 changes: 0 additions & 94 deletions gg.iml

This file was deleted.

22 changes: 8 additions & 14 deletions nix/default.nix
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{ inputs }:

let
ghc = "ghc881";
pkgs = import inputs.nh2-nixpkgs { system = "x86_64-linux"; };
ghc = "ghc962";
pkgs = import inputs.nixpkgs { system = "x86_64-linux"; };
static-pkgs-overlay = import ./static-pkgs-overlay.nix {
inherit inputs;
inherit pkgs;
};
haskell-pkgs-overlay = import ./haskell-pkgs-overlay.nix {
inherit inputs;
haskellLib = pkgs.haskell.lib;
callCabal2nix = pkgs.haskell.packages."${ghc}".callCabal2nix;
lib = pkgs.lib;
haskellLib = pkgs.pkgsMusl.haskell.lib;
callCabal2nix = pkgs.pkgsMusl.haskell.packages."${ghc}".callCabal2nix;
};
haskellPkgsExtend = hp: f: hp.override (oldArgs: {
overrides = pkgs.lib.composeExtensions (oldArgs.overrides or (_: _: {})) f;
Expand All @@ -32,18 +33,11 @@ let
pybase16-builder = tools.pybase16-builder;
base16-schemes = inputs.base16-schemes;
};
gg = static-haskell.haskellPackagesWithLibsReadyForStaticLinking.callPackage (import ./gg.nix) {
ncurses = patched-pkgs.pkgsMusl.static-ncurses;
zlib = patched-pkgs.pkgsMusl.zlib;
gg = static-haskell.haskellPackages.callPackage (import ./gg.nix) {
inherit haskell-base16-schemes;
MissingH = static-haskell.pkgsWithStaticHaskellBinaries.haskellPackages.MissingH_1_6_0_0;
};
devShell = pkgs.mkShell {
buildInputs = [
static-haskell.haskellPackagesWithLibsReadyForStaticLinking.ghc
static-haskell.haskellPackagesWithLibsReadyForStaticLinking.Cabal_3_0_0_0
static-haskell.haskellPackagesWithLibsReadyForStaticLinking.cabal-install
];
};
devShell = pkgs.mkShell { nativeBuildInputs = gg.nativeBuildInputs; };
in
{
inherit gg;
Expand Down
Loading

0 comments on commit 593ad1e

Please sign in to comment.