Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use dev.nix to simplify future nix dev updates #6

Merged
merged 1 commit into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ if ! has nix_direnv_version || ! nix_direnv_version 2.1.1; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.1.1/direnvrc" "sha256-b6qJ4r34rbE23yWjMqbmu3ia2z4b2wIlZUksBke/ol0="
fi
use nix
nix_direnv_watch_file cabal.project mem-info.cabal
watch_file cabal.project mem-info.cabal h8x.nix dev.nix
12 changes: 4 additions & 8 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
let
pkgsNix = import ./h8x.nix;
dev = import ./dev.nix;
pkgs-nix = import ./h8x.nix;
in
{ pkgs ? pkgsNix
{ pkgs ? pkgs-nix
} : pkgs.haskell-nix.cabalProject {
# 'cleanGit' cleans a source directory based on the files known by git
src = pkgs.haskell-nix.haskellLib.cleanGit {
name = "mem-info";
src = ./.;
};

# Specify the GHC version to use.
compiler-nix-name = "ghc928";

# Specify the hackage index state
index-state = "2023-11-24T00:00:00Z";
inherit (dev) compiler-nix-name index-state;
}
10 changes: 10 additions & 0 deletions dev.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
# Pin haskell-nix to a recent (as of 2023/11/24) commit
h8x-commit = "c6e3c91844e91f86cb64015258eed2ed8545d2a9";

# Specify the GHC version to use.
compiler-nix-name = "ghc928";

# Specify the hackage index state
index-state = "2023-11-24T00:00:00Z";
}
4 changes: 2 additions & 2 deletions h8x.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
let
# Pin haskell-nix to a recent (as of 2023/11/24) commit
h8x-commit = "c6e3c91844e91f86cb64015258eed2ed8545d2a9";
dev = import ./dev.nix;
inherit (dev) h8x-commit;
h8x-pin = "https://github.com/input-output-hk/haskell.nix/archive/${h8x-commit}.tar.gz";
h8x-src = builtins.fetchTarball h8x-pin;
h8x = import h8x-src {};
Expand Down
Loading