Split configuration into reusable modules
This commit is contained in:
12
flake.nix
12
flake.nix
@@ -61,26 +61,28 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
homeModules = {
|
homeModules = {
|
||||||
main = import ./modules/home.nix;
|
mac-portable = import ./modules/home/mac-portable.nix;
|
||||||
|
linux-headless = import ./modules/home/linux-headless.nix;
|
||||||
};
|
};
|
||||||
darwinModules = {
|
darwinModules = {
|
||||||
mac-portable = import ./modules/mac-portable.nix;
|
mac-portable = import ./modules/darwin/mac-portable.nix;
|
||||||
};
|
};
|
||||||
|
|
||||||
homeConfigurations."artem@deimos" = home-manager.lib.homeManagerConfiguration {
|
homeConfigurations."artem@deimos" = home-manager.lib.homeManagerConfiguration {
|
||||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||||
|
extraSpecialArgs.primaryUser = "artem";
|
||||||
modules = [
|
modules = [
|
||||||
self.homeModules.main
|
|
||||||
vscode-server.homeModules.default
|
vscode-server.homeModules.default
|
||||||
|
self.homeModules.linux-headless
|
||||||
./hosts/deimos/home.nix
|
./hosts/deimos/home.nix
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
homeConfigurations."artem@mars" = home-manager.lib.homeManagerConfiguration {
|
homeConfigurations."artem@mars" = home-manager.lib.homeManagerConfiguration {
|
||||||
pkgs = nixpkgs.legacyPackages.x86_64-darwin;
|
pkgs = nixpkgs.legacyPackages.x86_64-darwin;
|
||||||
specialArgs.primaryUser = "artem";
|
extraSpecialArgs.primaryUser = "artem";
|
||||||
modules = [
|
modules = [
|
||||||
self.homeModules.main
|
self.homeModules.mac-portable
|
||||||
./hosts/mars/home.nix
|
./hosts/mars/home.nix
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
{ pkgs, ... }:
|
_: {
|
||||||
{
|
|
||||||
home.username = "artem";
|
|
||||||
home.homeDirectory = "/home/artem";
|
home.homeDirectory = "/home/artem";
|
||||||
|
|
||||||
services.vscode-server.enable = true;
|
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; [
|
home.packages = with pkgs; [
|
||||||
secretive
|
|
||||||
vlc-bin
|
|
||||||
dosbox-staging # dosbox appears broken on darwin
|
dosbox-staging # dosbox appears broken on darwin
|
||||||
|
|
||||||
# 1. Move config file to /usr/local/etc/wireguard/wg0.conf
|
# 1. Move config file to /usr/local/etc/wireguard/wg0.conf
|
||||||
@@ -23,8 +11,10 @@
|
|||||||
antigravity
|
antigravity
|
||||||
];
|
];
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
# TODO: consider
|
||||||
programs.vscode.enable = true;
|
# 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 = {
|
launchd.agents.keyboard-remap = {
|
||||||
# Remap top-left key (paragraph) to backquote and backslash like
|
# Remap top-left key (paragraph) to backquote and backslash like
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, primaryUser, ... }:
|
||||||
{
|
{
|
||||||
|
home.username = primaryUser;
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
stow
|
stow
|
||||||
wget
|
wget
|
||||||
@@ -20,7 +21,7 @@
|
|||||||
. ~/dotfiles/migrated/.zshrc
|
. ~/dotfiles/migrated/.zshrc
|
||||||
else
|
else
|
||||||
# If no custom override is available, use the one bundled with flake.
|
# If no custom override is available, use the one bundled with flake.
|
||||||
. ${../migrated/.zshrc}
|
. ${../../migrated/.zshrc}
|
||||||
fi
|
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