Skip to content

How to add environment variables to a haskell flake #159

Answered by srid
newton-migosi asked this question in Q&A
Discussion options

You must be logged in to vote

Build-time environment variable? You want to override it in overrides just like any dependency, https://haskell.flake.page/dependency

Apply this on https://github.com/srid/haskell-template and do nix run or nix build:

diff --git a/flake.nix b/flake.nix
index 15f87d2..ea02116 100644
--- a/flake.nix
+++ b/flake.nix
@@ -26,12 +26,17 @@
         # See https://github.com/srid/haskell-flake/blob/master/example/flake.nix
         haskellProjects.default = {
           # packages.haskell-template.root = ./.;  # Auto-discovered by haskell-flake
-          overrides = self: super: { };
+          overrides = self: super: {
+            haskell-template = super.haskell-template.overrideAttrs (_: _: {
+

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@newton-migosi
Comment options

Answer selected by newton-migosi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants