Home Manager: Difference between revisions
m Fix syntax highlight for some nix code snippets |
fix home manager module and add home manager config |
||
| Line 63: | Line 63: | ||
}; | }; | ||
}; | }; | ||
outputs = { self, nixpkgs, home-manager }@inputs: | outputs = { self, nixpkgs, home-manager, ... }@inputs: | ||
nixosConfigurations.ExampleMachine = nixosConfiguration "ExmapleMachine" | nixosConfigurations.ExampleMachine = nixosConfiguration "ExmapleMachine" | ||
system = "x86_64-linux"; | system = "x86_64-linux"; | ||
modules = [ | modules = [ | ||
./configuration.nix | |||
home-manager.nixosModules.home-manager | |||
{ | |||
home-manager.useGlobalPkgs = true; | |||
home-manager.useUserPackages = true; | |||
home-manager.users.your-username = import ./home.nix; | |||
}; | }; | ||
]; | ]; | ||
}; | }; | ||
| Line 80: | Line 80: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Here's an example of home manager configuration in ./home.nix | |||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
{ config, pkgs, ... }: | |||
{ | { | ||
home- | # Home Manager needs a bit of information about you and the | ||
# paths it should manage. | |||
home.username = "your-username"; | |||
home.homeDirectory = "/home/your-username"; | |||
# This value determines the Home Manager release that your | |||
# configuration is compatible with. This helps avoid breakage | |||
# when a new Home Manager release introduces backwards | |||
# incompatible changes. | |||
# | |||
# You can update Home Manager without changing this value. See | |||
# the Home Manager release notes for a list of state version | |||
# changes in each release. | |||
home.stateVersion = "24.05"; | |||
# Let Home Manager install and manage itself. | |||
programs.home-manager.enable = true; | |||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||