mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-12 01:59:37 +08:00
treewide: null package support (#6582)
Can generate the config without installing application through home-manager. Helpful when a package is broken (or not provided) on a specific platform through nixpkgs and needs to be installed through other means but you still can benefit from the declarative configuration.
This commit is contained in:
@@ -12,7 +12,7 @@ in {
|
||||
options.programs.bemenu = {
|
||||
enable = mkEnableOption "bemenu";
|
||||
|
||||
package = mkPackageOption pkgs "bemenu" { };
|
||||
package = mkPackageOption pkgs "bemenu" { nullable = true; };
|
||||
|
||||
settings = mkOption {
|
||||
type = with types; attrsOf (oneOf [ str number bool ]);
|
||||
@@ -44,7 +44,7 @@ in {
|
||||
assertions =
|
||||
[ (hm.assertions.assertPlatform "programs.bemenu" pkgs platforms.linux) ];
|
||||
|
||||
home.packages = [ cfg.package ];
|
||||
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
||||
|
||||
home.sessionVariables = mkIf (cfg.settings != { }) {
|
||||
BEMENU_OPTS = cli.toGNUCommandLineShell { } cfg.settings;
|
||||
|
||||
Reference in New Issue
Block a user