···11{
22 inputs = { };
3344- outputs = _: {
55- flakeModule = ./flake-module.nix;
66- flakeModules.default = ./flake-module.nix;
44+ outputs =
55+ { self }:
66+ {
77+ flakeModule = import ./flake-module.nix { easy-hosts = self; };
88+ flakeModules.default = import ./flake-module.nix { easy-hosts = self; };
7988- templates = {
99- multi = {
1010- path = ./examples/multi;
1111- description = "A multi-system flake with auto construction enabled, but only using x86_64-linux.";
1212- };
1010+ templates = {
1111+ multi = {
1212+ path = ./examples/multi;
1313+ description = "A multi-system flake with auto construction enabled, but only using x86_64-linux.";
1414+ };
13151414- multi-specialised = {
1515- path = ./examples/multi-specialised;
1616- description = "A multi-system flake with auto construction enabled, using the custom class system of easy-hosts";
1717- };
1616+ multi-specialised = {
1717+ path = ./examples/multi-specialised;
1818+ description = "A multi-system flake with auto construction enabled, using the custom class system of easy-hosts";
1919+ };
18201919- not-auto = {
2020- path = ./examples/not-auto;
2121- description = "A flake with auto construction disabled, using only the `easyHosts.hosts` attribute.";
2222- };
2121+ not-auto = {
2222+ path = ./examples/not-auto;
2323+ description = "A flake with auto construction disabled, using only the `easyHosts.hosts` attribute.";
2424+ };
23252424- only = {
2525- path = ./examples/only;
2626- description = "A flake with auto construction enabled, with only one class and a more 'flat' structure.";
2626+ only = {
2727+ path = ./examples/only;
2828+ description = "A flake with auto construction enabled, with only one class and a more 'flat' structure.";
2929+ };
2730 };
2831 };
2929- };
3032}
+16-1
lib.nix
···22 lib,
33 inputs,
44 withSystem,
55+ easy-hosts,
56 ...
67}:
78let
···261262 # recall `specialArgs` would take be preferred when resolving module structure
262263 # well this is how we do it use it for all args that don't need to rosolve module structure
263264 (singleton {
265265+ key = "easy-hosts#specialArgs";
266266+ _file = "${easy-hosts.outPath}/lib.nix";
267267+264268 _module.args = withSystem system (
265269 { self', inputs', ... }:
266270 {
···272276 # here we make some basic assumptions about the system the person is using
273277 # like the system type and the hostname
274278 (singleton {
279279+ key = "easy-hosts#hostname";
280280+ _file = "${easy-hosts.outPath}/lib.nix";
281281+275282 # we set the systems hostname based on the host value
276283 # which should be a string that is the hostname of the system
277284 networking.hostName = mkDefault name;
285285+ })
286286+287287+ (singleton {
288288+ key = "easy-hosts#nixpkgs";
289289+ _file = "${easy-hosts.outPath}/lib.nix";
278290279291 nixpkgs = {
280292 # you can also do this as `inherit system;` with the normal `lib.nixosSystem`
···292304 # if we are on darwin we need to import the nixpkgs source, its used in some
293305 # modules, if this is not set then you will get an error
294306 (optionals (class == "darwin") (singleton {
307307+ key = "easy-hosts#nixpkgs-darwin";
308308+ _file = "${easy-hosts.outPath}/lib.nix";
309309+295310 # without supplying an upstream nixpkgs source, nix-darwin will not be able to build
296311 # and will complain and log an error demanding that you must set this value
297312 nixpkgs.source = mkDefault nixpkgs;
···386401 ;
387402388403 modules = concatLists (builtins.map (x: x.modules) sources);
389389- specialArgs = builtins.foldl' recursiveUpdate {} (builtins.map (x: x.specialArgs) sources);
404404+ specialArgs = builtins.foldl' recursiveUpdate { } (builtins.map (x: x.specialArgs) sources);
390405 };
391406 }
392407 ))