No dscription
- Nix 88%
- Just 12%
| LICENSES | ||
| modules | ||
| .envrc | ||
| .gitignore | ||
| .ignore | ||
| flake.lock | ||
| flake.nix | ||
| justfile | ||
| README.md | ||
| REUSE.toml | ||
| todo.txt | ||
| todo.txt.license | ||
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: