Skip to content

Commit

Permalink
Move flake at top-level for it to work correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Niols committed Apr 28, 2023
1 parent 87842b8 commit 0dedc45
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -276,19 +276,19 @@ jobs:
- name: Install Nix dependencies
run: |
nix develop .github/nix#${{ matrix.package }} --command true
nix develop .#${{ matrix.package }} --command true
- name: Build in development Shell
run: |
nix develop .github/nix#${{ matrix.package }} --command make
nix develop .#${{ matrix.package }} --command make
- name: Run tests in development Shell
run: |
nix develop .github/nix#${{ matrix.package }} --command make check
nix develop .#${{ matrix.package }} --command make check
- name: Build with Nix
run: |
nix build .github/nix#${{ matrix.package }} --print-build-logs
nix build .#${{ matrix.package }} --print-build-logs
nix-flake-checks:
runs-on: ubuntu-latest
Expand All @@ -305,4 +305,4 @@ jobs:
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Run flake checks
run: nix flake check .github/nix --print-build-logs
run: nix flake check . --print-build-logs
6 changes: 3 additions & 3 deletions .github/nix/with-nixpkgs.nix → .nix/with-nixpkgs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
in {
packages.with-nixpkgs = pkgs.stdenv.mkDerivation {
name = "morbig";
## NOTE: The use of `../..` matters because the path is taken as relative to
## the current file, and therefore to `.github/nix/`.
src = ../..;
## NOTE: The use of `./..` matters because the path is taken as relative to
## the current file, and therefore to `.nix/`.
src = ./..;

nativeBuildInputs = with opkgs; [
## Basic ones, always necessary
Expand Down
6 changes: 3 additions & 3 deletions .github/nix/with-opam-nix.nix → .nix/with-opam-nix.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{ ... }: {
perSystem = { inputs', pkgs, ... }:
## NOTE: The use of `../..` matters because the path is taken as relative to
## the current file, and therefore to `.github/nix/`.
## NOTE: The use of `./..` matters because the path is taken as relative to
## the current file, and therefore to `.nix/`.
let
scope =
inputs'.opam-nix.lib.buildOpamProject { inherit pkgs; } "morbig" ../.. {
inputs'.opam-nix.lib.buildOpamProject { inherit pkgs; } "morbig" ./.. {
ocaml-base-compiler = "*";
};
in { packages.with-opam-nix = scope.morbig // { inherit scope; }; };
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions .github/nix/flake.nix → flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
systems = [ "x86_64-linux" ];

imports = [
./with-nixpkgs.nix
./with-opam-nix.nix
.nix/with-nixpkgs.nix
.nix/with-opam-nix.nix
inputs.pre-commit-hooks.flakeModule
];

Expand Down

0 comments on commit 0dedc45

Please sign in to comment.