39 lines
1 KiB
Nix
39 lines
1 KiB
Nix
{
|
|
description = "NixOS configuration";
|
|
|
|
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, ... } @ inputs:
|
|
let
|
|
system = "x86_64-linux";
|
|
username = "xory";
|
|
|
|
mkNixosHost = hostName:
|
|
nixpkgs.lib.nixosSystem {
|
|
inherit system;
|
|
modules = [
|
|
./hosts/${hostName}/configuration.nix
|
|
./hosts/${hostName}/hardware-configuration.nix
|
|
|
|
home-manager.nixosModules.home-manager {
|
|
home-manager.useGlobalPkgs = true;
|
|
home-manager.useUserPackages = true;
|
|
home-manager.users.${username} = import ./hosts/${hostName}/home.nix;
|
|
}
|
|
];
|
|
};
|
|
in {
|
|
nixosConfigurations = nixpkgs.lib.mapAttrs'
|
|
(name: value: {
|
|
name = name;
|
|
value = mkNixosHost name;
|
|
})
|
|
(nixpkgs.lib.filterAttrs (name: value: value == "directory")
|
|
(builtins.readDir ./hosts));
|
|
};
|
|
}
|