Split configuration into reusable modules

This commit is contained in:
2026-03-29 11:50:03 +02:00
parent 5a8f0aa4df
commit 58fb358955
7 changed files with 40 additions and 25 deletions

View File

@@ -61,26 +61,28 @@
});
homeModules = {
main = import ./modules/home.nix;
mac-portable = import ./modules/home/mac-portable.nix;
linux-headless = import ./modules/home/linux-headless.nix;
};
darwinModules = {
mac-portable = import ./modules/mac-portable.nix;
mac-portable = import ./modules/darwin/mac-portable.nix;
};
homeConfigurations."artem@deimos" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs.primaryUser = "artem";
modules = [
self.homeModules.main
vscode-server.homeModules.default
self.homeModules.linux-headless
./hosts/deimos/home.nix
];
};
homeConfigurations."artem@mars" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-darwin;
specialArgs.primaryUser = "artem";
extraSpecialArgs.primaryUser = "artem";
modules = [
self.homeModules.main
self.homeModules.mac-portable
./hosts/mars/home.nix
];
};

View File

@@ -1,6 +1,4 @@
{ pkgs, ... }:
{
home.username = "artem";
_: {
home.homeDirectory = "/home/artem";
services.vscode-server.enable = true;

View File

@@ -1,18 +1,6 @@
{ pkgs, primaryUser, ... }:
{ pkgs, ... }:
{
nixpkgs.hostPlatform = "x86_64-darwin";
# TODO: consider
# https://nest.pijul.com/yonkeltron/macOS-nix-config:main/ZLDSMIXK5XFW6.EIAAA
# and
# https://github.com/bgub/nix-macos-starter/tree/main
home.username = primaryUser;
home.homeDirectory = "/Users/${primaryUser}";
home.packages = with pkgs; [
secretive
vlc-bin
dosbox-staging # dosbox appears broken on darwin
# 1. Move config file to /usr/local/etc/wireguard/wg0.conf
@@ -23,8 +11,10 @@
antigravity
];
nixpkgs.config.allowUnfree = true;
programs.vscode.enable = true;
# TODO: consider
# https://nest.pijul.com/yonkeltron/macOS-nix-config:main/ZLDSMIXK5XFW6.EIAAA
# and
# https://github.com/bgub/nix-macos-starter/tree/main
launchd.agents.keyboard-remap = {
# Remap top-left key (paragraph) to backquote and backslash like

View File

@@ -1,5 +1,6 @@
{ pkgs, ... }:
{ pkgs, primaryUser, ... }:
{
home.username = primaryUser;
home.packages = with pkgs; [
stow
wget
@@ -20,7 +21,7 @@
. ~/dotfiles/migrated/.zshrc
else
# If no custom override is available, use the one bundled with flake.
. ${../migrated/.zshrc}
. ${../../migrated/.zshrc}
fi
'';

View File

@@ -0,0 +1,8 @@
{ primaryUser, ... }:
{
imports = [
./common.nix
];
home.homeDirectory = "/home/${primaryUser}";
}

View File

@@ -0,0 +1,16 @@
{ pkgs, primaryUser, ... }:
{
imports = [
./common.nix
];
home.homeDirectory = "/Users/${primaryUser}";
home.packages = with pkgs; [
secretive
vlc-bin
];
nixpkgs.config.allowUnfree = true;
programs.vscode.enable = true;
}