2025-08-31 22:46:42 -04:00
|
|
|
{
|
2025-08-31 22:59:47 -04:00
|
|
|
description = "Multi-machine Home Manager (Linux/macOS/NixOS)";
|
2025-08-31 22:46:42 -04:00
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
|
|
|
home-manager.url = "github:nix-community/home-manager";
|
|
|
|
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
outputs = { self, nixpkgs, home-manager, ... }: let
|
|
|
|
|
system = builtins.currentSystem;
|
|
|
|
|
pkgs = import nixpkgs { inherit system; };
|
2025-08-31 22:59:47 -04:00
|
|
|
|
|
|
|
|
# Grab hostname from environment
|
2025-08-31 22:46:42 -04:00
|
|
|
hostname = builtins.getEnv "HOSTNAME";
|
|
|
|
|
in {
|
2025-08-31 22:59:47 -04:00
|
|
|
# -------- Standalone Home Manager (macOS / non-NixOS Linux) --------
|
2025-08-31 22:46:42 -04:00
|
|
|
homeConfigurations = {
|
|
|
|
|
"${hostname}" = home-manager.lib.homeManagerConfiguration {
|
|
|
|
|
inherit pkgs;
|
|
|
|
|
modules = [
|
|
|
|
|
./common.nix
|
|
|
|
|
./${hostname}/home.nix
|
|
|
|
|
];
|
2025-08-31 22:59:47 -04:00
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# -------- NixOS Integration --------
|
|
|
|
|
nixosConfigurations = {
|
|
|
|
|
"${hostname}" = nixpkgs.lib.nixosSystem {
|
|
|
|
|
inherit system;
|
|
|
|
|
modules = [
|
|
|
|
|
./configuration.nix
|
|
|
|
|
|
|
|
|
|
# Enable Home Manager as NixOS module
|
|
|
|
|
home-manager.nixosModules.home-manager
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
home-manager.useGlobalPkgs = true;
|
|
|
|
|
home-manager.useUserPackages = true;
|
|
|
|
|
|
|
|
|
|
home-manager.users.elisha = {
|
|
|
|
|
imports = [
|
|
|
|
|
./common.nix
|
|
|
|
|
./${hostname}/home.nix
|
|
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
};
|
2025-08-31 22:46:42 -04:00
|
|
|
};
|
2025-08-31 22:56:32 -04:00
|
|
|
};
|
2025-08-31 22:46:42 -04:00
|
|
|
}
|