about summary refs log tree commit diff stats
path: root/home-manager/soispha/config/python
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2023-08-01 15:31:42 +0200
committerSoispha <soispha@vhack.eu>2023-08-01 15:42:54 +0200
commit0a608bd781dcda40144097b007fac0a0c60a8ee1 (patch)
treee69fbc1fd0e15e3b86f31f47b776df21f6f0170d /home-manager/soispha/config/python
parentFix(hm/conf/gammastep): Use lighter settings on laptops (diff)
downloadnixos-config-0a608bd781dcda40144097b007fac0a0c60a8ee1.zip
Refactor(treewide): Move module configuration in separate files
Diffstat (limited to 'home-manager/soispha/config/python')
-rw-r--r--home-manager/soispha/config/python/default.nix7
-rw-r--r--home-manager/soispha/config/python/pythonrc11
2 files changed, 18 insertions, 0 deletions
diff --git a/home-manager/soispha/config/python/default.nix b/home-manager/soispha/config/python/default.nix
new file mode 100644
index 00000000..eeaccdcf
--- /dev/null
+++ b/home-manager/soispha/config/python/default.nix
@@ -0,0 +1,7 @@
+{
+  config,
+  pkgs,
+  ...
+}: {
+  xdg.configFile."python/pythonrc".source = ./pythonrc;
+}
diff --git a/home-manager/soispha/config/python/pythonrc b/home-manager/soispha/config/python/pythonrc
new file mode 100644
index 00000000..38c48e0f
--- /dev/null
+++ b/home-manager/soispha/config/python/pythonrc
@@ -0,0 +1,11 @@
+import os
+import atexit
+import readline
+
+history = os.path.join(os.environ['XDG_CACHE_HOME'], 'python_history')
+readline.read_history_file(history)
+
+def write_history():
+    readline.write_history_file(history)
+
+atexit.register(write_history)