nix env for reproductible devenv and build

This commit is contained in:
Yann Esposito (Yogsototh) 2019-04-03 22:36:17 +02:00
parent ec626d5a08
commit 30e7c65955
Signed by untrusted user who does not match committer: yogsototh
GPG key ID: 7B19A4C650D59646
7 changed files with 43 additions and 3 deletions

1
.envrc Normal file
View file

@ -0,0 +1 @@
use_nix

View file

@ -1,8 +1,10 @@
-- This file has been generated from package.yaml by hpack version 0.28.2.
cabal-version: 1.12
-- This file has been generated from package.yaml by hpack version 0.31.2.
--
-- see: https://github.com/sol/hpack
--
-- hash: 2c0743c70d80e2ac0827c17be0cfb1ca6bfd0a613a186d520ce3faeddd522550
-- hash: cd60f98ce5adc1993e4769824e33298d5d80b96bd03e156d69698fae38f4ef5c
name: aggreact
version: 0.1.0.0
@ -16,7 +18,6 @@ copyright: © 2018 Yann Esposito
license: ISC
license-file: LICENSE
build-type: Simple
cabal-version: >= 1.10
extra-source-files:
README.md
stack.yaml

7
nix/nixpkgs.json Normal file
View file

@ -0,0 +1,7 @@
{
"url": "https://github.com/nixos/nixpkgs.git",
"rev": "e03966a60f517700f5fee5182a5a798f8d0709df",
"date": "2019-04-03T21:17:44+02:00",
"sha256": "1jwgzfnjgfcr67c7nz8hkw4a13qa296bv5cr6m36pfydw27aqdas",
"fetchSubmodules": false
}

10
nix/nixpkgs.nix Normal file
View file

@ -0,0 +1,10 @@
{ }:
let
hostpkgs = import <nixpkgs> {};
srcDef = builtins.fromJSON (builtins.readFile ./nixpkgs.json);
nixpkgs = hostpkgs.fetchFromGitHub {
owner = "NixOS";
repo = "nixpkgs";
inherit (srcDef) rev sha256;
};
in import nixpkgs { }

4
nix/update-nixpkgs-dev.sh Executable file
View file

@ -0,0 +1,4 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p nix-prefetch-git
nix-prefetch-git https://github.com/nixos/nixpkgs.git > ./nix/nixpkgs.json

5
nix/update-nixpkgs.sh Executable file
View file

@ -0,0 +1,5 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p nix-prefetch-git
nix-prefetch-git https://github.com/nixos/nixpkgs-channels.git \
--rev refs/heads/nixos-unstable > ./nix/nixpkgs.json

12
shell.nix Normal file
View file

@ -0,0 +1,12 @@
with import nix/nixpkgs.nix {};
mkShell {
name = "aggreact";
buildInputs = [ gnupg
haskellPackages.stack
haskellPackages.ghcid
];
LC_ALL = "en_US.UTF-8";
LANG = "en_US.UTF-8";
TMPDIR = "/tmp";
}