Use host-specific home configuration
This commit is contained in:
parent
2a3a4aece9
commit
6368fe594a
5 changed files with 69 additions and 39 deletions
45
flake.nix
45
flake.nix
|
|
@ -46,39 +46,6 @@
|
||||||
programs.zsh.enable = true;
|
programs.zsh.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
homeConfiguration = { pkgs, ... }: {
|
|
||||||
imports = [
|
|
||||||
nixvim.homeManagerModules.nixvim
|
|
||||||
./modules/nvim.nix
|
|
||||||
./modules/tmux.nix
|
|
||||||
./modules/zsh.nix
|
|
||||||
./modules/ssh.nix
|
|
||||||
./modules/git.nix
|
|
||||||
./modules/lazygit.nix
|
|
||||||
./modules/papis.nix
|
|
||||||
./modules/termscp.nix
|
|
||||||
./modules/rsync.nix
|
|
||||||
./modules/btop.nix
|
|
||||||
./modules/firefox.nix
|
|
||||||
./modules/ghostty.nix
|
|
||||||
./modules/syncthing.nix
|
|
||||||
./config/fonts.nix
|
|
||||||
./config/packages/common.nix
|
|
||||||
./config/packages/darwin.nix
|
|
||||||
./config/packages/dev.nix
|
|
||||||
./config/packages/productivity.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
|
||||||
|
|
||||||
home.username = "yanlin";
|
|
||||||
home.homeDirectory = "/Users/yanlin";
|
|
||||||
home.stateVersion = "24.05";
|
|
||||||
|
|
||||||
programs.home-manager.enable = true;
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
darwinConfigurations."iMac" = nix-darwin.lib.darwinSystem {
|
darwinConfigurations."iMac" = nix-darwin.lib.darwinSystem {
|
||||||
|
|
@ -97,10 +64,18 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
homeConfigurations.yanlin = home-manager.lib.homeManagerConfiguration {
|
homeConfigurations = {
|
||||||
|
"yanlin@iMac" = home-manager.lib.homeManagerConfiguration {
|
||||||
pkgs = nixpkgs.legacyPackages.aarch64-darwin;
|
pkgs = nixpkgs.legacyPackages.aarch64-darwin;
|
||||||
modules = [ homeConfiguration ];
|
modules = [ ./hosts/darwin/iMac/home.nix ];
|
||||||
|
extraSpecialArgs = { inherit claude-code nixvim firefox-addons; };
|
||||||
|
};
|
||||||
|
|
||||||
|
"yanlin@MacBook-Air" = home-manager.lib.homeManagerConfiguration {
|
||||||
|
pkgs = nixpkgs.legacyPackages.aarch64-darwin;
|
||||||
|
modules = [ ./hosts/darwin/MacBook-Air/home.nix ];
|
||||||
extraSpecialArgs = { inherit claude-code nixvim firefox-addons; };
|
extraSpecialArgs = { inherit claude-code nixvim firefox-addons; };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
33
home/common.nix
Normal file
33
home/common.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
{ config, pkgs, nixvim, claude-code, firefox-addons, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
nixvim.homeManagerModules.nixvim
|
||||||
|
../modules/nvim.nix
|
||||||
|
../modules/tmux.nix
|
||||||
|
../modules/zsh.nix
|
||||||
|
../modules/ssh.nix
|
||||||
|
../modules/git.nix
|
||||||
|
../modules/lazygit.nix
|
||||||
|
../modules/papis.nix
|
||||||
|
../modules/termscp.nix
|
||||||
|
../modules/rsync.nix
|
||||||
|
../modules/btop.nix
|
||||||
|
../modules/firefox.nix
|
||||||
|
../modules/ghostty.nix
|
||||||
|
../modules/syncthing.nix
|
||||||
|
../config/fonts.nix
|
||||||
|
../config/packages/common.nix
|
||||||
|
../config/packages/darwin.nix
|
||||||
|
../config/packages/dev.nix
|
||||||
|
../config/packages/productivity.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
|
home.username = "yanlin";
|
||||||
|
home.homeDirectory = "/Users/yanlin";
|
||||||
|
home.stateVersion = "24.05";
|
||||||
|
|
||||||
|
programs.home-manager.enable = true;
|
||||||
|
}
|
||||||
11
hosts/darwin/MacBook-Air/home.nix
Normal file
11
hosts/darwin/MacBook-Air/home.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
../../../home/common.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
# MacBook Air-specific home configuration
|
||||||
|
# Example: Laptop-specific tools, power management, etc.
|
||||||
|
|
||||||
|
}
|
||||||
11
hosts/darwin/iMac/home.nix
Normal file
11
hosts/darwin/iMac/home.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
../../../home/common.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
# iMac-specific home configuration
|
||||||
|
# Example: Different screen setup, desktop-specific tools, etc.
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -24,8 +24,8 @@ in
|
||||||
|
|
||||||
# Nix helpers
|
# Nix helpers
|
||||||
hm = "home-manager";
|
hm = "home-manager";
|
||||||
hms = "home-manager switch --flake ~/.config/nix#yanlin";
|
hms = "home-manager switch --flake ~/.config/nix#$(whoami)@$(hostname)";
|
||||||
hms-offline = "home-manager switch --flake ~/.config/nix#yanlin --option substitute false";
|
hms-offline = "home-manager switch --flake ~/.config/nix#$(whoami)@$(hostname) --option substitute false";
|
||||||
|
|
||||||
} // lib.optionalAttrs pkgs.stdenv.isDarwin {
|
} // lib.optionalAttrs pkgs.stdenv.isDarwin {
|
||||||
# macOS-specific app aliases
|
# macOS-specific app aliases
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue