mirror of
https://github.com/semere-meb/dotfiles-nix.git
synced 2026-08-03 10:24:36 +00:00
auto-discovered host config
This commit is contained in:
parent
edbbc0dbc2
commit
3e14a0acb8
4 changed files with 40 additions and 30 deletions
28
flake.nix
28
flake.nix
|
|
@ -16,15 +16,20 @@
|
|||
let
|
||||
lib = nixpkgs.lib;
|
||||
userVars = import ./vars.nix;
|
||||
in
|
||||
{
|
||||
nixosConfigurations = {
|
||||
nabro = lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = { inherit userVars; };
|
||||
modules = [
|
||||
./hosts/nabro/configuration.nix
|
||||
|
||||
hostsDir = ./hosts;
|
||||
hostNames = builtins.attrNames (
|
||||
lib.filterAttrs (name: type: type == "directory") (builtins.readDir hostsDir)
|
||||
);
|
||||
|
||||
nixosConfigurations = lib.genAttrs hostNames (name:
|
||||
let
|
||||
hostConfig = import (./hosts + "/${name}");
|
||||
in
|
||||
lib.nixosSystem {
|
||||
system = hostConfig.system;
|
||||
specialArgs = { inherit userVars; };
|
||||
modules = [ hostConfig.configModule ] ++ [
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager = {
|
||||
|
|
@ -35,7 +40,10 @@
|
|||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
in
|
||||
{
|
||||
inherit nixosConfigurations;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue