Flakes: Difference between revisions

imported>Joel
m fix indentation and reword installing flakes explanation
imported>Ulysses4ever
m Input schema: don't repeat "inputs" many times
Line 97: Line 97:
<syntaxHighlight lang=nix>
<syntaxHighlight lang=nix>
{
{
   # github example, also supported gitlab:
   inputs = {
  inputs.nixpkgs.url = "github:Mic92/nixpkgs/master";
    # github example, also supported gitlab:
  # git urls
    nixpkgs.url = "github:Mic92/nixpkgs/master";
  inputs.git-example.url = "git+https://git.somehost.tld/user/path";
    # git urls
  # local directories (for absolute paths you can omit 'path:')
    git-example.url = "git+https://git.somehost.tld/user/path";
  inputs.directory-example.url = "path:/path/to/repo";
    # local directories (for absolute paths you can omit 'path:')
  # Use this for non-flakes
    directory-example.url = "path:/path/to/repo";
  inputs.bar.url = "github:foo/bar/branch";
    # Use this for non-flakes
  inputs.bar.flake = false;
    bar.url = "github:foo/bar/branch";
  # Overwrite inputs in a flake
    bar.flake = false;
  # This is useful to use the same nixpkgs version in both flakes
    # Overwrite inputs in a flake
  inputs.sops-nix.url = "github:Mic92/sops-nix";
    # This is useful to use the same nixpkgs version in both flakes
  inputs.sops-nix.inputs.nixpkgs.follows = "nixpkgs";
    sops-nix.url = "github:Mic92/sops-nix";
  # Pin flakes to a specific revision
    sops-nix.inputs.nixpkgs.follows = "nixpkgs";
  inputs.nix-doom-emacs.url = "github:vlaci/nix-doom-emacs?rev=238b18d7b2c8239f676358634bfb32693d3706f3";
    # Pin flakes to a specific revision
  inputs.nix-doom-emacs.flake = false;
    nix-doom-emacs.url = "github:vlaci/nix-doom-emacs?rev=238b18d7b2c8239f676358634bfb32693d3706f3";
    nix-doom-emacs.flake = false;
  }
}
}
</syntaxHighlight>
</syntaxHighlight>