hapistrano/flake.nix
Sebastián Estrella d0c08771c4
Reproducible development and test environments (#212)
* Setting up Nix / Running the build using Nix

* Delete other CI workflows (temporarily)

* Add cabal update

* Cache dependencies

* Run tests

* Add missing dependency required for testing

* Add macos-latest runner

* Exclude GHC 8.10 on macos-latest

* Trying something with haskell.nix overlays

* Trying to compile the project with an external flake

* Pass --accept-flake-config flag

* Install GHC package provided by haskell-nix

* Pass --accept-flake-config and enable ubuntu-latest

* Remove hello project

* Update substituters

* Test with ubuntu

* Disable macos

* Add stdenv.cc.cc.lib

* Testing ghc90 running on ubuntu-latest

* Install GMP dev

* Remove .dev from gmp

* Use propagatedBuildInputs

* Install stdenv

* Add --verbose=3

* Test ghc810 running on ubuntu-latest

* Install libstdc++6

* Fix typo

* Run nix-info

* Add nix-path

* List /usr/lib/x86_64-linux-gnu

* Run cabal clean before cabal build

* Run without cache

* Turn on cache again

* Run all builds

* Run ghc90 on ubuntu-latest only

* Install ghc from haskell on Linux and haskell-nix on Mac

* Re-enable cache

* Add labels to steps

* Add scripts to run nix-shells

* Install zsh

* Exclude GHC 8.10 from macOS

* Install zsh only on Linux

* Minor refactoring

* Merge nix workflow into build

* Remove nix workflow

* Update README file

* Fix merge conflicts

* Fix runs-on

* Add cache.nixos.org config

* Exclude ghc90 on macos-latest

* Add note about GHC 9.0 running on macOS

* Update flake.lock

* Run GHC 9.0 (macOS)

* Print GHC and cabal versions

* Disable docker job (temp change)

* Fix compilation issue

* Refactor documentation

* Re-enable docker job

* Update comment in the .cabal file

* Revert .cabal file changes

* Extract nix content to a separate file

* Extract nix content to a separate file

* Update README file

* Update TODO section

* Remove .tmuxinator.yml

* Remove table of content from the README file

* Fix typo in command

* Update Nix docs

* Update restart instructions
2023-04-18 08:27:59 -05:00

45 lines
1.4 KiB
Nix

{
inputs = {
flake-utils.url = "github:numtide/flake-utils";
haskellNix.url = "github:input-output-hk/haskell.nix/0.0.117";
nixpkgs.follows = "haskellNix/nixpkgs-unstable";
};
outputs = { self, flake-utils, haskellNix, nixpkgs }:
let
supportedSystems = [
"aarch64-darwin"
"x86_64-darwin"
"x86_64-linux"
];
in
flake-utils.lib.eachSystem supportedSystems (system:
let
# https://input-output-hk.github.io/haskell.nix/tutorials/getting-started-flakes.html
pkgs = import nixpkgs {
system = if system == "aarch64-darwin" then "x86_64-darwin" else system;
overlays = [ haskellNix.overlay ];
inherit (haskellNix) config;
};
in
{
devShells = rec {
ghc810 = import ./shell.nix { inherit pkgs; ghcVersion = "8.10"; };
ghc90 = import ./shell.nix { inherit pkgs; ghcVersion = "9.0"; };
default = ghc90;
};
});
# --- Flake Local Nix Configuration ----------------------------
nixConfig = {
# This sets the flake to use the IOG nix cache.
# Nix should ask for permission before using it,
# but remove it here if you do not want it to.
extra-substituters = [ "https://cache.iog.io" ];
extra-trusted-public-keys = [
"hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="
];
allow-import-from-derivation = "true";
};
}