-
-
Notifications
You must be signed in to change notification settings - Fork 155
Flake-enable project #587
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
Open
Gabriella439
wants to merge
5
commits into
NixOS:master
Choose a base branch
from
Gabriella439:gabriella/flakes
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Flake-enable project #587
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ff8f308
Flake-enable project
Gabriella439 8227124
Track `nixpkgs-unstable` instead of a specific release
Gabriella439 0131389
Remove `package` outputs
Gabriella439 5278239
Add `language-nix` dependency to `cabal2nix`
Gabriella439 3f39ad6
Remove `default.nix`
Gabriella439 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
(import | ||
( | ||
let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in | ||
fetchTarball { | ||
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; | ||
sha256 = lock.nodes.flake-compat.locked.narHash; | ||
} | ||
) | ||
{ src = ./.; } | ||
).defaultNix |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
{ inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/release-22.11"; | ||
|
||
flake-compat = { | ||
url = "github:edolstra/flake-compat"; | ||
flake = false; | ||
}; | ||
|
||
flake-utils.url = "github:numtide/flake-utils/v1.0.0"; | ||
}; | ||
|
||
outputs = { nixpkgs, flake-utils, ... }: | ||
flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
ghcVersion = "ghc90"; | ||
|
||
config = { }; | ||
|
||
overlay = self: super: { | ||
haskell = super.haskell // { | ||
packages = super.haskell.packages // { | ||
"${ghcVersion}" = super.haskell.packages."${ghcVersion}".override (old: { | ||
overrides = | ||
self.lib.composeExtensions | ||
(old.overrides or (_: _: { })) | ||
(hself: hsuper: { | ||
# The reason we stick these underneath a `local` attribute | ||
# is to avoid infinite recursion (because `callCabal2nix` | ||
# depends on all of these packages. | ||
local = rec { | ||
cabal2nix = | ||
hself.callCabal2nix "cabal2nix" ./cabal2nix { | ||
inherit distribution-nixpkgs hackage-db; | ||
}; | ||
|
||
distribution-nixpkgs = | ||
hself.callCabal2nix | ||
"distribution-nixpkgs" | ||
./distribution-nixpkgs | ||
{ inherit language-nix; }; | ||
|
||
hackage-db = | ||
hself.callCabal2nix "hackage-db" ./hackage-db { }; | ||
|
||
language-nix = | ||
hself.callCabal2nix "language-nix" ./language-nix { }; | ||
}; | ||
}); | ||
}); | ||
}; | ||
}; | ||
}; | ||
|
||
pkgs = | ||
import nixpkgs { inherit config system; overlays = [ overlay ]; }; | ||
|
||
in | ||
rec { | ||
packages = rec { | ||
inherit (pkgs.haskell.packages."${ghcVersion}".local) | ||
cabal2nix | ||
hackage-db | ||
distribution-nixpkgs | ||
language-nix | ||
; | ||
|
||
default = cabal2nix; | ||
}; | ||
|
||
devShells = rec { | ||
cabal2nix = | ||
pkgs.haskell.packages."${ghcVersion}".local.cabal2nix.env; | ||
|
||
distribution-nixpkgs = | ||
pkgs.haskell.packages."${ghcVersion}".local.distribution-nixpkgs.env; | ||
|
||
hackage-db = | ||
pkgs.haskell.packages."${ghcVersion}".local.hackage-db.env; | ||
|
||
language-nix = | ||
pkgs.haskell.packages."${ghcVersion}".local.language-nix.env; | ||
|
||
default = cabal2nix; | ||
}; | ||
} | ||
); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,10 @@ | ||
{ pkgs ? import <nixpkgs> { } | ||
, ghcVersion ? pkgs.haskellPackages.ghc.version | ||
, withHls ? true | ||
}: | ||
|
||
let | ||
haskellPackages = pkgs.haskell.packages."ghc${ | ||
builtins.replaceStrings [ "." ] [ "" ] ghcVersion | ||
}"; | ||
ghc = haskellPackages.ghcWithHoogle (hps: [ | ||
hps.ansi-wl-pprint | ||
hps.hopenssl | ||
hps.hpack | ||
hps.lens | ||
hps.optparse-applicative | ||
hps.pretty | ||
hps.split | ||
hps.yaml | ||
hps.monad-par | ||
hps.monad-par-extras | ||
hps.tasty | ||
hps.tasty-golden | ||
hps.utf8-string | ||
hps.tar | ||
hps.hspec | ||
hps.parsec-class | ||
]); | ||
|
||
in pkgs.mkShell { | ||
packages = [ | ||
ghc | ||
pkgs.cabal-install | ||
pkgs.haskell-ci | ||
(pkgs.lib.getLib pkgs.openssl) | ||
] ++ pkgs.lib.optionals withHls [ | ||
haskellPackages.haskell-language-server | ||
]; | ||
} | ||
(import | ||
( | ||
let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in | ||
fetchTarball { | ||
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; | ||
sha256 = lock.nodes.flake-compat.locked.narHash; | ||
} | ||
) | ||
{ src = ./.; } | ||
).shellNix |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.