Split configuration into reusable modules
This commit is contained in:
12
flake.nix
12
flake.nix
@@ -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
|
||||
];
|
||||
};
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.username = "artem";
|
||||
_: {
|
||||
home.homeDirectory = "/home/artem";
|
||||
|
||||
services.vscode-server.enable = true;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
'';
|
||||
|
||||
8
modules/home/linux-headless.nix
Normal file
8
modules/home/linux-headless.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
{ primaryUser, ... }:
|
||||
{
|
||||
imports = [
|
||||
./common.nix
|
||||
];
|
||||
|
||||
home.homeDirectory = "/home/${primaryUser}";
|
||||
}
|
||||
16
modules/home/mac-portable.nix
Normal file
16
modules/home/mac-portable.nix
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user