No dscription
  • Nix 88%
  • Just 12%
Find a fil
2026-09-29 15:56:33 +02:00
LICENSES do proper licensing 2026-09-24 15:07:55 +02:00
modules rust: drop prefix of lib name 2026-09-29 15:56:33 +02:00
.envrc improve shell experience, automatically scaffold & make importable 2026-09-24 15:07:55 +02:00
.gitignore initial draft 2026-09-24 15:07:53 +02:00
.ignore scaffold: list generated files in .ignore to hide them in editors 2026-09-24 21:49:55 +02:00
flake.lock initial draft 2026-09-24 15:07:53 +02:00
flake.nix add basic Cargo support 2026-09-24 15:07:57 +02:00
justfile fix justfile 2026-09-24 15:07:56 +02:00
README.md README: add cod link 2026-09-24 21:58:50 +02:00
REUSE.toml include libs in dependencies 2026-09-29 15:54:34 +02:00
todo.txt add basic Cargo support 2026-09-24 15:07:57 +02:00
todo.txt.license do proper licensing 2026-09-24 15:07:55 +02:00

project.nix

I often copy the same configs into new projects. For this reason, I decided to write a tool that writes them automatically with the correct values. I initially planned to write the tool in Rust, but doing it in Nix means it's more flexible and I can easily fuck arround. In the long term, I plan rewriting it in Rust.

Usage

Copy and modify the base config:

{
  description = "Description for the project";

  inputs = {
    flake-parts.url = "github:hercules-ci/flake-parts";
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    projectnix.url = "git+https://codberg.org/jak2k/project.nix";
  };

  outputs = inputs @ {
    flake-parts,
    projectnix,
    ...
  }:
    flake-parts.lib.mkFlake {inherit inputs;} {
      imports = [
        projectnix.flakeModules.default
      ];
      systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin"];
      perSystem = {
        config,
        self',
        inputs',
        pkgs,
        system,
        ...
      }: {
        project = {
          name = "PROJECT-NAME-HERE";
          rust = {
            license = "AGPL-3.0-only";

            dependencies = {
              # DEPS HERE
            };

            libraries = {
              # LIBS HERE
            };
            binaries = {
              # BINS HERE
            };
          };
        };
      };
      flake = {
      };
    };
}

After that, run nix run .#scaffold && direnv allow. Don't forget to add REUSE metadata to the flake.nix!

Examples

Projects using project.nix: