Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 5 additions & 14 deletions .github/workflows/flake-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,23 @@ on:
- main
pull_request:
types: [opened, reopened, synchronize]
repository_dispatch:
types: [create-pull-request]

permissions:
contents: read

jobs:
flake-check:
runs-on: "ubuntu-latest"
steps:
- name: "Checking out repository..."
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: "Installing and configuring the nix package manager..."
uses: cachix/install-nix-action@v31
with:
extra-nix-conf: |
extra_nix_config: |
accept-flake-config = true

# NOTE: Alternatively you can use the DeterminateSystems nix installer
# - name: "Installing and configuring the nix package manager..."
# uses: DeterminateSystems/nix-installer-action@main
# with:
# extra-conf: |
# accept-flake-config = true

- name: "Setting up packages..."
run: |
nix profile install nixpkgs#nix-fast-build # parallel nix builder
Expand All @@ -40,6 +34,3 @@ jobs:

- name: "Running `nix develop...`..."
run: nix-fast-build --skip-cached --no-nom --flake ".#devShells"

- name: "Checking flake inputs for stale & insecure nixpkgs versions..."
uses: DeterminateSystems/flake-checker-action@main
7 changes: 5 additions & 2 deletions .github/workflows/update-flake-lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ on:
jobs:
lockfile:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
uses: cachix/install-nix-action@v31
- name: Update flake.lock
uses: DeterminateSystems/update-flake-lock@main
60 changes: 7 additions & 53 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

108 changes: 58 additions & 50 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,62 +1,70 @@
{
## TODO: Change to your project's description:
description = "Implementation of Raytracing in a Weekend in Effekt";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
effekt-nix = {
url = "github:jiribenes/effekt-nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows ="flake-utils";
};
};

outputs = { self, nixpkgs, flake-utils, effekt-nix }:
## If you want only some specific systems, do the following instead:
# flake-utils.lib.eachSystem ["aarch64-linux" "aarch64-darwin"] (system:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
effekt-lib = effekt-nix.lib.${system};

## Project configuration
# TODO: Change to your project's details:
pname = "tracing-effective-rays"; # package name
version = "0.1.0"; # package version
mainFile = "src/main.effekt"; # relative path to entrypoint (as a string)
testFiles = [ "src/test.effekt" ]; # relative paths to tests (as a string)

## Effekt configuration
effektConfig = {
## Uncomment and set a specific version if needed:
# version = "0.10.0";

## Select the backends that your project works on:
backends = with effekt-lib.effektBackends; [ js ];
};

# Chooses the correct Effekt package.
effektBuild = effekt-lib.getEffekt effektConfig;
in {
packages.default = effekt-lib.buildEffektPackage {
inherit pname version;
src = ./.;
main = mainFile;
tests = testFiles;

effekt = effektBuild;
inherit (effektConfig) backends;
};

devShells.default = effekt-lib.mkDevShell {
effekt = effektBuild;
};

apps.default = flake-utils.lib.mkApp {
drv = self.packages.${system}.default;
name = pname;
};
}
);
outputs = { self, nixpkgs, effekt-nix }:
let
## Builds for all systems supported by effekt-nix.
## If you want only some specific systems, do the following instead:
# systems = ["aarch64-linux" "aarch64-darwin"];
systems = effekt-nix.lib.supportedSystems;

forAllSystems = nixpkgs.lib.genAttrs systems;
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });

## Project configuration
pname = "tracing-effective-rays"; # package name
version = "0.1.0"; # package version
mainFile = "src/main.effekt"; # relative path to entrypoint (as a string)
testFiles = [ "src/test.effekt" ]; # relative paths to tests (as a string)

## Effekt configuration
effektConfig = {
## Uncomment and set a specific version if needed:
# version = "0.10.0";

## Select the backends that your project works on:
backends = bs: with bs; [ js ];
};
in {
packages = forAllSystems (system:
let
effekt-lib = effekt-nix.lib.mkLib nixpkgsFor.${system};

# Chooses the correct Effekt package.
effektBuild = effekt-lib.getEffekt effektConfig;
in {
default = effekt-lib.buildEffektPackage {
inherit pname version;
src = ./.;
main = mainFile;
tests = testFiles;

effekt = effektBuild;
inherit (effektConfig) backends;
};
}
);

devShells = forAllSystems (system:
let
effekt-lib = effekt-nix.lib.mkLib nixpkgsFor.${system};

# Chooses the correct Effekt package.
effektBuild = effekt-lib.getEffekt effektConfig;
in {
default = effekt-lib.mkDevShell {
effekt = effektBuild;
inherit (effektConfig) backends;
};
}
);
};
}