Easy Hosts#
This is a nix flake module, this means that it is intended to be used alongside flake-parts.
You can find some examples of how to use this module in the examples directory.
Why use this?#
We provide you with the following attributes self' and inputs' that can be used to make your configuration shorter going from writing. See the below for usage
- inputs.input-name.packages.${pkgs.system}.package-name
+ inputs'.input-name.packages.package-name
- self.packages.${pkgs.system}.package-name
+ self'.packages.package-name
We also can auto construct your hosts based on your file structure. Whilst providing you with a nice api which will allow you to add more settings to your hosts at a later date or consume another flake-module that can work alongside this flake.
Explanation of the module#
TIP
You can find rendered documentation on the flake.parts website
-
easy-hosts.autoConstruct: If set to true, the module will automatically construct the hosts for you from the directory structure ofeasy-hosts.path. -
easy-hosts.path: The directory to where the hosts are stored, this must be set to useeasy-hosts.autoConstruct. -
easy-hosts.onlySystem: If you only have 1 system type likeaarch64-darwinthen you can use this setting to prevent nesting your directories. -
easy-hosts.shared: The shared options for all the hosts.modules: A list of modules that will be included in all the hosts.specialArgs: A list of special arguments that will be passed to all the hosts.
-
easy-hosts.perClass: This provides you with theclassargument such that you can specify what classes get which modules.modules: A list of modules that will be included in all the hosts of the given class.specialArgs: A list of special arguments that will be passed to all the hosts of the given class.
-
easy-hosts.perArch: This provides you with thearchargument such that you can specify what architectures get which modules.modules: A list of modules that will be included in all the hosts of the given arch.specialArgs: A list of special arguments that will be passed to all the hosts of the given arch.
-
easy-hosts.perTag: This provides you with thetagargument such that you can specify what tags get which modules.modules: A list of modules that will be included in all the hosts with the given tag.specialArgs: A list of special arguments that will be passed to all the hosts with the given tag.
-
easy-hosts.additionalClasses: This is an attrset of strings with mappings to any of [ "nixos", "darwin", "iso" ]. The intention here to provide a nicer api forperClassto operate, you may find yourself includingwslas a class because of this. -
easy-hosts.hosts.<host>: The options for the given host.path: the path to the host, this is not strictly needed if you have a flat directory calledhostsorsystems.arch: The architecture of the host.modules: A list of modules that will be included in the host.class: the class of the host, this can be one of [ "nixos", "darwin", "iso" ] or anything defined byeasy-hosts.additionalClasses.tags: tags that apply to the host, you can use this likeclass, but it allows for multiple of them to be present.specialArgs: A list of special arguments that will be passed to the host.deployable: this was added for people who may want to consume a deploy-rs or colmena flakeModule.