First commit
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
{
|
||||
description = "NixOS baseline everywhere + per-host exceptions + HM deviations";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, home-manager, ... }:
|
||||
let
|
||||
lib = nixpkgs.lib;
|
||||
|
||||
# Helper: make a NixOS system for a host
|
||||
mkHost =
|
||||
{ hostname
|
||||
, system ? "x86_64-linux"
|
||||
, username ? "henrov"
|
||||
}:
|
||||
lib.nixosSystem {
|
||||
inherit system;
|
||||
|
||||
modules = [
|
||||
# --- Host entrypoint ---
|
||||
./hosts/${hostname}/configuration.nix
|
||||
|
||||
# --- Shared baseline for ALL machines ---
|
||||
./modules/nixos/base.nix
|
||||
|
||||
# --- Home Manager as a NixOS module ---
|
||||
home-manager.nixosModules.home-manager
|
||||
|
||||
# --- HM integration settings ---
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
|
||||
# Your user HM entrypoint
|
||||
home-manager.users.${username} = import ./home/${username}/home.nix;
|
||||
}
|
||||
];
|
||||
|
||||
specialArgs = {
|
||||
inherit self hostname username;
|
||||
};
|
||||
};
|
||||
|
||||
in
|
||||
{
|
||||
nixosConfigurations = {
|
||||
traveldroid = mkHost {
|
||||
hostname = "traveldroid";
|
||||
system = "x86_64-linux";
|
||||
username = "henrov";
|
||||
};
|
||||
|
||||
# Add more hosts like this:
|
||||
# workstation = mkHost { hostname = "workstation"; system = "x86_64-linux"; username = "henrov"; };
|
||||
# laptop = mkHost { hostname = "laptop"; system = "x86_64-linux"; username = "henrov"; };
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user