home-manager/suites: fix conditional for NixOS-enabled parts

This commit is contained in:
Gabriel Arazas 2024-07-29 16:01:50 +08:00
parent 5048eae58d
commit 666912d615
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360
2 changed files with 2 additions and 7 deletions

View File

@ -3,7 +3,6 @@
let let
cfg = config.suites.desktop; cfg = config.suites.desktop;
nixosCfg = attrs.nixosConfig;
in in
{ {
options.suites.desktop = { options.suites.desktop = {
@ -14,7 +13,7 @@ in
enable = lib.mkEnableOption "installations of audio-related apps"; enable = lib.mkEnableOption "installations of audio-related apps";
pipewire.enable = lib.mkOption { pipewire.enable = lib.mkOption {
type = lib.types.bool; type = lib.types.bool;
default = nixosCfg.services.pipewire.enable or false; default = attrs.nixosConfig.services.pipewire.enable or false;
description = '' description = ''
Enable whether to install Pipewire-related applications. Enable whether to install Pipewire-related applications.

View File

@ -93,11 +93,7 @@ in {
# Echolocation. Since you're using a home-manager configuration, you're # Echolocation. Since you're using a home-manager configuration, you're
# most likely using Nix anyways. # most likely using Nix anyways.
programs.nix-index.enable = programs.nix-index.enable = !attrs.nixosConfig.programs.nix-index.enable or false;
let
hasNixOSModuleEnabled = attrs ? nixosConfig && lib.attrByPath [ "programs" "nix-index" "enable" ] false attrs.nixosConfig;
in
!hasNixOSModuleEnabled;
}) })
# Level up your terminal-dwelling skills with these. # Level up your terminal-dwelling skills with these.