diff --git a/flake.nix b/flake.nix index 6c52d2f..bb0524b 100644 --- a/flake.nix +++ b/flake.nix @@ -1,46 +1,53 @@ { - description = "devshell-dawn"; + description = "devshell-dorne"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; - nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; }; - outputs = { + outputs = inputs @ { self, nixpkgs, - nixpkgs-unstable, - ... }: let - system = "x86_64-linux"; + defaultSystems = ["aarch64-darwin" "aarch64-linux" "i686-linux" "x86_64-darwin" "x86_64-linux"]; - pkgs = import nixpkgs { - inherit system; - }; - pkgs-unstable = import nixpkgs-unstable { - inherit system; - }; + # forAllSystems = f: nixpkgs.lib.genAttrs defaultSystems (system: f system); + forAllSystems = f: + nixpkgs.lib.mapAttrs (nixpkgs.lib.genAttrs defaultSystems (system: + f system (import nixpkgs { + inherit system; + overlays = [self.overlay]; + }))); in { - devShells."${system}".default = pkgs.mkShell { - packages = with pkgs; [ - gnumake - bear - gcc - ]; - - shell = "${pkgs.bash}/bin/bash"; - }; - - packages."${system}" = rec { - default = dawn; - dawn = pkgs.haskellPackages.developPackage { + overlays.default = final: prev: { + dorne = final.haskellPackages.developPackage { root = ./.; modifier = drv: - pkgs.haskell.lib.addBuildTools drv (with pkgs.haskellPackages; [ + final.haskell.lib.addBuildTools drv (with final.haskellPackages; [ cabal-install ghcid ]); }; }; + + devShells = forAllSystems ( + system: pkgs: { + default = pkgs.mkShell { + packages = with pkgs; [ + gnumake + bear + gcc + ]; + + shell = "${pkgs.bash}/bin/bash"; + }; + } + ); + + checks = self.packages; + packages = forAllSystems (system: pkgs: rec { + default = dorne; + dorne = pkgs.dorne; + }); }; }