restructuring part 2/2
This commit is contained in:
parent
fcc480dbf1
commit
2cc1ad23a7
1 changed files with 27 additions and 19 deletions
32
flake.nix
32
flake.nix
|
|
@ -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));
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue