Skip to content

Commit

Permalink
Nix config tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
icidasset committed Sep 24, 2022
1 parent 1a948e1 commit 830c35e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 47 deletions.
12 changes: 6 additions & 6 deletions flake.lock

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

41 changes: 1 addition & 40 deletions nix/shell.nix
Expand Up @@ -11,45 +11,6 @@
rustc = rust;
};

# Wraps
# -----
# Inspired by https://www.tweag.io/blog/2022-06-02-haskell-stack-nix-shell/

# https://github.com/NixOS/nixpkgs/issues/140774#issuecomment-976899227
m1HaskellPackages =
pkgs.haskellPackages.override {
overrides = self: super:
let
workaround140774 = hpkg: with pkgs.haskell.lib;
overrideCabal hpkg (drv: {
enableSeparateBinOutput = false;
});
in
{
ghcid = workaround140774 super.ghcid;
stack = workaround140774 super.stack;
};
};

stack-wrapped = symlinkJoin {
name = "stack";
paths =
[ (if isM1Mac
then m1HaskellPackages.stack
else haskellPackages.stack
)
];
buildInputs = [ makeWrapper ];
postBuild = ''
wrapProgram $out/bin/stack \
--add-flags "\
--nix \
--no-nix-pure \
--nix-shell-file=nix/stack-integration.nix \
"
'';
};

# Dependencies
# ------------

Expand All @@ -68,7 +29,7 @@
nodejs-18_x
nodePackages.pnpm
rust
stack-wrapped
stack
];

tauri = {
Expand Down
7 changes: 6 additions & 1 deletion stack.yaml
@@ -1,3 +1,8 @@
resolver: nightly-2022-09-10
resolver: nightly-2022-09-23
recommend-stack-upgrade: false
allow-newer: true

nix:
enable: true
pure: false
shell-file: nix/stack-integration.nix

0 comments on commit 830c35e

Please sign in to comment.