小编R B*_*ett的帖子

haskell gogol-已安装的应用程序凭据示例:无法将类型“ [Symbol]”与“ *”匹配

我正在尝试 在gogol软件包安装应用程序凭证示例

这是示例(仅从已安装的应用程序凭据页面复制):

{-# LANGUAGE ScopedTypeVariables #-}
import Data.Proxy     (Proxy (..))
import Data.Text      as T
import Data.Text.IO   as T
import System.Exit    (exitFailure)
import System.Info    (os)
import System.Process (rawSystem)
redirectPrompt :: AllowScopes (s :: [Symbol]) => OAuthClient -> proxy s -> IO (OAuthCode s)
redirectPrompt c p = do
    let url = formURL c p
    T.putStrLn $ "Opening URL " `T.append` url
    _ <- case os of
        "darwin" -> rawSystem "open"     [unpack url]
        "linux"  -> …
Run Code Online (Sandbox Code Playgroud)

haskell types

5
推荐指数
1
解决办法
138
查看次数

如何使用 nix 在堆栈中传递自定义环境变量(如密码)?

我在 nix 中使用堆栈。我需要将环境变量作为数据库密码传递以在运行时连接到 Postgres。目前,我在 YAML 中启用了 nix 并自定义了自己.nix的密码以将密码放入.nix.

堆栈.yaml:

nix:
  enable: true
  pure: true
  shell-file: shell.nix
Run Code Online (Sandbox Code Playgroud)

shell.nix:

{ghc}:
with (import <nixpkgs> {});

haskell.lib.buildStackProject {
  inherit ghc;
  name = "myenv";
  buildInputs = [ postgresql_10 ];
  PGPASSWORD = "pw";
}
Run Code Online (Sandbox Code Playgroud)

但是当我想将代码提交到 GitHub/Gitlab 并转到 CI/CD 管道时,显式输入密码.nix似乎不太好。我想知道有什么好的方法可以解决这个问题吗?

haskell nix haskell-stack

3
推荐指数
1
解决办法
289
查看次数

标签 统计

haskell ×2

haskell-stack ×1

nix ×1

types ×1