From ed445a76a4d1b67c6bfa6eb202cdb4582d6f0174 Mon Sep 17 00:00:00 2001 From: Bart Schuurmans Date: Tue, 17 Jan 2023 10:53:52 +0100 Subject: [PATCH] Simplify Stack Nix integration Let Stack generate the nix-shell internally instead of writing it manually. --- README.md | 10 +--------- nix/src.json | 6 ------ nix/update | 26 -------------------------- shell.nix | 19 ------------------- stack.yaml | 4 +++- 5 files changed, 4 insertions(+), 61 deletions(-) delete mode 100644 nix/src.json delete mode 100755 nix/update delete mode 100644 shell.nix diff --git a/README.md b/README.md index ba4044d..4b9189e 100644 --- a/README.md +++ b/README.md @@ -126,19 +126,11 @@ After running the script to install system dependencies, build the project with ## Build on NixOS -The `shell.nix` provides an environment containing the necessary +The `stack.yaml` file describes a NixOS environment containing the necessary dependencies. To build, run: $ stack --nix build -or alternatively you can run - - $ nix-shell - -to enter the environment and build the project. Note, that it is an emulation -of common Linux environment rather than full-featured Nix package expression. -No exportable Nix package will appear, but local development is possible. - ## Installation on CentOS [Xiaokui Shu (@subbyte)](https://github.com/subbyte) maintains [separate instructions for installation on CentOS](https://github.com/subbyte/haskell-learn/blob/master/tensorflow_setup.md). diff --git a/nix/src.json b/nix/src.json deleted file mode 100644 index d677276..0000000 --- a/nix/src.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "8731aaaf8b30888bc24994096db830993090d7c4", - "sha256": "1hcc89rxi47nb0mpk05nl9rbbb04kfw97xfydhpmmgh57yrp3zqa" -} diff --git a/nix/update b/nix/update deleted file mode 100755 index 3e70253..0000000 --- a/nix/update +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env nix-shell -#!nix-shell -i bash -p bash nix curl jq -# vim: filetype=sh -# Updates the nixpkgs.json to the latest release -# See https://gist.github.com/zimbatm/de5350245874361762b6a4dfe5366530 -set -euo pipefail - -cd "$(dirname "$0")" || exit 1 - -branch=release-19.09 - -owner=NixOS -repo=nixpkgs -rev=$(curl -sfL https://api.github.com/repos/$owner/$repo/git/refs/heads/$branch | jq -r .object.sha) -url=https://github.com/$owner/$repo/archive/$rev.tar.gz - -release_sha256=$(nix-prefetch-url --unpack "$url") - -cat <