Improve flake.nix

This commit is contained in:
Andrea Bedini 2022-05-16 17:54:15 +08:00
parent 4af477a937
commit 8f3c76a262
No known key found for this signature in database
GPG Key ID: EE8DEB94262733BE
2 changed files with 36 additions and 33 deletions

View File

@ -146,7 +146,7 @@
"type": "github" "type": "github"
} }
}, },
"haskellNix": { "haskell-nix": {
"inputs": { "inputs": {
"HTTP": "HTTP", "HTTP": "HTTP",
"cabal-32": "cabal-32", "cabal-32": "cabal-32",
@ -160,7 +160,7 @@
"hydra": "hydra", "hydra": "hydra",
"nix-tools": "nix-tools", "nix-tools": "nix-tools",
"nixpkgs": [ "nixpkgs": [
"haskellNix", "haskell-nix",
"nixpkgs-unstable" "nixpkgs-unstable"
], ],
"nixpkgs-2003": "nixpkgs-2003", "nixpkgs-2003": "nixpkgs-2003",
@ -204,7 +204,7 @@
"inputs": { "inputs": {
"nix": "nix", "nix": "nix",
"nixpkgs": [ "nixpkgs": [
"haskellNix", "haskell-nix",
"hydra", "hydra",
"nix", "nix",
"nixpkgs" "nixpkgs"
@ -390,9 +390,9 @@
"root": { "root": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"haskellNix": "haskellNix", "haskell-nix": "haskell-nix",
"nixpkgs": [ "nixpkgs": [
"haskellNix", "haskell-nix",
"nixpkgs-unstable" "nixpkgs-unstable"
] ]
} }

View File

@ -2,41 +2,44 @@
description = "Foliage is a tool to create custom Haskell package repositories, in a fully reproducible way."; description = "Foliage is a tool to create custom Haskell package repositories, in a fully reproducible way.";
inputs = { inputs = {
nixpkgs.follows = "haskellNix/nixpkgs-unstable"; nixpkgs.follows = "haskell-nix/nixpkgs-unstable";
haskellNix.url = "github:input-output-hk/haskell.nix"; haskell-nix.url = "github:input-output-hk/haskell.nix";
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
}; };
outputs = { self, nixpkgs, flake-utils, haskellNix }: outputs = { self, nixpkgs, flake-utils, haskell-nix }:
flake-utils.lib.eachSystem [ "x86_64-linux" "x86_64-darwin" ] (system: flake-utils.lib.eachDefaultSystem (system:
let let
overlays = [ haskellNix.overlay pkgs = import nixpkgs { inherit system; inherit (haskell-nix) config; overlays = [haskell-nix.overlay]; };
(final: prev: { project = pkgs.haskell-nix.cabalProject {
foliage = src = ./.;
final.haskell-nix.project' { compiler-nix-name = "ghc8107";
src = ./.; shell.tools = {
compiler-nix-name = "ghc8107"; cabal = {};
shell.tools = { hlint = {};
cabal = {}; haskell-language-server = {};
hlint = {}; };
haskell-language-server = {}; shell.buildInputs = with pkgs; [
}; nixpkgs-fmt
shell.buildInputs = with pkgs; [ ];
nixpkgs-fmt modules = [{
]; packages.foliage.components.exes.foliage.dontStrip = false;
modules = [{ }];
packages.foliage.components.exes.foliage.dontStrip = false; };
}]; in {
}; packages.default = project.foliage.components.exes.foliage;
})
];
pkgs = import nixpkgs { inherit system overlays; inherit (haskellNix) config; };
flake = pkgs.foliage.flake { };
in flake // {
defaultPackage = flake.packages."foliage:exe:foliage";
devShell = pkgs.mkShell { devShell = pkgs.mkShell {
name = "foliage-dev-shell"; name = "foliage-dev-shell";
}; };
}); });
nixConfig = {
extra-substituters = [
"https://hydra.iohk.io"
];
extra-trusted-public-keys = [
"hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="
];
};
} }