Giter Site home page Giter Site logo

flakelight-zig's Introduction

flakelight-zig

Zig module for flakelight.

Options

Set pname to the name of the Zig package, if name not configured in build.zig.zon.

Set version to the version of the package if version not in build.zig.zon.

zigDependencies will have to be set if build.zig.zon contains dependencies. Set it to a function that takes the package set and returns a zig package cache path.

fileset configures the fileset the package is built with. To use all files, set it to ./.. Without build.zig.zon, The default is Zig and C files. If paths is set in build.zig.zon, those paths are used.

Configured options

Sets package to the zig project at the flake source.

Adds zig and zls to the default devShell.

Adds checks for zig tests.

Configures zig files to be formatted with zig fmt.

Example flakes

Standard

{
  description = "My Zig application.";
  inputs.flakelight-zig.url = "github:accelbread/flakelight-zig";
  outputs = { flakelight-zig, ... }: flakelight-zig ./. {
    license = "AGPL-3.0-or-later";
  };
}

When build.zig sets preferred_optimize_mode

{
  description = "My Zig application.";
  inputs.flakelight-zig.url = "github:accelbread/flakelight-zig";
  outputs = { flakelight-zig, ... }: flakelight-zig ./. {
    license = "AGPL-3.0-or-later";
    zigFlags = [ "-Dcpu=baseline" "-Drelease" ];
  };
}

Without a build.zig.zon

{
  description = "My Zig application.";
  inputs.flakelight-zig.url = "github:accelbread/flakelight-zig";
  outputs = { flakelight-zig, ... }: flakelight-zig ./. {
    pname = "hello-world";
    version = "0.0.1";
    license = "AGPL-3.0-or-later";
  };
}

When build.zig.zon has dependencies

Use zon2nix to generate deps.nix (zon2nix is available in the devShell if the flake has a build.zig.zon). The zon2nix output can be used as follows:

{
  description = "My Zig application.";
  inputs.flakelight-zig.url = "github:accelbread/flakelight-zig";
  outputs = { flakelight-zig, ... }: flakelight-zig ./. {
    license = "AGPL-3.0-or-later";
    zigDependencies = pkgs: pkgs.callPackage ./deps.nix {};
  };
}

flakelight-zig's People

Contributors

accelbread avatar github-actions[bot] avatar

Stargazers

Calum MacRae avatar Joshua W avatar Sandro avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.