Modularize home-manager config
This commit is contained in:
55
flake.nix
55
flake.nix
@@ -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;
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
)
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user