restructuring part 2/2

This commit is contained in:
Xory 2025-08-28 15:01:53 +03:00
parent fcc480dbf1
commit 2cc1ad23a7

View file

@ -8,24 +8,32 @@
};
outputs =
{ nixpkgs, home-manager, ... }:
{
nixosConfigurations = {
nixvm = nixpkgs.lib.nixosSystem {
{ self, nixpkgs, home-manager, ... } @ inputs:
let
system = "x86_64-linux";
username = "xory";
mkNixosHost = hostName:
nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./configuration.nix
home-manager.nixosModules.home-manager
{
./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.xory = ./home.nix;
# Optionally, use home-manager.extraSpecialArgs to pass
# arguments to home.nix
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));
};
}