Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update resolver, package with nix #31

Merged
merged 9 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
matrix:
runner:
- ubuntu-latest
- macOS-latest
- macos-12

fail-fast: false

Expand All @@ -37,3 +37,22 @@ jobs:
- uses: ./
with:
arguments: --path test/examples/lts-18.18.yaml --no-exit

nix:
strategy:
matrix:
runner:
- ubuntu-latest
- macos-12
- macos-latest
runs-on: ${{ matrix.runner }}
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v26
- uses: cachix/cachix-action@v14
with:
name: freckle
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Check
run: nix flake check --accept-flake-config --print-build-logs --keep-going
60 changes: 60 additions & 0 deletions flake.lock

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

99 changes: 99 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
{
inputs = {
nixpkgs = {
type = "github";
owner = "nixos";
repo = "nixpkgs";
ref = "nixos-unstable";
};
chris-martin marked this conversation as resolved.
Show resolved Hide resolved
stacklock2nix = {
type = "github";
owner = "cdepillabout";
repo = "stacklock2nix";
};
pgp-wordlist = {
type = "github";
owner = "quchen";
repo = "pgp-wordlist";
flake = false;
chris-martin marked this conversation as resolved.
Show resolved Hide resolved
};
};

outputs =
{
self,
nixpkgs,
pgp-wordlist,
stacklock2nix,
}:
let
supportedSystems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];

forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);

nixpkgsFor = forAllSystems (
system:
import nixpkgs {
inherit system;
overlays = [
stacklock2nix.overlay
self.overlays.default
];
}
);
in
{
# All packages provided by this flake
packages = forAllSystems (system: rec {
default = stack-lint-extra-deps;
stack-lint-extra-deps = nixpkgsFor.${system}.stack-lint-extra-deps;
});

overlays.default = final: prev: {
stack-lint-extra-deps-stacklock = final.stacklock2nix {

stackYaml = ./stack.yaml;

# GHC version that matches stack.yaml
baseHaskellPkgSet = final.haskell.packages.ghc966;
chris-martin marked this conversation as resolved.
Show resolved Hide resolved

# It is necessary to get this using a fetcher that doesn't unpack to
# preserve hash compatibility among case (in/)sensitive file systems.
all-cabal-hashes = final.fetchurl {
name = "all-cabal-hashes";
url = "https://github.com/commercialhaskell/all-cabal-hashes/archive/69c9ea6a7746281865968fdccf00a07f5e1bdc04.tar.gz";
sha256 = "1l9k4sg7pigr73749h4nkldllvl36d86sghjb5ibqpckkrbr3yky";
};

additionalHaskellPkgSetOverrides =
hfinal: hprev:
# Workarounds for issues in tests
nixpkgs.lib.genAttrs [
"ansi-wl-pprint"
"case-insensitive"
"integer-logarithms"
"lifted-base"
"prettyprinter"
"prettyprinter-compat-ansi-wl-pprint"
"primitive"
"quickcheck-instances"
"test-framework"
"uuid-types"
"yaml-marked"
] (name: final.haskell.lib.dontCheck hprev.${name});
};

stack-lint-extra-deps = final.stack-lint-extra-deps-stacklock.pkgSet.stack-lint-extra-deps;
};
};

nixConfig = {
extra-substituters = [ "https://freckle.cachix.org" ];
extra-trusted-public-keys = [ "freckle.cachix.org-1:WnI1pZdwLf2vnP9Fx7OGbVSREqqi4HM2OhNjYmZ7odo=" ];
};
}
4 changes: 3 additions & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
resolver: lts-22.6
resolver: lts-22.31
packages:
- .
extra-deps:
chris-martin marked this conversation as resolved.
Show resolved Hide resolved
- github: pbrisbin/yaml-marked
commit: 8fe21f6cf13b78f14c0fa41c84456b5dd32bd098
8 changes: 4 additions & 4 deletions stack.yaml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ packages:
url: https://github.com/pbrisbin/yaml-marked/archive/8fe21f6cf13b78f14c0fa41c84456b5dd32bd098.tar.gz
snapshots:
- completed:
sha256: 1b4c2669e26fa828451830ed4725e4d406acc25a1fa24fcc039465dd13d7a575
size: 714100
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/6.yaml
original: lts-22.6
sha256: acaab6ca693211938d1542abcb1c83a2f298b9f6b571854a9d38febe39b6408e
size: 719577
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/31.yaml
original: lts-22.31
Loading