-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate nix environment to flakes (#604)
* 🚧 WIP: migrating to flakes * re-add commands * darwin-only packages * clean up a bunch of unused stack-to-nix stuff * --nix-pure is working now? * ditch lorri * add cachix + note * remove redundant --nix from commands * tweak github actions cache * action cache busting
- Loading branch information
Showing
23 changed files
with
391 additions
and
1,415 deletions.
There are no files selected for viewing
This file contains 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 +1 @@ | ||
eval "$(lorri direnv)" | ||
use flake |
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
|
@@ -590,3 +590,4 @@ MigrationBackup/ | |
|
||
fission-web-server/data/ | ||
fission-web-server/.env | ||
.direnv/ |
This file contains 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
This file contains 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,15 +1,13 @@ | ||
{ haskellNixSrc ? builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz | ||
}: | ||
|
||
let | ||
haskellNix = import haskellNixSrc { }; | ||
pkgs = import haskellNix.sources.nixpkgs-unstable haskellNix.nixpkgsArgs; | ||
|
||
pkgSet = pkgs.haskell-nix.mkStackPkgSet { | ||
stack-pkgs = import ./nix/pkgs.nix; | ||
pkg-def-extras = []; | ||
modules = []; | ||
}; | ||
|
||
in | ||
pkgSet.config.hsPkgs | ||
(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 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,67 @@ | ||
{ | ||
description = "Fission tools"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/release-22.05"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
|
||
flake-compat = { | ||
url = "github:edolstra/flake-compat"; | ||
flake = false; | ||
}; | ||
}; | ||
|
||
outputs = { self, nixpkgs, flake-utils, ... }: | ||
flake-utils.lib.eachDefaultSystem | ||
(system: | ||
let | ||
|
||
pkgs = nixpkgs.legacyPackages.${system}; | ||
|
||
# Inspired by https://www.tweag.io/blog/2022-06-02-haskell-stack-nix-shell/ | ||
stack-wrapped = pkgs.symlinkJoin { | ||
name = "stack"; | ||
paths = [ pkgs.stack ]; | ||
buildInputs = [ pkgs.makeWrapper ]; | ||
postBuild = '' | ||
wrapProgram $out/bin/stack \ | ||
--add-flags "\ | ||
--nix \ | ||
--nix-pure \ | ||
--nix-shell-file=nix/stack-integration.nix \ | ||
" | ||
''; | ||
}; | ||
|
||
# Wrapper commands for convenience | ||
commands = import ./nix/commands.nix; | ||
server-path = "~/.local/bin/fission-server"; | ||
tasks = commands { | ||
inherit pkgs; | ||
inherit server-path; | ||
inherit stack-wrapped; | ||
}; | ||
|
||
# The default version of HLS (with binary cache) is built with GHC 9.0.1 | ||
# We can get this version working with our current set up, but it builds | ||
# from source (and takes a long time). | ||
# | ||
# The prebuilt package is marked as broken on aarch64-darwin | ||
haskellPackages = pkgs.haskell.packages.ghc8107; | ||
in | ||
{ | ||
devShells.default = pkgs.mkShell { | ||
name = "fission"; | ||
buildInputs = [ | ||
stack-wrapped | ||
haskellPackages.haskell-language-server | ||
pkgs.cachix | ||
pkgs.nixpkgs-fmt | ||
pkgs.stylish-haskell | ||
tasks | ||
]; | ||
NIX_PATH = "nixpkgs=" + pkgs.path; | ||
}; | ||
} | ||
); | ||
} |
Oops, something went wrong.