This commit is contained in:
2025-11-15 23:17:12 +08:00
parent 6f3ea7bb47
commit 389e780660
18 changed files with 1597 additions and 90 deletions
+28 -47
View File
@@ -7,60 +7,41 @@
pkgs,
...
}: {
# You can import other home-manager modules here
# Import modular configurations
imports = [
# Base configuration shared across all platforms
./common.nix
# Feature modules
./development.nix
./shell.nix
./terminal.nix
# Platform-specific configurations
./linux.nix
./darwin.nix
# If you want to use modules your own flake exports (from modules/home-manager):
# inputs.self.homeManagerModules.example
# Or modules exported from other flakes (such as nix-colors):
# inputs.nix-colors.homeManagerModules.default
# You can also split up your configuration and import pieces of it here:
# ./nvim.nix
];
nixpkgs = {
# You can add overlays here
overlays = [
# Add overlays your own flake exports (from overlays and pkgs dir):
inputs.self.overlays.additions
inputs.self.overlays.modifications
inputs.self.overlays.unstable-packages
# You can also add overlays exported from other flakes:
# neovim-nightly-overlay.overlays.default
# Or define it inline, for example:
# (final: prev: {
# hi = final.hello.overrideAttrs (oldAttrs: {
# patches = [ ./change-hello-to-hi.patch ];
# });
# })
];
# Configure your nixpkgs instance
config = {
# Disable if you don't want unfree packages
allowUnfree = true;
};
};
# TODO: Set your username
home = {
username = "your-username";
homeDirectory = "/home/your-username";
username = lib.mkDefault "your-username";
homeDirectory = lib.mkDefault (
if pkgs.stdenv.isDarwin
then "/Users/${config.home.username}"
else "/home/${config.home.username}"
);
};
# Add stuff for your user as you see fit:
# programs.neovim.enable = true;
# home.packages = with pkgs; [ steam ];
# Enable home-manager and git
programs.home-manager.enable = true;
programs.git.enable = true;
# Nicely reload system units when changing configs
systemd.user.startServices = "sd-switch";
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
home.stateVersion = "23.05";
# Platform-aware session variables
home.sessionVariables = {
EDITOR = "nvim";
VISUAL = "nvim";
} // lib.optionalAttrs pkgs.stdenv.isDarwin {
# macOS-specific environment variables
} // lib.optionalAttrs pkgs.stdenv.isLinux {
# Linux-specific environment variables
};
}