-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replace
nix-shell
with Nix Flake (#737)
* replace `nix-shell` with Nix Flake This `flake.nix` provides the same resources as the deleted Nix files with less code to maintain. This commit does not fix/update the docs generation via Nix; this remains TODO. * Nix Flake GitHub Action badge * test Nix Flake on both Mac and Linux * Apply suggestions from code review Co-authored-by: Ken Micklas <[email protected]> --------- Co-authored-by: Ken Micklas <[email protected]>
- Loading branch information
1 parent
8bab511
commit 6e85470
Showing
11 changed files
with
190 additions
and
103 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
use flake |
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,24 @@ | ||
name: "Nix Flake" | ||
on: | ||
pull_request: | ||
push: | ||
jobs: | ||
nix: | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
- macos-latest | ||
name: Nix on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: DeterminateSystems/nix-installer-action@main | ||
- uses: DeterminateSystems/magic-nix-cache-action@main | ||
- name: "Check `nix develop` shell" | ||
run: nix develop --check | ||
- name: "Check `nix develop` shell can run command" | ||
run: nix develop --command "true" | ||
- run: nix build | ||
- 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 |
---|---|---|
|
@@ -23,3 +23,4 @@ TAGS | |
docs/ChinookData | ||
result | ||
result-* | ||
.direnv |
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
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,62 @@ | ||
{ | ||
inputs = { | ||
nixpkgs.url = "github:nixos/nixpkgs"; | ||
flake-parts.url = "github:hercules-ci/flake-parts"; | ||
haskell-flake.url = "github:srid/haskell-flake"; | ||
|
||
testcontainers.url = | ||
"github:testcontainers/testcontainers-hs/e286bd2ba9747c2d8c3756a3a89910e579e318e3"; | ||
testcontainers.flake = false; | ||
}; | ||
outputs = inputs@{ self, nixpkgs, flake-parts, ... }: | ||
flake-parts.lib.mkFlake { inherit inputs; } { | ||
systems = nixpkgs.lib.systems.flakeExposed; | ||
imports = [ inputs.haskell-flake.flakeModule ]; | ||
|
||
perSystem = { self', pkgs, ... }: { | ||
|
||
haskellProjects.default = { | ||
basePackages = pkgs.haskell.packages.ghc98; | ||
|
||
packages = { | ||
testcontainers.source = inputs.testcontainers; | ||
}; | ||
settings = { | ||
testcontainers.check = false; | ||
beam-postgres.check = false; | ||
}; | ||
|
||
devShell = { | ||
enable = true; | ||
|
||
hlsCheck.enable = false; | ||
|
||
tools = hp: { | ||
inherit (pkgs) | ||
postgresql | ||
sqlite-interactive | ||
poetry | ||
curl | ||
pv # http://www.ivarch.com/programs/pv.shtml | ||
; | ||
}; | ||
}; | ||
}; | ||
|
||
packages.all = pkgs.symlinkJoin { | ||
name = "all"; | ||
paths = [ | ||
self'.packages.beam-core | ||
self'.packages.beam-migrate | ||
self'.packages.beam-postgres | ||
self'.packages.pagila | ||
self'.packages.beam-sqlite | ||
]; | ||
}; | ||
|
||
packages.default = self'.packages.all; | ||
|
||
# docs = import ./docs { inherit nixpkgs; }; | ||
}; | ||
}; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.