Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/folder-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,14 @@ Additional values passed:
* `flake` maps to `inputs.self`.
* `perSystem`: contains the packages of all the inputs, filtered per system.
Eg: `perSystem.nixos-anywhere.default` is a shorthand for `inputs.nixos-anywhere.packages.<system>.default`.
* `hostConfig`: the host nixos/nix-darwin configuration.
* other provided module arguments.
Eg: home-manager provides `osConfig`, the host nixos/nix-darwin configuration.

> The simplest way to have a common/shared user configuration between multiple systems is to create a
> module at `modules/home/<name>.nix` ([docs](#modulestypenamenamenix)), and import that module
> from `inputs.self.homeModules.<name>` for each user that should inherit it. This pattern makes
> it easy to apply system-specific customizations on top of a shared, generic configuration.
> An example of this setup is shown in the following template: `templates/nixos-and-darwin-shared-homes`.

#### NixOS and nix-darwin

Expand Down
4 changes: 1 addition & 3 deletions lib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,7 @@ let
{
imports = [ homeManagerModule ];
home-manager.sharedModules = [ perSystemModule ];
home-manager.extraSpecialArgs = specialArgs // {
hostConfig = config;
};
home-manager.extraSpecialArgs = specialArgs;
home-manager.users = homesNested.${hostname};
home-manager.useGlobalPkgs = lib.mkDefault true;
home-manager.useUserPackages = lib.mkDefault true;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{
pkgs,
inputs,
hostConfig,
...
}:
{ pkgs, inputs, ... }:
{

imports = [ inputs.self.homeModules.home-shared ];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, hostConfig, ... }:
{ pkgs, osConfig, ... }:
{

# only available on linux, disabled on macos
Expand All @@ -7,8 +7,8 @@
home.packages =
[ pkgs.ripgrep ]
++ (
# you can access the host configuration using hostConfig.
pkgs.lib.optionals (hostConfig.programs.vim.enable && pkgs.stdenv.isDarwin) [ pkgs.skhd ]
# you can access the host configuration using osConfig.
pkgs.lib.optionals (osConfig.programs.vim.enable && pkgs.stdenv.isDarwin) [ pkgs.skhd ]
);

home.stateVersion = "24.11"; # initial home-manager state
Expand Down