Created
January 2, 2024 00:33
-
-
Save dwf/e2d8173010168f4e5097d96e3390653b to your computer and use it in GitHub Desktop.
Minimal example of YAML as flake output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2024 Google LLC. | |
# SPDX-License-Identifier: Apache-2.0 | |
{ | |
description = "Demo of generating a YAML file as a flake output"; | |
outputs = { self, nixpkgs }: let | |
forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed; | |
in { | |
packages = forAllSystems (system: | |
let pkgs = nixpkgs.legacyPackages.${system}; | |
in { | |
default = (pkgs.formats.yaml { }).generate "foobar.yaml" { foo = "bar"; }; | |
}); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment