nix-community / home-manager

Manage a user environment using Nix [maintainer=@rycee]
https://nix-community.github.io/home-manager/
MIT License
6.1k stars 1.65k forks source link

submodule-support: add default values for top-level configs #5406

Open name-snrl opened 2 weeks ago

name-snrl commented 2 weeks ago

This way the end user can easily check whether the home-manager configuration is part of the module or not. Example of use:

{ lib, nixosConfig, ... }:
let
  mkIfNixos = lib.mkIf nixosConfig != null;
in
{
  programs.foot.enable = mkIfNixos true;
}

related: https://github.com/NixOS/nixpkgs/issues/311709 many thanks to @roberth for the explanation

Description

Checklist

Maintainer CC

name-snrl commented 2 weeks ago

cc @rycee

name-snrl commented 2 weeks ago

@emilazy @rycee @SuperSandro2000 @roberth I apologize for mentioning again those who have already been mentioned before, but perhaps during the weekend I have a better chance to draw your attention to this simple but useful PR