Skip to content

Commit

Permalink
Merge pull request #210 from DougBurke/flake-updates
Browse files Browse the repository at this point in the history
flake updates
  • Loading branch information
DougBurke authored Nov 18, 2024
2 parents 29950a2 + 4151235 commit 218241d
Show file tree
Hide file tree
Showing 9 changed files with 116 additions and 26 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/hvega-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ jobs:
cabal: ["latest"]

os: [ubuntu-latest]
ghc-version: ["9.6", "9.4", "9.2", "9.0", "8.10"]
ghc-version: ["9.10", "9.8", "9.6", "9.4"]

include:
- os: macOS-latest
ghc-version: '9.4'
ghc-version: '9.6'
- os: windows-latest
ghc-version: '9.4'
ghc-version: '9.6'

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/main'

- uses: haskell/actions/setup@v2
- uses: haskell-actions/setup@v2
id: setup-haskell-cabal
name: Setup Haskell
with:
Expand Down Expand Up @@ -84,20 +84,25 @@ jobs:
run: |
cabal test all
#- name: Cabal check
# working-directory: ./hvega
# run: |
# cabal check

# test the hvega/stack.yaml setup (so need to keep the versions up to date)
stack:
name: stack / ghc ${{ matrix.ghc }}
runs-on: ubuntu-latest
strategy:
matrix:
stack: ["latest"]
ghc: ["9.4"]
ghc: ["9.6"]

steps:
- uses: actions/checkout@v3
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/main'

- uses: haskell/actions/setup@v2
- uses: haskell-actions/setup@v2
name: Setup Haskell Stack
with:
ghc-version: ${{ matrix.ghc }}
Expand Down
25 changes: 25 additions & 0 deletions flake.lock

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

58 changes: 58 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
# inspired by: https://serokell.io/blog/practical-nix-flakes#packaging-existing-applications
description = "explore hvega and IHaskell";

inputs = {
nixpkgs.url = "nixpkgs";
# IHaskell.url = "github:IHaskell/IHaskell";
};

# outputs = { self, nixpkgs, IHaskell }:
outputs = { self, nixpkgs }:
let
supportedSystems = [ "x86_64-linux" "x86_64-darwin" ];
# supportedSystems = [ "x86_64-linux" ];
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
nixpkgsFor = forAllSystems (system: import nixpkgs {
inherit system;
overlays = [ self.overlay ];
});
in
{
overlay = (final: prev: {
hvega = final.haskellPackages.callCabal2nix "hvega" ./hvega {};
ihaskell-hvega = final.haskellPackages.callCabal2nix "ihaskell-hvega" ./ihaskell-hvega {};
});
packages = forAllSystems (system: {
hvega = nixpkgsFor.${system}.hvega;
ihaskell-hvega = nixpkgsFor.${system}.ihaskell-hvega;
});
# what do we want for the defaultPackage here?
defaultPackage = forAllSystems (system: self.packages.${system}.hvega);
checks = self.packages;
devShell = forAllSystems (system: let haskellPackages = nixpkgsFor.${system}.haskellPackages;
in haskellPackages.shellFor {
packages = p: [self.packages.${system}.hvega
self.packages.${system}.ihaskell-hvega];
# withHoogle = true;
withHoogle = false; # faster ...
buildInputs = with haskellPackages; [
haskell-language-server
hlint
cabal-install
ihaskell
nixpkgsFor.${system}.jupyter
];
# Change the prompt to show that you are in a devShell
shellHook = ''
echo -e "*** \e[1;32mWelcome to hvega development\e[0m ***"
ghc --version
cabal --version
hlint --version
echo -e "IHaskell: `ihaskell --version`"
echo -e ""
export PS1='hvegadev:\A \e[1;34m\w\e[0m '
'';
});
};
}
6 changes: 3 additions & 3 deletions hvega/flake.lock

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

3 changes: 2 additions & 1 deletion hvega/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
devShell = forAllSystems (system: let haskellPackages = nixpkgsFor.${system}.haskellPackages;
in haskellPackages.shellFor {
packages = p: [self.packages.${system}.hvega];
withHoogle = true;
# withHoogle = true;
withHoogle = false;
buildInputs = with haskellPackages; [
haskell-language-server
hlint
Expand Down
2 changes: 1 addition & 1 deletion hvega/stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ packages:

extra-deps: []

resolver: lts-21.2
resolver: lts-22.42
6 changes: 3 additions & 3 deletions ihaskell-hvega/flake.lock

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

3 changes: 2 additions & 1 deletion ihaskell-hvega/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
devShell = forAllSystems (system: let haskellPackages = nixpkgsFor.${system}.haskellPackages;
in haskellPackages.shellFor {
packages = p: [self.packages.${system}.ihaskell-hvega];
withHoogle = true;
# withHoogle = true;
withHoogle = false;
buildInputs = with haskellPackages; [
haskell-language-server
hlint
Expand Down
20 changes: 10 additions & 10 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"homepage": null,
"owner": "gibiansky",
"repo": "IHaskell",
"rev": "c547ee2fdc0a09cf4129b19292147fec38527a55",
"sha256": "0ail2r2kn1zlsny6f4sjrw6zs9kfj69ip82cf46da7kn2rv155cn",
"rev": "bf7d4cb2be3d9dd5fb7d6875a998245a725e8fb2",
"sha256": "0zzb7jn4hl3iv1xz85a38fm0iis3r43hn48qwvj4zgvsv4la4m0x",
"type": "tarball",
"url": "https://github.com/gibiansky/IHaskell/archive/c547ee2fdc0a09cf4129b19292147fec38527a55.tar.gz",
"url": "https://github.com/gibiansky/IHaskell/archive/bf7d4cb2be3d9dd5fb7d6875a998245a725e8fb2.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"niv": {
Expand All @@ -17,22 +17,22 @@
"homepage": "https://github.com/nmattia/niv",
"owner": "nmattia",
"repo": "niv",
"rev": "914aba08a26cb10538b84d00d6cfb01c9776d80c",
"sha256": "0gx316gc7prjay5b0cr13x4zc2pdbiwxkfkpjvrlb2rml80lm4pm",
"rev": "55422d6f2618cd2195eeafa3f16ae63fde723c15",
"sha256": "1s6m41hhsydf3lw6ihksc904vcpyd5agwiqq8hb8plyqvsyn74ba",
"type": "tarball",
"url": "https://github.com/nmattia/niv/archive/914aba08a26cb10538b84d00d6cfb01c9776d80c.tar.gz",
"url": "https://github.com/nmattia/niv/archive/55422d6f2618cd2195eeafa3f16ae63fde723c15.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"nixpkgs": {
"branch": "release-23.05",
"branch": "release-23.11",
"description": "Nix Packages collection",
"homepage": "",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "09798f0dd4c11b431765275893d9d395c1e203b8",
"sha256": "0722086ipwl49a1dxqc4clz3yqa7086a41ya3f2hf67gnnk4xr7q",
"rev": "205fd4226592cc83fd4c0885a3e4c9c400efabb5",
"sha256": "1f5d2g1p6nfwycpmrnnmc2xmcszp804adp16knjvdkj8nz36y1fg",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/09798f0dd4c11b431765275893d9d395c1e203b8.tar.gz",
"url": "https://github.com/NixOS/nixpkgs/archive/205fd4226592cc83fd4c0885a3e4c9c400efabb5.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}
}

0 comments on commit 218241d

Please sign in to comment.