Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

name-snrl
Copy link

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: NixOS/nixpkgs#311709
many thanks to @roberth for the explanation

Description

Checklist

  • Change is backwards compatible.

  • Code formatted with ./format.

  • Code tested through nix-shell --pure tests -A run.all or nix develop --ignore-environment .#all using Flakes.

  • Test cases updated/added. See example.

  • Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

    See CONTRIBUTING for more information and recent commit messages for examples.

  • If this PR adds a new module

    • Added myself as module maintainer. See example.

Maintainer CC

@name-snrl
Copy link
Author

name-snrl commented May 15, 2024

cc @rycee

@name-snrl
Copy link
Author

@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

modules/misc/submodule-support.nix Show resolved Hide resolved
This way the end user can easily check whether the home-manager
configuration is part of the module or not. Example of use:

```nix
{ lib, nixosConfig, ... }:
let
  mkIfNixos = lib.mkIf nixosConfig != null;
in
{
  programs.foot.enable = mkIfNixos true;
}
```
@name-snrl name-snrl force-pushed the define-defaults-module-extraargs branch from 6d45a36 to 93b96e3 Compare May 18, 2024 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants