diff options
Diffstat (limited to 'roles/programming')
-rw-r--r-- | roles/programming/haskell/files/ghci.conf | 2 | ||||
-rw-r--r-- | roles/programming/haskell/files/stack/config.yaml | 14 | ||||
-rw-r--r-- | roles/programming/haskell/files/stack/global-project/README.txt | 2 | ||||
-rw-r--r-- | roles/programming/haskell/files/stack/global-project/stack.yaml | 10 | ||||
-rw-r--r-- | roles/programming/haskell/tasks/main.yml | 13 | ||||
-rw-r--r-- | roles/programming/nodejs/files/npmrc | 3 | ||||
-rw-r--r-- | roles/programming/nodejs/tasks/main.yml | 5 | ||||
-rw-r--r-- | roles/programming/python/files/startup_script.py | 52 | ||||
-rw-r--r-- | roles/programming/python/tasks/main.yml | 5 |
9 files changed, 106 insertions, 0 deletions
diff --git a/roles/programming/haskell/files/ghci.conf b/roles/programming/haskell/files/ghci.conf new file mode 100644 index 0000000..1de7ca1 --- /dev/null +++ b/roles/programming/haskell/files/ghci.conf | |||
@@ -0,0 +1,2 @@ | |||
1 | :set prompt "λ " | ||
2 | :set -XOverloadedStrings | ||
diff --git a/roles/programming/haskell/files/stack/config.yaml b/roles/programming/haskell/files/stack/config.yaml new file mode 100644 index 0000000..3bf2f91 --- /dev/null +++ b/roles/programming/haskell/files/stack/config.yaml | |||
@@ -0,0 +1,14 @@ | |||
1 | # This file contains default non-project-specific settings for 'stack', used | ||
2 | # in all projects. For more information about stack's configuration, see | ||
3 | # http://docs.haskellstack.org/en/stable/yaml_configuration/ | ||
4 | |||
5 | # The following parameters are used by "stack new" to automatically fill fields | ||
6 | # in the cabal config. We recommend uncommenting them and filling them out if | ||
7 | # you intend to use 'stack new'. | ||
8 | # See https://docs.haskellstack.org/en/stable/yaml_configuration/#templates | ||
9 | templates: | ||
10 | scm-init: git | ||
11 | params: | ||
12 | author-name: Ismaël Bouya | ||
13 | author-email: ismael.bouya@fretlink.com | ||
14 | github-username: ismaelbouyaf | ||
diff --git a/roles/programming/haskell/files/stack/global-project/README.txt b/roles/programming/haskell/files/stack/global-project/README.txt new file mode 100644 index 0000000..646fa5f --- /dev/null +++ b/roles/programming/haskell/files/stack/global-project/README.txt | |||
@@ -0,0 +1,2 @@ | |||
1 | This is the implicit global project, which is used only when 'stack' is run | ||
2 | outside of a real project. | ||
diff --git a/roles/programming/haskell/files/stack/global-project/stack.yaml b/roles/programming/haskell/files/stack/global-project/stack.yaml new file mode 100644 index 0000000..e034f58 --- /dev/null +++ b/roles/programming/haskell/files/stack/global-project/stack.yaml | |||
@@ -0,0 +1,10 @@ | |||
1 | # This is the implicit global project's config file, which is only used when | ||
2 | # 'stack' is run outside of a real project. Settings here do _not_ act as | ||
3 | # defaults for all projects. To change stack's default settings, edit | ||
4 | # '/home/ismael/.local/share/stack/config.yaml' instead. | ||
5 | # | ||
6 | # For more information about stack's configuration, see | ||
7 | # http://docs.haskellstack.org/en/stable/yaml_configuration/ | ||
8 | # | ||
9 | packages: [] | ||
10 | resolver: lts-11.15 | ||
diff --git a/roles/programming/haskell/tasks/main.yml b/roles/programming/haskell/tasks/main.yml new file mode 100644 index 0000000..cd6654b --- /dev/null +++ b/roles/programming/haskell/tasks/main.yml | |||
@@ -0,0 +1,13 @@ | |||
1 | --- | ||
2 | - name: GHC config file | ||
3 | copy: | ||
4 | src: ghci.conf | ||
5 | dest: $HOME/.ghc/ | ||
6 | - name: Stack config files | ||
7 | synchronize: | ||
8 | recursive: yes | ||
9 | archive: no | ||
10 | checksum: yes | ||
11 | src: stack/ | ||
12 | dest: /$XDG_DATA_HOME/stack/ | ||
13 | |||
diff --git a/roles/programming/nodejs/files/npmrc b/roles/programming/nodejs/files/npmrc new file mode 100644 index 0000000..5dc76c3 --- /dev/null +++ b/roles/programming/nodejs/files/npmrc | |||
@@ -0,0 +1,3 @@ | |||
1 | cache=${XDG_CACHE_HOME}/npm | ||
2 | tmp=${XDG_RUNTIME_DIR}/npm | ||
3 | init-module=${XDG_CONFIG_HOME}/npm/config/npm-init.js | ||
diff --git a/roles/programming/nodejs/tasks/main.yml b/roles/programming/nodejs/tasks/main.yml new file mode 100644 index 0000000..fcf7421 --- /dev/null +++ b/roles/programming/nodejs/tasks/main.yml | |||
@@ -0,0 +1,5 @@ | |||
1 | --- | ||
2 | - name: config file | ||
3 | copy: | ||
4 | src: npmrc | ||
5 | dest: $XDG_CONFIG_HOME/npm/ | ||
diff --git a/roles/programming/python/files/startup_script.py b/roles/programming/python/files/startup_script.py new file mode 100644 index 0000000..403afe5 --- /dev/null +++ b/roles/programming/python/files/startup_script.py | |||
@@ -0,0 +1,52 @@ | |||
1 | import sys as sys_ | ||
2 | |||
3 | # Adapted from /usr/lib/python3.7/site.py # enablerlcompleter | ||
4 | def register_readline(): | ||
5 | import os | ||
6 | import atexit | ||
7 | try: | ||
8 | import readline | ||
9 | import rlcompleter | ||
10 | except ImportError: | ||
11 | return | ||
12 | |||
13 | # Reading the initialization (config) file may not be enough to set a | ||
14 | # completion key, so we set one first and then read the file. | ||
15 | readline_doc = getattr(readline, '__doc__', '') | ||
16 | if readline_doc is not None and 'libedit' in readline_doc: | ||
17 | readline.parse_and_bind('bind ^I rl_complete') | ||
18 | else: | ||
19 | readline.parse_and_bind('tab: complete') | ||
20 | |||
21 | try: | ||
22 | readline.read_init_file() | ||
23 | except OSError: | ||
24 | # An OSError here could have many causes, but the most likely one | ||
25 | # is that there's no .inputrc file (or .editrc file in the case of | ||
26 | # Mac OS X + libedit) in the expected location. In that case, we | ||
27 | # want to ignore the exception. | ||
28 | pass | ||
29 | |||
30 | if readline.get_current_history_length() == 0: | ||
31 | # If no history was loaded, default to .python_history. | ||
32 | # The guard is necessary to avoid doubling history size at | ||
33 | # each interpreter exit when readline was already configured | ||
34 | # through a PYTHONSTARTUP hook, see: | ||
35 | # http://bugs.python.org/issue5845#msg198636 | ||
36 | environ = os.environ.get("XDG_STATE_HOME") or os.environ.get("XDG_DATA_HOME") | ||
37 | if environ is not None: | ||
38 | if not os.path.exists(os.path.join(environ, "python")): | ||
39 | os.mkdir(os.path.join(environ, "python")) | ||
40 | history = os.path.join(environ, "python", "history") | ||
41 | else: | ||
42 | history = os.path.join(os.path.expanduser('~'), | ||
43 | '.python_history') | ||
44 | try: | ||
45 | readline.read_history_file(history) | ||
46 | except OSError: | ||
47 | pass | ||
48 | atexit.register(readline.write_history_file, history) | ||
49 | |||
50 | sys_.__interactivehook__ = register_readline | ||
51 | |||
52 | del sys_ | ||
diff --git a/roles/programming/python/tasks/main.yml b/roles/programming/python/tasks/main.yml new file mode 100644 index 0000000..db67584 --- /dev/null +++ b/roles/programming/python/tasks/main.yml | |||
@@ -0,0 +1,5 @@ | |||
1 | --- | ||
2 | - name: Config file | ||
3 | copy: | ||
4 | src: startup_script.py | ||
5 | dest: $XDG_CONFIG_HOME/python/ | ||