mirror of
https://github.com/JulienMalka/snowfield.git
synced 2025-03-26 05:40:52 +01:00
31 lines
790 B
Nix
31 lines
790 B
Nix
{ nixpkgs, home-manager, inputs }:
|
|
with builtins;
|
|
|
|
let mapAttrNames = f: set:
|
|
listToAttrs (map (attr: { name = f attr; value = set.${attr}; }) (attrNames set));
|
|
in
|
|
{
|
|
|
|
mkMachine = host: host-config: modules: nixpkgs.lib.nixosSystem {
|
|
system = "x86_64-linux";
|
|
specialArgs = {
|
|
inherit inputs;
|
|
};
|
|
modules = builtins.attrValues modules ++ [
|
|
./configuration.nix
|
|
host-config
|
|
home-manager.nixosModules.home-manager
|
|
{
|
|
home-manager.useUserPackages = true;
|
|
nixpkgs.overlays = [
|
|
inputs.neovim-nightly-overlay.overlay
|
|
];
|
|
}
|
|
];
|
|
};
|
|
|
|
|
|
importConfig = path: (mapAttrNames (name: nixpkgs.lib.removeSuffix ".nix" name)) ((builtins.mapAttrs (name: value: import (path + "/${name}")) (builtins.readDir path)));
|
|
|
|
|
|
}
|