Flakes: Difference between revisions
imported>Jcsims m Update link due to christine.website redirect |
imported>Erikarvstedt Example flake: Update to default features to new format |
||
| Line 152: | Line 152: | ||
packages."<system>"."<name>" = derivation; | packages."<system>"."<name>" = derivation; | ||
# Executed by `nix build .` | # Executed by `nix build .` | ||
packages."<system>".default = derivation; | |||
# Executed by `nix run .#<name>` | # Executed by `nix run .#<name>` | ||
apps."<system>"."<name>" = { | apps."<system>"."<name>" = { | ||
| Line 160: | Line 159: | ||
}; | }; | ||
# Executed by `nix run . -- <args?>` | # Executed by `nix run . -- <args?>` | ||
apps."<system>".default = { type = "app"; program = "..."; }; | |||
# Used for nixpkgs packages, also accessible via `nix build .#<name>` | # Used for nixpkgs packages, also accessible via `nix build .#<name>` | ||
legacyPackages."<system>"."<name>" = derivation; | legacyPackages."<system>"."<name>" = derivation; | ||
# | # Overlay, consumed by other flakes | ||
overlays."<name>" = final: prev: { }; | |||
# | # Default overlay | ||
overlays = {}; | overlays.default = {}; | ||
# | # Nixos module, consumed by other flakes | ||
nixosModules."<name>" = { config }: { options = {}; config = {}; }; | |||
# | # Default module | ||
nixosModules = {}; | nixosModules.default = {}; | ||
# Used with `nixos-rebuild --flake .#<hostname>` | # Used with `nixos-rebuild --flake .#<hostname>` | ||
# nixosConfigurations."<hostname>".config.system.build.toplevel must be a derivation | # nixosConfigurations."<hostname>".config.system.build.toplevel must be a derivation | ||
nixosConfigurations."<hostname>" = {}; | nixosConfigurations."<hostname>" = {}; | ||
# Used by `nix develop .#<name>` | # Used by `nix develop .#<name>` | ||
devShells."<system>"."<name>" = derivation; | devShells."<system>"."<name>" = derivation; | ||
# Used by `nix develop` | |||
devShells."<system>".default = derivation; | |||
# Hydra build jobs | # Hydra build jobs | ||
hydraJobs."<attr>"."<system>" = derivation; | hydraJobs."<attr>"."<system>" = derivation; | ||
# Used by `nix flake init -t <flake>` | # Used by `nix flake init -t <flake>#<name>` | ||
templates."<name>" = { | |||
path = "<store-path>"; | path = "<store-path>"; | ||
description = "template description goes here?"; | description = "template description goes here?"; | ||
}; | }; | ||
# Used by `nix flake init -t <flake | # Used by `nix flake init -t <flake>` | ||
templates. | templates.default = { path = "<store-path>"; description = ""; }; | ||
} | } | ||
</syntaxHighlight> | </syntaxHighlight> | ||