Skip to content

Commit c659b5b

Browse files
committed
Add flake.nix, .envrc
1 parent 217af9c commit c659b5b

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

.envrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
if ! has nix_direnv_version || ! nix_direnv_version 2.2.0; then
3+
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.0/direnvrc" "sha256-5EwyKnkJNQeXrRkYbwwRBcXbibosCJqyIUuz9Xq+LRc="
4+
fi
5+
6+
use_flake

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
dist-newstyle
44
*.hie
55
dev/
6+
7+
.direnv

flake.nix

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
description = "aeson-typescript";
3+
4+
inputs.nixpkgs.url = "github:NixOS/nixpkgs/release-24.05";
5+
inputs.nixpkgsMaster.url = "github:NixOS/nixpkgs/master";
6+
inputs.flake-utils.url = "github:numtide/flake-utils";
7+
8+
outputs = { self, nixpkgs, nixpkgsMaster, flake-utils }:
9+
flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:
10+
let
11+
pkgs = import nixpkgs { inherit system; };
12+
pkgsMaster = import nixpkgsMaster { inherit system; };
13+
in
14+
{
15+
packages = {
16+
inherit (pkgsMaster.haskell.packages.ghc966) weeder;
17+
18+
test = pkgs.writeShellScriptBin "stack-test" ''
19+
export NIX_PATH=nixpkgs=${pkgs.path}
20+
${pkgs.stack}/bin/stack test
21+
'';
22+
23+
nixpkgsPath = pkgs.writeShellScriptBin "nixpkgsPath.sh" "echo -n ${pkgs.path}";
24+
};
25+
26+
devShells.default = pkgs.mkShell {
27+
buildInputs = with pkgs; [
28+
nodejs
29+
];
30+
};
31+
});
32+
}

0 commit comments

Comments
 (0)