| 8 Jul 2025 |
nbp | Martin Gaens: I have a home-manager config which is either managed on its own or within NixOS, which I use across 2 different computer. I am using the extraSpecialArgs in flake.nix or home-manager.users.nicolas._module.args when embedded in a NixOS configuration, to set some configuration managed externally.
Note, there is nothing about special args, I might have as well set an option by adding an extra module in homeManager's flake.nix and done the same within the configuration embedded in NixOS.
| 09:25:23 |
Martin Gaens | Thanks for your reply. I am quite new to this; I'm not sure I understand. Do you mean you have some externally-managed configuration, which you pass both to your home-manager config as well as to your system config, and then, make decisions in those configs based on the global configuration? | 09:43:25 |
nbp | I can either use my home manager as a standalone entry in my flake.nix:
homeConfigurations.nicolas = home-manager.lib.homeManagerConfiguration {
extraSpecialArgs = inputs // {
inNixOS = false;
};
pkgs = import nixpkgs-unstable {
system = "x86_64-linux";
overlays = [ self.overlays.openpnp ];
};
modules = [ ./users/nicolas/home.nix ];
};
Or as a module to import in my NixOS configuration:
{ home-manager, ...}@inputs:
{
imports = [
home-manager.nixosModules.home-manager
];
home-manager = {
users.nicolas.imports = [ ./home.nix ];
users.nicolas._module.args = {
inNixOS = true;
} // inputs;
};
}
The inNixOS argument is nothing special, this is just an extra attribute I give as argument to the home-manager modules to tune it differently.
| 09:54:33 |
nbp | * I can either use my home manager as a standalone entry in my flake.nix:
homeConfigurations.nicolas = home-manager.lib.homeManagerConfiguration {
extraSpecialArgs = inputs // {
inNixOS = false;
};
pkgs = import nixpkgs-unstable { system = "x86_64-linux"; };
modules = [ ./users/nicolas/home.nix ];
};
Or as a module to import in my NixOS configuration:
{ home-manager, ...}@inputs:
{
imports = [
home-manager.nixosModules.home-manager
];
home-manager = {
users.nicolas.imports = [ ./home.nix ];
users.nicolas._module.args = {
inNixOS = true;
} // inputs;
};
}
The inNixOS argument is nothing special, this is just an extra attribute I give as argument to the home-manager modules to tune it differently.
| 09:55:32 |
nbp | * I can either use my home manager as a standalone entry in my flake.nix:
homeConfigurations.nicolas = home-manager.lib.homeManagerConfiguration {
extraSpecialArgs = inputs // {
inNixOS = false;
};
pkgs = import nixpkgs-unstable { system = "x86_64-linux"; };
modules = [ ./users/nicolas/home.nix ];
};
Or as a module to import in my NixOS configuration:
{ home-manager, ...}@inputs:
{
imports = [
home-manager.nixosModules.home-manager
];
home-manager = {
users.nicolas.imports = [ ./home.nix ];
users.nicolas._module.args = {
inNixOS = true;
inherit (inputs) awesome-copycats; // list other inputs forwarded from NixOS to home-manager
};
};
}
The inNixOS argument is nothing special, this is just an extra attribute I give as argument to the home-manager modules to tune it differently.
| 09:56:35 |
nbp | * I can either use my home manager as a standalone entry in my flake.nix:
homeConfigurations.nicolas = home-manager.lib.homeManagerConfiguration {
extraSpecialArgs = inputs // {
inNixOS = false;
};
pkgs = import nixpkgs-unstable { system = "x86_64-linux"; };
modules = [ ./users/nicolas/home.nix ];
};
Or as a module to import in my NixOS configuration:
{ home-manager, ...}@inputs:
{
imports = [
home-manager.nixosModules.home-manager
];
home-manager = {
users.nicolas.imports = [ ./home.nix ];
users.nicolas._module.args = {
inNixOS = true;
inherit (inputs) awesome-copycats; # list other inputs forwarded from NixOS to home-manager
};
};
}
The inNixOS argument is nothing special, this is just an extra attribute I give as argument to the home-manager modules to tune it differently.
| 09:56:50 |
nbp | * I can either use my home manager as a standalone entry in my flake.nix:
homeConfigurations.nicolas = home-manager.lib.homeManagerConfiguration {
extraSpecialArgs = inputs // {
inNixOS = false;
};
pkgs = import nixpkgs-unstable { system = "x86_64-linux"; };
modules = [ ./home.nix ];
};
Or as a module to import in my NixOS configuration:
{ home-manager, ...}@inputs:
{
imports = [
home-manager.nixosModules.home-manager
];
home-manager = {
users.nicolas.imports = [ ./home.nix ];
users.nicolas._module.args = {
inNixOS = true;
inherit (inputs) awesome-copycats; # list other inputs forwarded from NixOS to home-manager
};
};
}
The inNixOS argument is nothing special, this is just an extra attribute I give as argument to the home-manager modules to tune it differently.
| 09:57:26 |
| 9 Jul 2025 |
| atagen joined the room. | 07:41:54 |
| 14 Jul 2025 |
| @mightyiam:matrix.org joined the room. | 10:05:13 |