module Constants where

import Data.Text (Text())
import Text.RawString.QQ (r)

hlDesc :: String
hlDesc :: String
hlDesc = String
[r|
  Pass nix-shell arguments to nix-shellify to have it generate a shell.nix in
  the current directory. You can then just run nix develop or nix-shell in that
  directory to have those packages in your environment. To run nix commands
  you must first install Nix.
|]

noPackagesError :: Text
noPackagesError = Text
[r|I can't write out a shell file without any packages specified.
Try 'nix-shellify --help' for more information.|] :: Text

pkgsDecl :: a -> a -> a
pkgsDecl a
var a
repo = a
var a -> a -> a
forall a. Semigroup a => a -> a -> a
<> a
[r| = if builtins.hasAttr "packages" |] a -> a -> a
forall a. Semigroup a => a -> a -> a
<> a
repo a -> a -> a
forall a. Semigroup a => a -> a -> a
<> a
[r| then |] a -> a -> a
forall a. Semigroup a => a -> a -> a
<> a
repo a -> a -> a
forall a. Semigroup a => a -> a -> a
<> a
[r|.packages.${system} else ( if builtins.hasAttr "legacyPackages" |] a -> a -> a
forall a. Semigroup a => a -> a -> a
<> a
repo a -> a -> a
forall a. Semigroup a => a -> a -> a
<> a
[r| then |] a -> a -> a
forall a. Semigroup a => a -> a -> a
<> a
repo a -> a -> a
forall a. Semigroup a => a -> a -> a
<> a
[r|.legacyPackages.${system} else |] a -> a -> a
forall a. Semigroup a => a -> a -> a
<> a
repo a -> a -> a
forall a. Semigroup a => a -> a -> a
<> a
[r|);|]