Move host-specific files under hosts/<name>/ so a second machine can be added without forking the repo. Split system/users.nix and system/display-manager.nix into per-option subfolders, separate the home-manager packages list into a shared base and a personal bundle, extract networking.hostName out of the shared networking module, and inline the git identity into the per-host home.nix. Add .gitignore guardrails to keep secrets out.
36 lines
792 B
Nix
36 lines
792 B
Nix
{
|
|
description = "Personal NixOS Setup";
|
|
inputs = {
|
|
nixpkgs.url = "nixpkgs/nixos-26.05";
|
|
home-manager = {
|
|
url = "github:nix-community/home-manager/release-26.05";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
};
|
|
|
|
outputs = { self, nixpkgs, home-manager, ... }:
|
|
let
|
|
mkHost = { hostPath, username, homePath }: nixpkgs.lib.nixosSystem {
|
|
system = "x86_64-linux";
|
|
modules = [
|
|
hostPath
|
|
home-manager.nixosModules.home-manager {
|
|
home-manager = {
|
|
useGlobalPkgs = true;
|
|
useUserPackages = true;
|
|
users.${username} = import homePath;
|
|
backupFileExtension = "backup";
|
|
};
|
|
}
|
|
];
|
|
};
|
|
in {
|
|
nixosConfigurations.hivebrain = mkHost {
|
|
hostPath = ./hosts/hivebrain;
|
|
username = "marvin";
|
|
homePath = ./hosts/hivebrain/home.nix;
|
|
};
|
|
};
|
|
}
|