Switch flake.nix architecture

This commit is contained in:
Kiana Sheibani 2022-03-11 23:01:32 -05:00
parent 6c3742e148
commit adb081fd22

View file

@ -1,7 +1,3 @@
# SPDX-FileCopyrightText: 2021 Serokell <https://serokell.io/>
#
# SPDX-License-Identifier: CC0-1.0
{ {
description = "Conway's Game of Life in Haskell"; description = "Conway's Game of Life in Haskell";
@ -13,44 +9,48 @@
outputs = { self, nixpkgs, flake-utils, ... }: outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system: flake-utils.lib.eachDefaultSystem (system:
let let
pkgs = nixpkgs.legacyPackages.${system}; overlays = [ ];
pkgs = import nixpkgs { inherit system overlays; config.allowBroken = true; };
haskellPackages = pkgs.haskellPackages;
jailbreakUnbreak = pkg:
pkgs.haskell.lib.doJailbreak (pkg.overrideAttrs (_: { meta = { }; }));
packageName = "conways-game-of-life";
execName = "gol"; execName = "gol";
in { hp = pkgs.haskellPackages; # pkgs.haskell.packages.ghc921;
packages.${packageName} = project = returnShellEnv:
haskellPackages.callCabal2nix packageName self rec { hp.developPackage {
# Dependency overrides go here inherit returnShellEnv;
name = "conways-game-of-life";
root = ./.;
withHoogle = false;
overrides = self: super: with pkgs.haskell.lib; {
# Use callCabal2nix to override Haskell dependencies here
# cf. https://tek.brick.do/K3VXJd8mEKO7
# Example:
# > NanoID = self.callCabal2nix "NanoID" inputs.NanoID { };
# Assumes that you have the 'NanoID' flake input defined.
};
modifier = drv:
pkgs.haskell.lib.addBuildTools drv (with hp; [
# Specify your build/dev dependencies here.
ghc
cabal-install
hlint
haskell-language-server
ormolu
pkgs.mesa
pkgs.mesa_glu
pkgs.freeglut
]);
}; };
in
{
# Used by `nix build` & `nix run` (prod exe)
defaultPackage = project false;
defaultPackage = self.packages.${system}.${packageName}; defaultApp = {
apps.${execName} = {
type = "app"; type = "app";
program = "${self.packages.${system}.${packageName}}/bin/${execName}"; program = "${self.defaultPackage.${system}}/bin/${execName}";
}; };
defaultApp = self.apps.${system}.${execName}; # Used by `nix develop` (dev shell)
devShell = project true;
devShell = pkgs.mkShell {
buildInputs = with haskellPackages; [
ghc
cabal-install
hlint
pkgs.haskell-language-server
pkgs.ormolu
pkgs.mesa
pkgs.mesa_glu
pkgs.freeglut
];
inputsFrom = builtins.attrValues self.packages.${system};
};
}); });
} }