summaryrefslogtreecommitdiffstats
path: root/modules/by-name/py/python/pythonrc.py
diff options
context:
space:
mode:
authorSoispha Peetz <soispha@b-peetz.de>2026-11-26 01:40:22 +0100
committerSoispha Peetz <soispha@b-peetz.de>2026-11-28 23:58:38 +0100
commit283cc65598907f56aeaebce1a5caac985433915b (patch)
treed3f09e96061092a460519c45f9f60df5e4c7027e /modules/by-name/py/python/pythonrc.py
parentmodules/timewarrior: Remove (diff)
downloadnixos-config-283cc65598907f56aeaebce1a5caac985433915b.zip
modules/python: Migrate away from the legacy config
Diffstat (limited to '')
-rw-r--r--modules/by-name/py/python/pythonrc.py (renamed from modules/home.legacy/conf/python/pythonrc.py)7
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/home.legacy/conf/python/pythonrc.py b/modules/by-name/py/python/pythonrc.py
index b733dc48..cdcf3a4e 100644
--- a/modules/home.legacy/conf/python/pythonrc.py
+++ b/modules/by-name/py/python/pythonrc.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python
# nixos-config - My current NixOS configuration
#
@@ -18,8 +18,8 @@ def is_vanilla() -> bool:
def setup_history():
- import os
import atexit
+ import os
import readline
from pathlib import Path
@@ -31,7 +31,8 @@ def setup_history():
history: Path = state_home / "python" / "history"
if not os.path.exists(history):
- open(history, "w")
+ with open(history, "w"):
+ pass
readline.read_history_file(str(history))
atexit.register(readline.write_history_file, str(history))