Modularize home-manager config

This commit is contained in:
2026-02-08 12:36:32 +00:00
parent e6601f04c7
commit d79d8824cf
4 changed files with 105 additions and 37 deletions

View File

@@ -15,56 +15,39 @@
nixpkgs,
home-manager,
}:
let
commonModules = [ ./modules/home.nix ];
in
{
homeConfigurations."artem" = home-manager.lib.homeManagerConfiguration {
homeConfigurations."linux-headless" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
modules = commonModules ++ [
(
{ ... }:
{
home.username = "artem";
home.homeDirectory = "/home/artem";
}
)
];
};
homeConfigurations."mac-portable" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-darwin;
modules = [
modules = commonModules ++ [
(
{ pkgs, ... }:
{
home.username = "artem";
home.homeDirectory = "/Users/artem";
home.stateVersion = "25.11";
# vscode
nixpkgs.config.allowUnfree = true;
home.packages = with pkgs; [
git
vim
stow
secretive
];
programs.zsh = {
enable = true;
initContent = ''
. ~/dotfiles/migrated/.zshrc
# Outside NixOS, we need to load this manually. Same on MacOS, if /etc/zshrc
# is reset to its default content (post-upgrade).
if [ -r '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then
. '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
fi
'';
};
programs.home-manager.enable = true;
nixpkgs.config.allowUnfree = true;
programs.vscode.enable = true;
programs.direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
config.global = {
warn_timeout = "30s";
hide_env_diff = true;
};
};
}
)
];