### Example Initial SQL Commands Source: https://flake.parts/options/devenv Provides an example of SQL commands to create roles for database initialization. These commands are executed after server-wide setup. ```sql CREATE ROLE postgres SUPERUSER; CREATE ROLE bar; ``` -------------------------------- ### Example Crate Configuration Source: https://flake.parts/options/nix-cargo-integration An example of how to configure a specific crate to be exported. ```nix __ { my-crate = { export = true; }; } ``` -------------------------------- ### Example Container Package Source: https://flake.parts/options/nix-oci An example of how to specify the 'hello' package as the main package for a container. ```nix __ pkgs.hello ``` -------------------------------- ### Example Host Directory Source: https://flake.parts/options/easy-hosts An example of setting the host directory to a relative path. ```nix __ ./hosts ``` -------------------------------- ### Example App Configuration Source: https://flake.parts/options/flake-parts An example of how to configure an app, linking to the 'hello' package's executable. ```nix { default.program = "${config.packages.hello}/bin/hello"; } ``` -------------------------------- ### Example Tag Configuration with Modules Source: https://flake.parts/options/easy-hosts An example of configuring tag-specific modules and special arguments. ```nix __ let tagModule = { laptop = ./modules/laptop; gaming = ./modules/gaming; }; in tag: { modules = [ tagModule.${tag} ]; specialArgs = { }; } ``` -------------------------------- ### Example of Default Target Setting Source: https://flake.parts/options/nix-cargo-integration An example demonstrating how to set a target as the default. ```nix true ``` -------------------------------- ### Example Per-Architecture Settings Source: https://flake.parts/options/easy-hosts Example of configuring per-architecture settings, specifying modules and special arguments. ```nix __ arch: { modules = [ { system.nixos.label = arch; } ]; specialArgs = { }; } ``` -------------------------------- ### Example Per-Architecture Modules Source: https://flake.parts/options/easy-hosts Example of including specific Nix modules for per-architecture configuration. ```nix __ [ ./hardware-configuration.nix ./networking.nix ] ``` -------------------------------- ### Example Apple SDK Configuration Source: https://flake.parts/options/devenv An example of how to specify a particular Apple SDK version, such as 'pkgs.apple-sdk_15'. ```nix pkgs.apple-sdk_15 ``` -------------------------------- ### Example Per-Class Settings Source: https://flake.parts/options/easy-hosts Example of configuring per-class settings, specifying modules and special arguments. ```nix __ class: { modules = [ { system.nixos.label = class; } ]; specialArgs = { }; } ``` -------------------------------- ### Example Project Path Source: https://flake.parts/options/nix-cargo-integration An example of specifying the absolute path to a Rust project. ```nix ./path/to/project ``` -------------------------------- ### Example Per-Tag Modules Source: https://flake.parts/options/easy-hosts An example list of modules to be included for specific tags. ```nix __ [ ./hardware-configuration.nix ./networking.nix ] ``` -------------------------------- ### Example Pre-commit Package Source: https://flake.parts/options/git-hooks-nix An example of an alternative package that can be used for pre-commit hooks. ```nix __ pkgs.prek ``` -------------------------------- ### Example of Dependencies Derivation Configuration Source: https://flake.parts/options/nix-cargo-integration Example showing how to set build inputs and environment variables for dependency derivation. ```nix { mkDerivation = { # inputs and most other stuff will automatically merge buildInputs = [pkgs.hello]; }; # define env variables and options not defined in standard mkDerivation interface like this env = { CARGO_TERM_VERBOSE = "true"; someOtherEnvVar = 1; }; } ``` -------------------------------- ### Job Environment Example Source: https://flake.parts/options/github-actions-nix Example of setting the environment for a job. Can be a simple string name. ```nix __ "production" ``` -------------------------------- ### Example Mypy Directories Configuration Source: https://flake.parts/options/treefmt-nix An example configuration for mypy directories, specifying modules and subdirectories. ```nix __ { "" = { modules = [ "mymodule" "tests" ]; }; subdir = { }; } ``` -------------------------------- ### Example Per-Architecture Special Arguments Source: https://flake.parts/options/easy-hosts Example of passing custom special arguments for per-architecture configuration. ```nix __ { foo = "bar"; } ``` -------------------------------- ### Example Repository Tag Source: https://flake.parts/options/hercules-ci-effects Example of a repository tag. This option is read-only and will be null if not on a tag. ```nix __ "1.0" ``` -------------------------------- ### Example Test Profile Source: https://flake.parts/options/nix-cargo-integration An example of specifying a custom profile for tests. ```nix __ "custom-profile" ``` -------------------------------- ### List of Strings Option Example Source: https://flake.parts/options/git-hooks-nix Example of a list of strings option for file globs. ```nix [ "flake.nix" "_*" ] ``` -------------------------------- ### Example Terraform Package Source: https://flake.parts/options/terranix Provides an example of how to specify a different Terraform package, such as pkgs.opentofu. ```nix pkgs.opentofu ``` -------------------------------- ### Go Test Integration Flags Example Source: https://flake.parts/options/git-hooks-nix An example of setting integration tags for gotest flags. ```nix __ "-tags integration" ``` -------------------------------- ### Example Package Profiles Source: https://flake.parts/options/nix-cargo-integration Provides an example of how to specify a list of profiles for package generation, including 'dev', 'release', and 'custom-profile'. ```nix __ ["dev" "release" "custom-profile"] ``` -------------------------------- ### Example Toolchain Configuration Path Source: https://flake.parts/options/nix-cargo-integration An example of specifying the toolchain configuration using a path to a local rust-toolchain.toml file. ```nix __ ./rust-subproject/rust-toolchain.toml ``` -------------------------------- ### Example: Set mkdocs Root Directory Source: https://flake.parts/options/mkdocs-flake An example demonstrating how to specify a custom path for your mkdocs documentation project. ```nix "./documentation" ``` -------------------------------- ### Example Ignore Patterns Source: https://flake.parts/options/git-hooks-nix Provides an example of a list of strings for file ignore patterns. ```nix __ [ "*.test.js" "dist/" ] ``` -------------------------------- ### Example Forge Implementation Source: https://flake.parts/options/hercules-ci-effects Example of the forge implementation hosting the repository, such as 'github'. This option is read-only. ```nix __ "github" ``` -------------------------------- ### Example Host Entries Configuration Source: https://flake.parts/options/devenv An example of how to configure host entries, mapping domain names to IP addresses or lists of IP addresses. ```nix { "another-example.com" = [ "::1" "127.0.0.1" ]; "example.com" = "127.0.0.1"; } ``` -------------------------------- ### Example ESLint Binary Path Source: https://flake.parts/options/git-hooks-nix An example of how to specify the ESLint binary path when using node_modules. ```nix "./node_modules/.bin/eslint" ``` -------------------------------- ### Home Manager Configuration Example Source: https://flake.parts/options/devenv Example of Home Manager configuration for a machine, including username, home directory, and enabling Git. ```nix { home.username = "jdoe"; home.homeDirectory = "/home/jdoe"; programs.git.enable = true; } ``` -------------------------------- ### Example of Merging Build Inputs Source: https://flake.parts/options/devenv An example demonstrating how to specify packages and Python packages with specific libraries to be included in the shell environment. ```nix [ pkgs.hello (pkgs.python3.withPackages (ps: [ ps.numpy ps.pandas ])) ] ``` -------------------------------- ### Example of Extra `pkgs.mkShell` Arguments Source: https://flake.parts/options/haskell-flake Example demonstrating how to use `shellHook` to re-generate `.cabal` files using `hpack`, ensuring HLS compatibility. ```nix '' { shellHook = '' # Re-generate .cabal files so HLS will work (per hie.yaml) ''${pkgs.findutils}/bin/find -name package.yaml -exec hpack {} \; ''; }; '' ``` -------------------------------- ### String Option: Multiline Configuration Example Source: https://flake.parts/options/git-hooks-nix Example of a multiline string configuration passed as a config file for linters or formatters. ```nix '' { "checks": { "typography.diacritical_marks": false } } '' ``` -------------------------------- ### NixOS Configuration Example Source: https://flake.parts/options/devenv Example of NixOS configuration for a machine, defining file systems, boot loader, and SSH service. ```nix { fileSystems."/".device = "/dev/sda1"; boot.loader.systemd-boot.enable = true; services.openssh.enable = true; } ``` -------------------------------- ### Socket Activation Configuration Example Source: https://flake.parts/options/devenv Example configuration for systemd-style socket activation. Includes TCP and Unix stream sockets. ```nix [ { address = "127.0.0.1:8080"; kind = "tcp"; name = "http"; } { kind = "unix_stream"; mode = 384; name = "admin"; path = "$DEVENV_STATE/admin.sock"; } ] ``` -------------------------------- ### Biome Binary Path Example Source: https://flake.parts/options/git-hooks-nix Example showing how to specify the biome binary path, useful for using biome from node_modules. ```nix "${tools.biome}/bin/biome" ``` -------------------------------- ### Additional Dependencies Example Source: https://flake.parts/options/nix-oci Include additional dependency packages in the container. This example adds bash and coreutils. ```nix __ [ pkgs.bash pkgs.coreutils ] ``` -------------------------------- ### Custom oxlint Binary Path Example Source: https://flake.parts/options/git-hooks-nix Example of specifying a custom path for the oxlint binary, such as from a local node_modules directory. ```nix __ "./node_modules/.bin/oxlint" ``` -------------------------------- ### Example custom config file for typos Source: https://flake.parts/options/treefmt-nix Provides an example of specifying a custom configuration file for typos. ```nix __ "typos.toml" ``` -------------------------------- ### NixOS Configuration Example Source: https://flake.parts/options/flake-parts Example of defining NixOS configurations for specific machines. It shows how to include system configurations and custom modules. ```nix __ { my-machine = inputs.nixpkgs.lib.nixosSystem { # system is not needed with freshly generated hardware-configuration.nix # system = "x86_64-linux"; # or set nixpkgs.hostPlatform in a module. modules = [ ./my-machine/nixos-configuration.nix config.nixosModules.my-module ]; }; } ``` -------------------------------- ### Biome Binary Path from Node Modules Example Source: https://flake.parts/options/git-hooks-nix Example demonstrating how to set the biome binary path to a location within node_modules. ```nix "./node_modules/.bin/biome" ``` -------------------------------- ### Example Dependency Derivation Configuration Source: https://flake.parts/options/nix-cargo-integration An example of customizing dependency derivation configuration, including mkDerivation options and environment variables. ```nix __ { mkDerivation = { # inputs and most other stuff will automatically merge buildInputs = [pkgs.hello]; }; # define env variables and options not defined in standard mkDerivation interface like this env = { CARGO_TERM_VERBOSE = "true"; someOtherEnvVar = 1; }; } ``` -------------------------------- ### Example Workflow Name Source: https://flake.parts/options/github-actions-nix Shows a simple string example for naming a GitHub Actions workflow. ```nix "CI" ``` -------------------------------- ### Example Flake App Configuration Source: https://flake.parts/options/process-compose-flake An example of how to configure a flake app with specific processes, such as a watch-server with backend and frontend services. ```nix __ { watch-server = { processes = { backend = "${pkgs.simple-http-server}"; frontend = "${pkgs.simple-http-server}"; }; }; }; ``` -------------------------------- ### Example Developer Environment Path Source: https://flake.parts/options/conan-flake An example of a relative path to the developer environment, specifying a subdirectory named 'dev'. ```nix ".\"/dev\"" ``` -------------------------------- ### Java Command Line Options Example Source: https://flake.parts/options/devenv Provides an example of how to specify extra command-line options for Java. This is useful for configuring JVM behavior. ```Nix __ [ "-Djava.net.preferIPv4Stack=true" ] ``` -------------------------------- ### Multiline String Configuration Example Source: https://flake.parts/options/git-hooks-nix Example of a multiline string configuration for a tool like Vale. This allows for complex configurations to be passed as a single string. ```nix '' MinAlertLevel = suggestion [*] BasedOnStyles = Vale '' ``` -------------------------------- ### Example of Extra Haskell Libraries Source: https://flake.parts/options/haskell-flake Example demonstrating how to specify extra Haskell libraries, inheriting from the `releaser` package. ```nix hp: { inherit (hp) releaser; } ``` -------------------------------- ### Nix-Darwin Configuration Example Source: https://flake.parts/options/devenv Example of nix-darwin configuration for a machine, specifying system packages and enabling the nix-daemon service. ```nix { pkgs, ... }: { environment.systemPackages = [ pkgs.vim ]; services.nix-daemon.enable = true; } ``` -------------------------------- ### WireMock Mappings Example Source: https://flake.parts/options/devenv Defines the mappings for WireMock to mock requests. This example shows how to stub GET requests for '/body' and '/json' with different response types. ```nix [ { request = { method = "GET"; url = "/body"; }; response = { body = "Literal text to put in the body"; headers = { Content-Type = "text/plain"; }; status = 200; }; } { request = { method = "GET"; url = "/json"; }; response = { jsonBody = { someField = "someValue"; }; status = 200; }; } ] ``` -------------------------------- ### Add PostgreSQL Extensions Source: https://flake.parts/options/devenv Specifies additional PostgreSQL extensions to install. This example includes pg_cron, postgis, and timescaledb. ```nix extensions: [ extensions.pg_cron extensions.postgis extensions.timescaledb ]; ``` -------------------------------- ### Example of Named Ports with Auto-Allocation Source: https://flake.parts/options/devenv Demonstrates how to define named ports with auto-allocation. devenv will find available ports starting from the specified base value. ```nix { http.allocate = 8080; admin.allocate = 9000; } ``` -------------------------------- ### Initializing pkgs with overlays Source: https://flake.parts/options/flake-parts-easyoverlay Example of how to initialize the pkgs argument with custom overlays, including one from an external flake and an inline overlay for patching specific attributes. This is an alternative to directly consuming overlays. ```nix __ perSystem = { system, ... }: { _module.args.pkgs = import inputs.nixpkgs { inherit system; overlays = [ inputs.foo.overlays.default (final: prev: { # ... things you really need to patch ... }) ]; config = { }; }; }; ``` -------------------------------- ### Example Special Arguments Source: https://flake.parts/options/easy-hosts An example of how to define special arguments for a class. ```nix __ { foo = "bar"; } ``` -------------------------------- ### Example of running a specific diagnostic Source: https://flake.parts/options/treefmt-nix An example specifying to only run the 'sema-primop-overridden' diagnostic. ```nix "sema-primop-overridden" ``` -------------------------------- ### Job Dependencies Example Source: https://flake.parts/options/github-actions-nix Example of specifying jobs that must complete successfully before this job runs. Accepts a list of job names. ```nix __ [ "build" "lint" ] ``` -------------------------------- ### Job Permissions Example Source: https://flake.parts/options/github-actions-nix Example of setting specific permissions for the GITHUB_TOKEN within a job. Permissions can be 'read', 'write', or 'none'. ```nix __ { contents = "read"; pull-requests = "write"; } ``` -------------------------------- ### Example Extra PYTHONPATH Paths Source: https://flake.parts/options/treefmt-nix An example of adding a custom path to PYTHONPATH. ```nix __ [ "path/to/my/module" ] ``` -------------------------------- ### Example Profile Inheritance Source: https://flake.parts/options/devenv A list of profile names to extend or inherit from. This example shows inheriting 'base' and 'backend' profiles. ```nix __ [ "base" "backend" ] ``` -------------------------------- ### Example Merging Build Inputs in Development Shell Source: https://flake.parts/options/conan-flake An example demonstrating how to merge build inputs into the development shell environment. It includes the 'hello' package and Python 3 with numpy and pandas. ```nix __ [ pkgs.hello (pkgs.python3.withPackages (ps: [ ps.numpy ps.pandas ])) ] ``` -------------------------------- ### Example: Custom Shell Hook Source: https://flake.parts/options/ocaml-flake This example demonstrates how to add a custom shell hook to the dev shell using `mkShellArgs`. ```nix '' { shellHook = '' echo "example shell hook" ''; }; '' ``` -------------------------------- ### Example Additional Dependencies for OCI Container Source: https://flake.parts/options/nix-oci Shows an example of adding bash and coreutils packages as additional dependencies for an OCI container. ```nix __ [ pkgs.bash pkgs.coreutils ] ``` -------------------------------- ### Example of ignored diagnostics Source: https://flake.parts/options/treefmt-nix An example showing how to ignore a specific diagnostic ID, 'sema-primop-overridden'. ```nix [ "sema-primop-overridden" ] ``` -------------------------------- ### Overlay Definition Example Source: https://flake.parts/options/flake-parts Example of defining a package overlay. The `default` overlay is shown, which is a function that takes final and previous package sets. ```nix __ { default = final: prev: {}; } ``` -------------------------------- ### Initial Database Creation with Schemas Source: https://flake.parts/options/devenv Defines initial databases with optional schema files. Use this to pre-populate databases on first startup. ```nix [ { name = "foodatabase"; schema = ./foodatabase.sql; } { name = "bardatabase"; } ] ``` -------------------------------- ### CouchDB Configuration Example Source: https://flake.parts/options/devenv Provides an example of how to configure CouchDB settings, including database directory, single-node mode, view index directory, URI file, admin credentials, bind address, and port. Refer to CouchDB documentation for a full list of settings. ```nix { couchdb = { database_dir = baseDir; single_node = true; view_index_dir = baseDir; uri_file = "${config.services.couchdb.baseDir}/couchdb.uri"; }; admins = { "admin_username" = "pass"; }; chttpd = { bind_address = "127.0.0.1"; port = 5984; }; } ``` -------------------------------- ### Initializing pkgs with an Overlay Source: https://flake.parts/options/flake-parts-easyOverlay.html Initialize `pkgs` yourself by importing `inputs.nixpkgs` with custom overlays. This is an example of how to structure your `perSystem` function to include overlays. ```nix _module.args.pkgs = import inputs.nixpkgs { inherit system; overlays = [ inputs.foo.overlays.default (final: prev: { # ... things you really need to patch ... }) ]; config = { }; }; ``` -------------------------------- ### Oxfmt Binary Path Example Source: https://flake.parts/options/git-hooks-nix An example demonstrating how to specify a custom path for the 'oxfmt' binary, such as one located in 'node_modules'. Using a string avoids Git tracking the file. ```nix __ "./node_modules/.bin/oxfmt" ``` -------------------------------- ### String Enum Option Example Source: https://flake.parts/options/git-hooks-nix Example of a string option with a limited set of allowed values. ```nix "errfmt" ``` -------------------------------- ### Example Additional Ignore Code Source: https://flake.parts/options/git-hooks-nix An example of a list containing a single ignore code 'E501'. ```nix [ "E501" ] ``` -------------------------------- ### Traffic Server Plugin Arguments Example Source: https://flake.parts/options/devenv Example of arguments to pass to a Traffic Server plugin. ```shell __ "--header=ATS-My-Debug" ``` -------------------------------- ### Job Display Name Example Source: https://flake.parts/options/github-actions-nix Example of setting a display name for a GitHub Actions job. ```nix __ "Build and Test" ``` -------------------------------- ### Example Abbreviated Git Revision Source: https://flake.parts/options/hercules-ci-effects Example of an abbreviated git commit hash. This option is read-only. ```nix __ "17ae1f6" ``` -------------------------------- ### Example Translator Source: https://flake.parts/options/dream2nix_legacy An example of specifying translators, such as 'yarn-lock' and 'package-json'. These are used to parse dependency information. ```nix __ [ "yarn-lock" "package-json" ] ``` -------------------------------- ### Golines Flags Example Source: https://flake.parts/options/git-hooks-nix Provides an example of flags passed to golines for formatting. The default is an empty string. ```nix __ "-m 120" ``` -------------------------------- ### Example Flake Update Configuration Source: https://flake.parts/options/hercules-ci-effects An example showing how to configure flake updates, including setting a custom commit summary for the project root and specifying inputs for a subflake. ```nix { "." = { commitSummary = "/flake.lock: Update"; }; "path/to/subflake" = { inputs = [ "nixpkgs" ]; }; } ``` -------------------------------- ### App-Based Access Example Source: https://flake.parts/options/terranix Example of accessing functionality through the default app. This method is contrasted with devShell-based access. ```bash $ nix run .#foo $ nix run .#foo.destroy ``` -------------------------------- ### Example Git Revision (Commit Hash) Source: https://flake.parts/options/hercules-ci-effects Example of a full git commit hash. This option is read-only. ```nix __ "17ae1f614017447a983c34bb046892b3c571df52" ``` -------------------------------- ### Example Repository Branch Source: https://flake.parts/options/hercules-ci-effects Example of a repository branch name. This option is read-only and provided by Hercules CI. ```nix __ "main" ``` -------------------------------- ### Select Vala Package Source: https://flake.parts/options/devenv Specify the Vala package to use. Defaults to pkgs.vala. ```nix pkgs.vala ``` -------------------------------- ### Example System for Flake Update Job Source: https://flake.parts/options/hercules-ci-effects An example of how to specify a system for the flake update job, such as 'aarch64-linux'. ```nix "aarch64-linux" ``` -------------------------------- ### Example Builder Name Source: https://flake.parts/options/dream2nix_legacy An example of specifying a builder name, such as 'strict-builder'. This determines how dream2nix constructs the package. ```nix __ "strict-builder" ``` -------------------------------- ### Example MCP Server Configurations Source: https://flake.parts/options/devenv Examples of various MCP server configurations, including stdio and http types. This demonstrates how to integrate with services like AWS IAM, GitHub Copilot, Linear, and devenv itself. ```nix { awslabs-iam-mcp-server = { type = "stdio"; command = lib.getExe pkgs.awslabs-iam-mcp-server; args = [ ]; env = { }; }; github = { type = "http"; url = "https://api.githubcopilot.com/mcp/"; headers = { Authorization = "Bearer GITHUB_PAT"; }; }; linear = { type = "http"; url = "https://mcp.linear.app/mcp"; }; devenv = { type = "stdio"; command = "devenv"; args = [ "mcp" ]; env = { DEVENV_ROOT = config.devenv.root; }; }; } ``` -------------------------------- ### Using withSystem to Enter a System Scope Source: https://flake.parts/module-arguments Illustrates how to use `withSystem` to define configurations for a specific system. It shows how to expose `packages`, `inputs`, and `inputs'` as module arguments using `specialArgs` for use within imported modules. ```nix { withSystem, inputs, ... }: { # perSystem = { ... }: { config.packages.hello = ...; }; flake.nixosConfigurations.foo = withSystem "x86_64-linux" (ctx@{ config, inputs', ... }: inputs.nixpkgs.lib.nixosSystem { # Expose `packages`, `inputs` and `inputs'` as module arguments. # Using specialArgs permits use in `imports`. # Note: if you publish modules for reuse, do not rely on specialArgs, but # on the flake scope instead. See also https://flake.parts/define-module-in-separate-file.html specialArgs = { packages = config.packages; inherit inputs inputs'; }; modules = [ # This module could be moved into a separate file; otherwise we might # as well have used ctx.config.packages directly. ({ config, lib, packages, pkgs, ... }: { imports = [ ./nixos-configuration.nix ]; services.nginx.enable = true; environment.systemPackages = [ # hello package defined in perSystem packages.hello ]; }) ]; }); } ``` -------------------------------- ### Add Memcached Startup Arguments Source: https://flake.parts/options/devenv Provide additional arguments for memcached startup. This option expects a list of strings. The default is an empty list. ```nix __ [ "--memory-limit=100M" ] ``` -------------------------------- ### Example Git Ref Source: https://flake.parts/options/hercules-ci-effects Example of a git reference, typically used to identify a branch or tag. This option is read-only. ```nix __ "refs/heads/main" ``` -------------------------------- ### Initializing pkgs with Overlays Source: https://flake.parts/overlays Manually initialize the `pkgs` argument in a `perSystem` function to include custom overlays. This setup imports `nixpkgs` with specified overlays and configurations. ```nix __ perSystem = { system, ... }: { _module.args.pkgs = import inputs.nixpkgs { inherit system; overlays = [ inputs.foo.overlays.default (final: prev: { # ... things you need to patch ... }) ]; config = { }; }; }; ``` -------------------------------- ### Configure HTTP Readiness Probe Source: https://flake.parts/options/devenv Set up an HTTP GET readiness check, including host, path, port, and scheme. Defaults to http://127.0.0.1:/. A delay before the first probe can also be configured. ```nix __ { } ``` ```nix __ null ``` ```nix __ "127.0.0.1" ``` ```nix __ "/" ``` ```nix __ "http" ``` ```nix __ 0 ``` -------------------------------- ### Example Git Server Type for Flake Update Source: https://flake.parts/options/hercules-ci-effects An example of specifying a different Git server type, such as 'gitlab'. ```nix "gitlab" ``` -------------------------------- ### Configure InfluxDB Startup Arguments Source: https://flake.parts/options/devenv Provides additional arguments to be passed to the `influxd` command during startup. Expects a list of strings. ```nix [ "--flux-log-enabled" ] ``` -------------------------------- ### Example Cargo Dependencies for Checks Source: https://flake.parts/options/git-hooks-nix Provides an example of how to specify Cargo dependencies needed for checks. This can be null or an attribute set. ```nix __ "pkgs.rustPlatform.importCargoLock { lockFile = ./Cargo.lock; }" ``` -------------------------------- ### Multiline YAML Configuration String Example Source: https://flake.parts/options/git-hooks-nix Example of a multiline string representing YAML configuration. This overrides any path-based configuration. ```yaml '' --- extends: relaxed rules: indentation: enable '' ``` -------------------------------- ### Configuration File Path Example Source: https://flake.parts/options/git-hooks-nix Specifies the path to the configuration file for linting. Can be null, a string, or an absolute path. ```nix __ "./oxlintrc.json" ``` -------------------------------- ### File Watching Configuration Example Source: https://flake.parts/options/devenv Example configuration for file watching to enable automatic process restarts. This includes specifying paths to watch, file extensions to monitor, and patterns to ignore. ```nix __ { paths = [ ./src ]; extensions = [ "rs" "toml" ]; ignore = [ "target" ]; } ``` -------------------------------- ### Define Container with Dependencies Source: https://flake.parts/options/nix-oci This example defines a container named 'my-app' with a package and its dependencies. Use this to configure custom containers. ```nix { my-app = { package = pkgs.hello; dependencies = [ pkgs.bash ]; }; } ``` -------------------------------- ### flake.nix Setup for flake-parts Source: https://flake.parts/system.html This `flake.nix` sets up flake-parts, defines supported systems, and imports the main NixOS configuration module. It's essential for bootstrapping the flake-parts project. ```nix { inputs.flake-parts.url = "github:hercules-ci/flake-parts"; inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } { systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ]; imports = [ ./nixos.nix ]; }; } ``` -------------------------------- ### Environment Variables Example Source: https://flake.parts/options/nix-oci Set environment variables baked into the OCI manifest. This example sets the RUST_LOG level to 'info'. ```nix __ { RUST_LOG = "info"; } ``` -------------------------------- ### Per-Architecture Module Definitions Example Source: https://flake.parts/options/nix-oci Example demonstrating how to define per-architecture module options. Modules are evaluated for every target architecture within every container and receive special arguments like `name`, `containerConfig`, `containerId`, `system`, and `pkgs`. ```nix oci.perArchitecture = [ ({ name, containerConfig, ... }: { options.myArchOption = lib.mkOption { type = lib.types.str; }; }) ]; ``` -------------------------------- ### mkcert Domains for Certificates Source: https://flake.parts/options/devenv Provide a list of domains for which mkcert should generate certificates. Example: [ "example.com" "*.example.com" ]. ```nix [ "example.com" "*.example.com" ] ``` -------------------------------- ### Example Workflow Inputs Source: https://flake.parts/options/github-actions-nix Illustrates how to define inputs for a reusable GitHub Actions workflow. ```nix { environment = "production"; username = "mona"; } ``` -------------------------------- ### Example Partitioned Attributes Configuration Source: https://flake.parts/options/flake-parts-partitions An example demonstrating how to map flake output attributes like 'checks', 'devShells', and 'herculesCI' to the 'dev' partition. This configuration ensures these specific attributes are sourced from the 'dev' partition's module. ```nix __ { checks = "dev"; devShells = "dev"; herculesCI = "dev"; } ``` -------------------------------- ### Container Startup Command Source: https://flake.parts/options/devenv Specifies the command to run inside the container. Can be a string, a package, or a list of strings for individual arguments. Use a list for entrypoints expecting separate arguments. ```nix null ``` ```nix [ "-f" "/var/lib/haproxy/haproxy.cfg" ] ```