···2828 - uses: DeterminateSystems/magic-nix-cache-action@v13
2929 - uses: actions/checkout@v4
3030 - run: sed -i 's@# den.outPath@den.outPath@' templates/noflake/with-inputs.nix
3131- - run: cd templates/noflake && nix-build -A flake.nixosConfigurations.igloo.config.system.build.toplevel
3131+ - run: cd templates/noflake && nix-build -A nixosConfigurations.igloo.config.system.build.toplevel
3232 template:
3333 needs: [non-draft]
3434 strategy:
+7-4
templates/noflake/README.md
···6677Try it with:
8899+```shell
1010+nixos-rebuild build --file . -A nixosConfigurations.igloo
911```
1010-nix-build -A flake.nixosConfigurations.igloo.config.system.build.toplevel
1111-```
12121313-NOTE: Currently Den needs a top-level attribute where to place configurations,
1414-by default it is the `flake` attribute, even if Den uses no flake-parts at all.
1313+or
1414+1515+```shell
1616+nix-build -A nixosConfigurations.igloo.config.system.build.toplevel
1717+```
+4-8
templates/noflake/default.nix
···11let
2233- modules =
44- { inputs, ... }:
55- {
66- imports = [ (inputs.import-tree ./modules) ];
77- };
88-93 outputs =
104 inputs:
115 (inputs.nixpkgs.lib.evalModules {
1212- modules = [ modules ];
66+ modules = [ (inputs.import-tree ./modules) ];
137 specialArgs = {
148 inherit inputs;
159 inherit (inputs) self;
···1711 }).config;
18121913in
2020-import ./with-inputs.nix outputs
1414+# Den outputs configurations at flake top-level attr
1515+# even when it does not depend on flakes or flake-parts.
1616+(import ./with-inputs.nix outputs).flake
+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+}
+35-9
templates/noflake/modules/den.nix
···11-{ inputs, lib, ... }:
11+{ inputs, ... }:
22{
33- # we can import this flakeModule even if we dont
44- # have flake-parts as input!
55- imports = [ inputs.den.flakeModule ];
66-77- # for flake.nixosConfigurations output.
88- # create a freeform option for it
99- options.flake = lib.mkOption {
1010- type = lib.types.submodule { freeformType = lib.types.anything; };
33+ # tux user on igloo host.
44+ den.hosts.x86_64-linux.igloo.users.tux = { };
55+66+ # host aspect
77+ den.aspects.igloo = {
88+ nixos =
99+ { pkgs, ... }:
1010+ {
1111+ # remove these for a real bootable host
1212+ boot.loader.grub.enable = false;
1313+ fileSystems."/".device = "/dev/fake";
1414+ passthru = { };
1515+1616+ environment.systemPackages = [
1717+ pkgs.vim
1818+ ];
1919+ };
2020+ };
2121+2222+ # user aspect
2323+ den.aspects.tux = {
2424+ # user configures the host it lives in
2525+ nixos = {
2626+ # hipster-tux uses nix-maid instead of home-manager.
2727+ imports = [ inputs.nix-maid.nixosModules.default ];
2828+2929+ users.users.tux = {
3030+ isNormalUser = true;
3131+ maid.file.home.".gitconfig".text = ''
3232+ [user]
3333+ name=Tux
3434+ '';
3535+ };
3636+ };
1137 };
1238}