Template: No-Flake
The noflake template shows that Den works perfectly without Nix flakes. It uses npins for dependency management and works with stable Nix.
Initialize
Section titled “Initialize”Since this template doesn’t use flakes, clone it manually:
mkdir my-nix && cd my-nixcp -r $(nix eval --raw 'github:vic/den#templates.noflake.path')/* .npins update denOr use nix flake init if you have flakes enabled:
nix flake init -t github:vic/den#noflakeProject Structure
Section titled “Project Structure”default.nix # entry point (replaces flake.nix)with-inputs.nix # input resolver (replaces flake.lock)npins/ default.nix # npins fetcher sources.json # pinned dependenciesmodules/ den.nix # host/user declarations + aspectsFile by File
Section titled “File by File”default.nix — Entry Point
Section titled “default.nix — Entry Point”let outputs = inputs: (inputs.nixpkgs.lib.evalModules { modules = [ (inputs.import-tree ./modules) ]; specialArgs = { inherit inputs; inherit (inputs) self; }; }).config;inimport ./with-inputs.nix outputsThis is the noflake equivalent of flake.nix. It uses lib.evalModules directly — the same mechanism Den uses internally.
with-inputs.nix — Input Resolution
Section titled “with-inputs.nix — Input Resolution”This file resolves npins sources into a flake-compatible inputs attrset. It reads flake.nix from each dependency to discover transitive inputs and wires them together.
modules/den.nix — Configuration
Section titled “modules/den.nix — Configuration”{ inputs, ... }:{ imports = [ inputs.den.flakeModule ];
den.default.nixos = { fileSystems."/".device = "/dev/fake"; boot.loader.grub.enable = false; };
den.hosts.x86_64-linux.igloo.users.tux = { };
den.aspects.igloo = { nixos = { pkgs, ... }: { environment.systemPackages = [ pkgs.vim ]; }; };
den.aspects.tux = { nixos = { imports = [ inputs.nix-maid.nixosModules.default ]; users.users.tux = { isNormalUser = true; maid.file.home.".gitconfig".text = '' [user] name=Tux ''; }; }; };}Notable differences from the flake templates:
- Uses nix-maid instead of Home-Manager (lighter alternative)
- User config is done directly in
nixosclass (no HM class needed)
npins update dennixos-rebuild build --file . -A flake.nixosConfigurations.iglooOr with nix-build:
nix-build -A flake.nixosConfigurations.igloo.config.system.build.toplevelWhat It Provides
Section titled “What It Provides”| Feature | Provided |
|---|---|
| NixOS host configuration | ✓ |
| No flakes required | ✓ |
| npins dependency pinning | ✓ |
| nix-maid (HM alternative) | ✓ |
| Home-Manager | ✗ (use nix-maid) |
| flake-parts | ✗ |
Next Steps
Section titled “Next Steps”- Read Use Without Flakes for more details on flake-free usage
- Consider the Minimal template if you want flakes but not flake-parts