From 283cc65598907f56aeaebce1a5caac985433915b Mon Sep 17 00:00:00 2001 From: Soispha Peetz Date: Thu, 26 Nov 2026 01:40:22 +0100 Subject: modules/python: Migrate away from the legacy config --- modules/by-name/py/python/module.nix | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 modules/by-name/py/python/module.nix (limited to 'modules/by-name/py/python/module.nix') diff --git a/modules/by-name/py/python/module.nix b/modules/by-name/py/python/module.nix new file mode 100644 index 00000000..1f891868 --- /dev/null +++ b/modules/by-name/py/python/module.nix @@ -0,0 +1,29 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see . +{ + config, + lib, + ... +}: let + cfg = config.soispha.programs.python; +in { + options.soispha.programs.python = { + enable = lib.mkEnableOption "python"; + }; + + config = lib.mkIf cfg.enable { + home-manager.users.user.soispha = { + xdg.configFile."python/pythonrc".source = ./pythonrc.py; + home.sessionVariables = { + "PYTHONSTARTUP" = "${config.home-manager.users.user.soispha.xdg.configHome}/python/pythonrc"; + }; + }; + }; +} -- cgit v1.3.1