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:
@@ -29,7 +29,10 @@ in {
|
||||
programs.bash = {
|
||||
enable = mkEnableOption "GNU Bourne-Again SHell";
|
||||
|
||||
package = mkPackageOption pkgs "bash" { default = "bashInteractive"; };
|
||||
package = mkPackageOption pkgs "bash" {
|
||||
nullable = true;
|
||||
default = "bashInteractive";
|
||||
};
|
||||
|
||||
enableCompletion = mkOption {
|
||||
type = types.bool;
|
||||
@@ -195,7 +198,7 @@ in {
|
||||
}) ++ optional (cfg.historyFile != null)
|
||||
''mkdir -p "$(dirname "$HISTFILE")"''));
|
||||
in mkIf cfg.enable {
|
||||
home.packages = [ cfg.package ];
|
||||
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
||||
|
||||
home.file.".bash_profile".source = writeBashScript "bash_profile" ''
|
||||
# include .profile if it exists
|
||||
|
||||
Reference in New Issue
Block a user