diff --git a/nix/configuration/hosts/odo/default.nix b/nix/configuration/hosts/odo/default.nix index f4b9c4b..21253e8 100644 --- a/nix/configuration/hosts/odo/default.nix +++ b/nix/configuration/hosts/odo/default.nix @@ -44,7 +44,8 @@ me.kubernetes.enable = true; me.latex.enable = true; me.launch_keyboard.enable = true; - me.sway.enable = true; me.lvfs.enable = true; me.media.enable = true; + me.python.enable = true; + me.sway.enable = true; } diff --git a/nix/configuration/roles/python/default.nix b/nix/configuration/roles/python/default.nix index d569e65..c01019d 100644 --- a/nix/configuration/roles/python/default.nix +++ b/nix/configuration/roles/python/default.nix @@ -8,16 +8,31 @@ { imports = [ ]; - environment.systemPackages = with pkgs; [ - (python3.withPackages (python-pkgs: [ - python-pkgs.distro # For https://gitlab.freedesktop.org/drm/amd/-/blob/master/scripts/amd_s2idle.py - python-pkgs.pyudev # For https://gitlab.freedesktop.org/drm/amd/-/blob/master/scripts/amd_s2idle.py - python-pkgs.systemd # For https://gitlab.freedesktop.org/drm/amd/-/blob/master/scripts/amd_s2idle.py - python-pkgs.packaging # For https://gitlab.freedesktop.org/drm/amd/-/blob/master/scripts/amd_s2idle.py - ])) - poetry - pyright - isort - black - ]; + options.me = { + python.enable = lib.mkOption { + type = lib.types.bool; + default = false; + example = true; + description = "Whether we want to install python."; + }; + }; + + config = lib.mkIf config.me.python.enable ( + lib.mkMerge [ + { + environment.systemPackages = with pkgs; [ + (python3.withPackages (python-pkgs: [ + python-pkgs.distro # For https://gitlab.freedesktop.org/drm/amd/-/blob/master/scripts/amd_s2idle.py + python-pkgs.pyudev # For https://gitlab.freedesktop.org/drm/amd/-/blob/master/scripts/amd_s2idle.py + python-pkgs.systemd # For https://gitlab.freedesktop.org/drm/amd/-/blob/master/scripts/amd_s2idle.py + python-pkgs.packaging # For https://gitlab.freedesktop.org/drm/amd/-/blob/master/scripts/amd_s2idle.py + ])) + poetry + pyright + isort + black + ]; + } + ] + ); }