-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simple flake for multi cabal home Uses haskell-flake-utils (experimental) to provide build and devShell with nix flakes: ``` nix build .#rhine-gloss result/bin/rhine-gloss-gears ``` ``` nix develop cabal build rhine ``` Co-authored-by: Manuel Bärenz <[email protected]>
- Loading branch information
1 parent
a43d98b
commit 35625e7
Showing
19 changed files
with
158 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,3 +37,24 @@ jobs: | |
- name: Cabal test | ||
run: | | ||
cabal test all --enable-tests --test-show-details=Always --project-file=cabal.project.${{ matrix.ghc }} | ||
build-flake: | ||
name: Nix Flake | ||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-20.04 | ||
- macos-12 | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: cachix/install-nix-action@v15 | ||
- name: Build default package (rhine) | ||
run: nix build | ||
- name: Build default package (rhine-examples) | ||
run: nix build .#rhine-examples | ||
- name: Build default package (rhine-gloss) | ||
run: nix build .#rhine-gloss | ||
- name: Run tests | ||
run: nix develop -c cabal test all | ||
# nix flake check breaks on IFD in multi-platform flake https://github.com/NixOS/nix/issues/4265 | ||
# - run: nix flake check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,4 @@ cabal.sandbox.config | |
*.eventlog | ||
.stack-work/ | ||
cabal.project.local | ||
result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
attrs@{ ... }: | ||
|
||
let | ||
localPackages = import ./nix/localPackages.nix attrs; | ||
lock = builtins.fromJSON (builtins.readFile ./flake.lock); | ||
flake-compat-src = fetchTarball { | ||
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; | ||
sha256 = lock.nodes.flake-compat.locked.narHash; | ||
}; | ||
flake-compat = import flake-compat-src { src = ./.; }; | ||
in | ||
{ | ||
inherit (localPackages) | ||
rhine | ||
rhine-gloss | ||
rhine-examples | ||
; | ||
} | ||
flake-compat.defaultNix |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
description = "rhine"; | ||
nixConfig.bash-prompt = "\[rhine\]$ "; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
|
||
flake-compat = { | ||
url = "github:edolstra/flake-compat"; | ||
flake = false; | ||
}; | ||
|
||
haskell-flake-utils = { | ||
url = "github:ivanovs-4/haskell-flake-utils"; | ||
inputs.nixpkgs.follows = "nixpkgs"; | ||
inputs.flake-utils.follows = "flake-utils"; | ||
}; | ||
}; | ||
|
||
outputs = { self, nixpkgs, flake-utils, haskell-flake-utils, flake-compat, ... }: | ||
haskell-flake-utils.lib.simpleCabalProject2flake { | ||
inherit self nixpkgs; | ||
|
||
systems = [ | ||
# Tested in CI | ||
"x86_64-linux" | ||
"x86_64-darwin" | ||
# Tested by maintainers | ||
"aarch64-darwin" | ||
# Not sure we can test this in CI | ||
"i686-linux" | ||
]; | ||
|
||
name = "rhine"; | ||
packageNames = [ "rhine-gloss" "rhine-examples" ]; | ||
}; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
let | ||
mypkgs = import ./. {}; | ||
shellFrom = import ./nix/shellFrom.nix {}; | ||
in shellFrom mypkgs.rhine-gloss | ||
lock = builtins.fromJSON (builtins.readFile ./flake.lock); | ||
flake-compat-src = fetchTarball { | ||
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; | ||
sha256 = lock.nodes.flake-compat.locked.narHash; | ||
}; | ||
flake-compat = import flake-compat-src { src = ./.; }; | ||
in | ||
flake-compat.shellNix |