Skip to content

Commit

Permalink
Miscellaneous updates and bumps (#117)
Browse files Browse the repository at this point in the history
* raise default stack resolver
    (bumps ghc from 9.2.6 to 9.2.7)
* Raise nix shell ghc from 9.2.6 to 9.2.7
* expose dependencies from the nix flake
    (This is the same change I made in megarepo; it makes it easy
    to build individual dependencies and then do things like upload
    them to a cache.)
* change mkShell arg from 'buildInputs' to 'packages'
    (Not sure it makes a difference but packages is the more documented path)
* remove import-from-derivation from fourmolu definition
* upgrade monad-validate to 1.3 in nightly
  • Loading branch information
chris-martin authored Sep 18, 2023
1 parent d3dd4f9 commit 208b01f
Show file tree
Hide file tree
Showing 12 changed files with 87 additions and 31 deletions.
12 changes: 6 additions & 6 deletions flake.lock

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

8 changes: 5 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"github:nixos/nixpkgs/nixos-unstable";

/* Hash obtained from https://www.nixhub.io/packages/ghc */
ghc926.url =
"github:nixos/nixpkgs/796b4a3c1d903c4b9270cd2548fe46f524eeb886";
ghc927.url =
"github:nixos/nixpkgs/16b3b0c53b1ee8936739f8c588544e7fcec3fc60";

flake-utils.url = "github:numtide/flake-utils";
};
Expand All @@ -30,12 +30,14 @@
nixpkgs = {
stable = import inputs.stable nixpkgsArgs;
unstable = import inputs.unstable nixpkgsArgs;
ghc926 = import inputs.ghc926 nixpkgsArgs;
ghc927 = import inputs.ghc927 nixpkgsArgs;
};

in
{
devShells.default =
import ./nix/shell.nix { inherit nixpkgs; };
packages =
import ./nix { inherit nixpkgs; };
});
}
14 changes: 14 additions & 0 deletions nix/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{ nixpkgs }:
{
cabal = import ./cabal.nix { inherit nixpkgs; };

fourmolu = import ./fourmolu { inherit nixpkgs; };

ghc-with-packages = import ./ghc-with-packages.nix { inherit nixpkgs; };

haskell-language-server = import ./haskell-language-server.nix { inherit nixpkgs; };

haskell-native-dependencies = import ./haskell-native-dependencies.nix { inherit nixpkgs; };

stack = import ./stack.nix { inherit nixpkgs; };
}
2 changes: 1 addition & 1 deletion nix/fourmolu.nix → nix/fourmolu/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ justStaticExecutables
overrides = self: super: {
fourmolu =
overrideCabal
(super.callHackage "fourmolu" "0.13.0.0" { })
(super.callPackage ./fourmolu.nix { })
(drv: { doCheck = false; });
};
}).fourmolu
33 changes: 33 additions & 0 deletions nix/fourmolu/fourmolu.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{ mkDerivation, aeson, ansi-terminal, array, base, binary
, bytestring, Cabal-syntax, containers, deepseq, Diff, directory
, file-embed, filepath, ghc-lib-parser, hspec, hspec-discover
, hspec-megaparsec, lib, megaparsec, MemoTrie, mtl
, optparse-applicative, path, path-io, pretty, process, QuickCheck
, scientific, syb, temporary, text, th-env, yaml
}:
mkDerivation {
pname = "fourmolu";
version = "0.13.0.0";
sha256 = "5102c41c159f41901cde28728d8f4e9feb443f3c4c8798a5c21ba78872fda257";
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
aeson ansi-terminal array base binary bytestring Cabal-syntax
containers deepseq Diff directory file-embed filepath
ghc-lib-parser megaparsec MemoTrie mtl scientific syb text yaml
];
executableHaskellDepends = [
base Cabal-syntax containers directory filepath ghc-lib-parser
optparse-applicative text th-env yaml
];
testHaskellDepends = [
base Cabal-syntax containers Diff directory filepath ghc-lib-parser
hspec hspec-megaparsec megaparsec path path-io pretty process
QuickCheck temporary text
];
testToolDepends = [ hspec-discover ];
homepage = "https://github.com/fourmolu/fourmolu";
description = "A formatter for Haskell source code";
license = lib.licenses.bsd3;
mainProgram = "fourmolu";
}
2 changes: 1 addition & 1 deletion nix/ghc-with-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ build reproducibility and being able to utilize the nix binary cache for speed.
*/
{ nixpkgs }:
let
haskellPackages = nixpkgs.ghc926.haskellPackages.override {
haskellPackages = nixpkgs.ghc927.haskellPackages.override {
inherit (nixpkgs.unstable) all-cabal-hashes;
overrides = import ./haskell-package-overrides.nix
{ inherit nixpkgs; };
Expand Down
2 changes: 1 addition & 1 deletion nix/haskell-language-server.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{ nixpkgs }:
nixpkgs.stable.haskell-language-server.override
{ supportedGhcVersions = [ "926" ]; }
{ supportedGhcVersions = [ "927" ]; }
20 changes: 10 additions & 10 deletions nix/shell.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{ nixpkgs }:
nixpkgs.stable.mkShell {
name = "freckle-app-shell";
buildInputs =
map (x: import x { inherit nixpkgs; })
[
./cabal.nix
./fourmolu.nix
./ghc-with-packages.nix
./haskell-language-server.nix
./haskell-native-dependencies.nix
./stack.nix
];
packages =
with (import ./. { inherit nixpkgs; });
[
cabal
fourmolu
ghc-with-packages
haskell-language-server
haskell-native-dependencies
stack
];
}
2 changes: 1 addition & 1 deletion stack-nightly.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
resolver: nightly-2023-02-27
extra-deps:
- monad-validate-1.2.0.1
- monad-validate-1.3.0.0

# For OTel
- hs-opentelemetry-api-0.0.3.6
Expand Down
13 changes: 10 additions & 3 deletions stack-nightly.yaml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

packages:
- completed:
hackage: monad-validate-1.2.0.1@sha256:5a100da896f11ca4b7c123da85decbedeb46c37054a097f258ac911e715cb68d,2587
hackage: monad-validate-1.3.0.0@sha256:eb6ddd5c9cf72ff0563cba604fa00291376e96138fdb4932d00ff3a99d66706e,2605
pantry-tree:
sha256: 034ee4de9765e38b763f5d73b236cc112205728e680cefbfe12d2882accc3264
sha256: 0b2a3a57be48fcc739708b214fca202f1e95b1cd773dd3bb9589d3007cf8cf5e
size: 611
original:
hackage: monad-validate-1.2.0.1
hackage: monad-validate-1.3.0.0
- completed:
hackage: hs-opentelemetry-api-0.0.3.6@sha256:76345dca8efda3040f58e85fa8b17264505177928bd035936132448715437a7c,3428
pantry-tree:
Expand Down Expand Up @@ -39,6 +39,13 @@ packages:
size: 424
original:
hackage: hs-opentelemetry-instrumentation-persistent-0.0.1.0
- completed:
hackage: hs-opentelemetry-instrumentation-wai-0.0.1.3@sha256:417c714052ee94b8b6a7f2b303ee92908c232f6d44a1a1c6232acf17434be753,1767
pantry-tree:
sha256: c1fa4fee66d3cb299276e2a32d1d027ac26ab9a354665e7bc95f6e163922194d
size: 411
original:
hackage: hs-opentelemetry-instrumentation-wai-0.0.1.3
- completed:
hackage: hs-opentelemetry-otlp-0.0.1.0@sha256:88bb6b68f172a336f78018b0823f47363fb7408eb19f7301489f81ad4d5c0f33,2307
pantry-tree:
Expand Down
2 changes: 1 addition & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resolver: lts-20.12
resolver: lts-20.20
extra-deps:
- monad-validate-1.2.0.1

Expand Down
8 changes: 4 additions & 4 deletions stack.yaml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ packages:
hackage: thread-utils-finalizers-0.1.0.0
snapshots:
- completed:
sha256: af5d667f6096e535b9c725a72cffe0f6c060e0568d9f9eeda04caee70d0d9d2d
size: 649133
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/20/12.yaml
original: lts-20.12
sha256: 126fa33ceb11f5e85ceb4e86d434756bd9a8439e2e5776d306a15fbc63b01e89
size: 650041
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/20/20.yaml
original: lts-20.20

0 comments on commit 208b01f

Please sign in to comment.