Skip to content

Commit

Permalink
flake: Convert to flake-parts
Browse files Browse the repository at this point in the history
improves compositionality
  • Loading branch information
spacefrogg committed Oct 28, 2024
1 parent bb5d301 commit 03d55d0
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 46 deletions.
47 changes: 22 additions & 25 deletions flake.lock

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

41 changes: 20 additions & 21 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,43 @@
description = "A core language for rule-based hardware design";

inputs = {
flake-utils.url = "github:numtide/flake-utils";
flake-parts.url = "github:hercules-ci/flake-parts";
makes.url = "github:fluidattacks/makes/24.02";
nixpkgs.url = "github:nixos/nixpkgs/release-24.05";
};

outputs = {
self,
flake-utils,
makes,
nixpkgs,
...
}:
with flake-utils.lib;
eachDefaultSystem (system: let
pkgs = import nixpkgs {
outputs = { self, flake-parts, makes, nixpkgs, ... } @ inputs:
flake-parts.lib.mkFlake { inherit inputs; } {
# Original flake.outputs attribute set. Everything in this set behaves like
# usual flake outputs.
flake = {
# NOTE: To use this flake, apply the following overlay to nixpkgs and use
# koika from its respective coqPackages_VER attribute set!
# See _module.args.pkgs = ... below for an example!
overlays.default = import ./overlay.nix;
};
systems = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ];
perSystem = { inputs', self', system, pkgs, ... }: {
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
overlays = [self.overlays.default];
overlays = [ inputs.self.overlays.default ];
};
in {

checks = {
koika = self.packages.${system}.default.override {
doCheck = true;
};
};

devShells.default = self.checks.${system}.koika;
devShells.default = self'.checks.koika;

packages = {
default = self.packages.${system}.coq8_18-koika;
default = self'.packages.coq8_18-koika;
coq8_18-koika = pkgs.coqPackages_8_18.koika;
coqDev-koika = pkgs.coqPackages_koika.koika;
};

apps.makes = makes.apps.${system}.default;
})
// {
# NOTE: To use this flake, apply the following overlay to nixpkgs and use
# koika from its respective coqPackages_VER attribute set!
overlays.default = import ./overlay.nix;
apps.makes = inputs'.makes.apps.default;
};
};
}

0 comments on commit 03d55d0

Please sign in to comment.