···11+{ inputs, lib, ... }:
22+if inputs ? flake-parts then
33+ { }
44+else
55+ {
66+ # NOTE: Currently Den needs a top-level attribute where to place configurations,
77+ # by default it is the `flake` attribute, even if Den uses no flake-parts at all.
88+ options.flake = lib.mkOption {
99+ type = lib.types.submodule { freeformType = lib.types.anything; };
1010+ };
1111+ }
···11{ inputs, den, ... }:
22{
33- systems = builtins.attrNames den.hosts;
33+ # we can import this flakeModule even if we dont have flake-parts as input!
44 imports = [ inputs.den.flakeModule ];
5566 den.hosts.x86_64-linux.igloo.users.tux = { };
77- den.aspects.igloo = { };
77+88+ den.aspects.igloo = {
99+ nixos =
1010+ { pkgs, ... }:
1111+ {
1212+ environment.systemPackages = [ pkgs.hello ];
1313+ passthru = { };
1414+ };
1515+ };
1616+1717+ den.aspects.tux = {
1818+ includes = [ den.provides.primary-user ];
1919+ };
820}
-11
templates/noflake/modules/compat.nix
···11-{ inputs, lib, ... }:
22-{
33- # we can import this flakeModule even if we dont have flake-parts as input!
44- imports = [ inputs.den.flakeModule ];
55-66- # NOTE: Currently Den needs a top-level attribute where to place configurations,
77- # by default it is the `flake` attribute, even if Den uses no flake-parts at all.
88- options.flake = lib.mkOption {
99- type = lib.types.submodule { freeformType = lib.types.anything; };
1010- };
1111-}
+3-4
templates/noflake/modules/den.nix
···11{ inputs, ... }:
22{
33+ # we can import this flakeModule even if we dont have flake-parts as input!
44+ imports = [ inputs.den.flakeModule ];
55+36 # tux user on igloo host.
47 den.hosts.x86_64-linux.igloo.users.tux = { };
58···811 nixos =
912 { pkgs, ... }:
1013 {
1111- # remove these for a real bootable host
1212- boot.loader.grub.enable = false;
1313- fileSystems."/".device = "/dev/fake";
1414 passthru = { };
1515-1615 environment.systemPackages = [
1716 pkgs.vim
1817 ];