Skip to content

Commit 028d6d4

Browse files
committed
fix: Replace implicit NIX_PATH pinning with flake.lock
1 parent 4ecf2de commit 028d6d4

4 files changed

Lines changed: 79 additions & 15 deletions

File tree

.envrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
use nix
1+
use flake

default.nix

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
let
2-
# Use nixpkgs available on the system
3-
pkgs = import <nixpkgs> {};
1+
{ pkgs, ... }: let
42
haskellDependencies = with pkgs.haskellPackages; [
53
stack
64
cabal-install
@@ -16,15 +14,5 @@ let
1614
root = ./.;
1715
modifier = drv: addBuildTools drv haskellDependencies;
1816
};
19-
20-
# Extend the build environment with pre-commit installed and activated
21-
withPreCommitHook = old: {
22-
nativeBuildInputs = (old.nativeBuildInputs or []) ++ [ pkgs.pre-commit ];
23-
shellHook = (old.shellHook or "") + ''
24-
if [ -d .git ]; then
25-
pre-commit install --hook-type pre-push
26-
fi
27-
'';
28-
};
2917
in
30-
package.overrideAttrs withPreCommitHook
18+
package

flake.lock

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
description = "Opcode types for Ethereum Virtual Machine (EVM)";
3+
inputs = {
4+
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
5+
flake-parts.url = "github:hercules-ci/flake-parts";
6+
};
7+
8+
outputs = inputs:
9+
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
10+
systems = [ "x86_64-linux" "aarch64-darwin" ];
11+
perSystem = { config, self', pkgs, ... }: {
12+
packages.default = import ./default.nix { inherit pkgs; };
13+
};
14+
};
15+
}

0 commit comments

Comments
 (0)