-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: move string templates to separate files
- Loading branch information
Showing
4 changed files
with
141 additions
and
137 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
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,30 @@ | ||
module NixConfig exposing (configTemplate) | ||
|
||
|
||
configTemplate = | ||
""" | ||
{ inputs, config, pkgs, lib, ... }: | ||
let | ||
geopkgs = inputs.geonix.packages.${pkgs.system}; | ||
in { | ||
name = "<NAME>"; | ||
packages = [ <PACKAGES> ]; | ||
languages.python = { | ||
enable = <PYTHON-ENABLED>; | ||
package = pkgs.python3.withPackages (p: [ <PY-PACKAGES> ]); | ||
}; | ||
services.postgres = { | ||
enable = if config.container.isBuilding then false else <POSTGRES-ENABLED>; | ||
extensions = e: [ <PG-PACKAGES> ]; | ||
}; | ||
enterShell = '' | ||
<SHELL-HOOK> | ||
''; | ||
} | ||
""" |
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,83 @@ | ||
module Texts exposing (aboutText, configTemplateComment, containerTemplate, containerTemplateComment, initTemplate, initTemplateComment, installNixTemplate, installNixTemplateComment, servicesTemplate, servicesTemplateComment, shellTemplate, shellTemplateComment) | ||
|
||
|
||
aboutText = | ||
""" | ||
In a world of horrendously complex software developed by myriads of authors, | ||
be smart, use Nix and create isolated and reproducible geospatial environment, | ||
lovely built to work on any modern Linux machine. | ||
""" | ||
|
||
|
||
installNixTemplateComment = | ||
""" | ||
- Install Nix (if not already installed) | ||
""" | ||
|
||
|
||
installNixTemplate = | ||
""" | ||
curl --proto '=https' --tlsv1.2 -sSf \\ | ||
-L https://install.determinate.systems/nix \\ | ||
| sh -s -- install | ||
""" | ||
|
||
|
||
initTemplateComment = | ||
""" | ||
- Run following commands to initalize new project | ||
""" | ||
|
||
|
||
initTemplate = | ||
""" | ||
mkdir my-project && cd my-project | ||
git init | ||
nix run github:imincik/geospatial-nix#geonixcli init | ||
git add * | ||
""" | ||
|
||
|
||
configTemplateComment = | ||
""" | ||
- Copy and paste configuration to geonix.nix file | ||
""" | ||
|
||
|
||
shellTemplateComment = | ||
""" | ||
- Run following command to enter shell environment | ||
""" | ||
|
||
|
||
shellTemplate = | ||
""" | ||
nix run github:imincik/geospatial-nix#geonixcli -- shell | ||
""" | ||
|
||
|
||
servicesTemplateComment = | ||
""" | ||
- Run following command to launch services | ||
""" | ||
|
||
|
||
servicesTemplate = | ||
""" | ||
nix run github:imincik/geospatial-nix#geonixcli -- up | ||
""" | ||
|
||
|
||
containerTemplateComment = | ||
""" | ||
- Run following commands to build and run environment in container | ||
""" | ||
|
||
|
||
containerTemplate = | ||
""" | ||
nix run github:imincik/geospatial-nix#geonixcli -- container shell | ||
docker run --rm -it shell:latest | ||
""" |
Oops, something went wrong.