diff --git a/.github/workflows/flake-check.yml b/.github/workflows/flake-check.yml index a54c7dc..bff7748 100644 --- a/.github/workflows/flake-check.yml +++ b/.github/workflows/flake-check.yml @@ -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 @@ -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 diff --git a/.github/workflows/update-flake-lock.yml b/.github/workflows/update-flake-lock.yml index fa5cf61..cf4d991 100644 --- a/.github/workflows/update-flake-lock.yml +++ b/.github/workflows/update-flake-lock.yml @@ -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 diff --git a/flake.lock b/flake.lock index ff5e0db..972c553 100644 --- a/flake.lock +++ b/flake.lock @@ -2,20 +2,17 @@ "nodes": { "effekt-nix": { "inputs": { - "flake-utils": [ - "flake-utils" - ], "nixpkgs": [ "nixpkgs" ], "sbt-derivation": "sbt-derivation" }, "locked": { - "lastModified": 1780507184, - "narHash": "sha256-HPtiQ0jLkm2ZwJGwmB7UcDW4MCL7Wi88i3VoyUCXtjs=", + "lastModified": 1789166023, + "narHash": "sha256-Q+igm4RBPpUVEcVgh40pPIao1moAWO+uxwu/cyU+W8s=", "owner": "jiribenes", "repo": "effekt-nix", - "rev": "e4b148dac1c84173e43dfe51c9e6eabf87246b11", + "rev": "2b5a66f861748ddf43df6e2c274d3133b965a4b5", "type": "github" }, "original": { @@ -24,31 +21,13 @@ "type": "github" } }, - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "nixpkgs": { "locked": { - "lastModified": 1782731455, - "narHash": "sha256-weCjCyph1saaHwUdjTk6AAFn/w2riVwOimn/qZMFxKY=", + "lastModified": 1789073787, + "narHash": "sha256-xfX/toC2QV707s06GbP4II/TxYF0fNQj7s5/LClNDKc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9c4c05a947a91dc14625265fab505fb695e93218", + "rev": "aff8a0b28396750446e5537a96461bc4facdb287", "type": "github" }, "original": { @@ -61,21 +40,11 @@ "root": { "inputs": { "effekt-nix": "effekt-nix", - "flake-utils": "flake-utils", "nixpkgs": "nixpkgs" } }, "sbt-derivation": { - "inputs": { - "flake-utils": [ - "effekt-nix", - "flake-utils" - ], - "nixpkgs": [ - "effekt-nix", - "nixpkgs" - ] - }, + "flake": false, "locked": { "lastModified": 1698464090, "narHash": "sha256-Pnej7WZIPomYWg8f/CZ65sfW85IfIUjYhphMMg7/LT0=", @@ -89,21 +58,6 @@ "repo": "sbt-derivation", "type": "github" } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index d059ce6..6664a2a 100644 --- a/flake.nix +++ b/flake.nix @@ -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; + }; + } + ); + }; }