Skip to content

Use Without Flakes

Den does not require Nix flakes. It works with:

  • Nix flakes + flake-parts (most common)
  • Nix flakes without flake-parts
  • No flakes at all (stable Nix + npins or fetchTarball)

Use flake-compat to evaluate Den from a non-flake setup:

default.nix
let
flake = import (fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/...tar.gz";
}) { src = ./.; };
in
flake.outputs

See the noflake template for a complete working example with npins.

Den provides its own minimal flake option when flake-parts is not present. Simply import inputs.den.flakeModule:

let
denCfg = (lib.evalModules {
modules = [
(import-tree ./modules)
inputs.den.flakeModule
];
specialArgs = { inherit inputs; };
}).config;
in {
nixosConfigurations.igloo =
denCfg.flake.nixosConfigurations.igloo;
}

The standard setup — Den integrates seamlessly:

{
outputs = inputs:
inputs.flake-parts.lib.mkFlake { inherit inputs; }
(inputs.import-tree ./modules);
inputs = {
den.url = "github:vic/den";
flake-aspects.url = "github:vic/flake-aspects";
import-tree.url = "github:vic/import-tree";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
};
}

For flake-parts users who want automatic Den + flake-aspects setup:

imports = [ inputs.den.flakeModules.dendritic ];

This auto-configures flake-file inputs for den and flake-aspects.

Den’s only hard dependency is flake-aspects. Everything else is optional:

DependencyRequired?Purpose
flake-aspectsYesAspect composition
import-treeOptionalAuto-import module directories
flake-partsOptionalFlake structuring
nixpkgsOptionalOnly if building NixOS/HM configs
home-managerOptionalOnly if using HM integration