Skip to content

Commit

Permalink
Merge pull request #6 from adetokunbo/use-dev-dot-nix
Browse files Browse the repository at this point in the history
Use dev.nix to simplify future nix dev updates
  • Loading branch information
adetokunbo authored Jan 29, 2024
2 parents 708bcac + 1238062 commit 2c88148
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
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

0 comments on commit 2c88148

Please sign in to comment.