Flakes: Difference between revisions

imported>Asymmetric
m nixFlakes -> nixUnstable consistency
imported>Asymmetric
m Output schema: use <name> everywhere for clarity
Line 137: Line 137:
{
{
   # Executed by `nix flake check`
   # Executed by `nix flake check`
   checks."<system>"."<attr>" = derivation;
   checks."<system>"."<name>" = derivation;
   # Executed by `nix build .#<name>`
   # Executed by `nix build .#<name>`
   packages."<system>"."<attr>" = derivation;
   packages."<system>"."<name>" = derivation;
   # Executed by `nix build .`
   # Executed by `nix build .`
   defaultPackage."<system>" = derivation;
   defaultPackage."<system>" = derivation;
   # Executed by `nix run .#<name>`
   # Executed by `nix run .#<name>`
   apps."<system>"."<attr>" = {
   apps."<system>"."<name>" = {
     type = "app";
     type = "app";
     program = "<store-path>";
     program = "<store-path>";
Line 151: Line 151:
    
    
   # Used for nixpkgs packages, also accessible via `nix build .#<name>`
   # Used for nixpkgs packages, also accessible via `nix build .#<name>`
   legacyPackages."<system>"."<attr>" = derivation;
   legacyPackages."<system>"."<name>" = derivation;
   # Default overlay, for use in dependent flakes
   # Default overlay, for use in dependent flakes
   overlay = final: prev: { };
   overlay = final: prev: { };
Line 160: Line 160:
   # Same idea as nixosModule but a list or attrset of them.
   # Same idea as nixosModule but a list or attrset of them.
   nixosModules = {};
   nixosModules = {};
   # Attrset of nixos configurations by hostname.
   # Used with `nixos-rebuild --flake .#<hostname>`
   nixosConfigurations."<hostname>" = {};
   nixosConfigurations."<hostname>" = {};
   # Used by `nix develop`
   # Used by `nix develop`
Line 171: Line 171:
     description = "template description goes here?";
     description = "template description goes here?";
   };
   };
   # Used by `nix flake init -t <flake>#<attr>`
   # Used by `nix flake init -t <flake>#<name>`
   templates."<attr>" = { path = "<store-path>"; description = ""; };
   templates."<name>" = { path = "<store-path>"; description = ""; };
}
}
</syntaxHighlight>
</syntaxHighlight>