Setup flake.nix to provide integration into Nix's flake system
CMCDragonkai opened this issue · comments
This repository should have a public flake.nix
so it can work seamlessly for downstream users.
Documentation is necessary in the README.md
that explains how to make use of this, and how to integrate this into downstream repositories like all of our js-*
libraries.
It can also be integrated into people's config.nix
so that way one may use nix-env
or similar commands. Documentation should be done here.
Tasks
- 1. Create a
flake.nix
- 2. Change structure of the repository for proper extension points
- 3. Document the extension points
- 4. Document how users are supposed to integrate this into their development repositories, their user environment and so-on.
Something to note I cannot commit empty folders to Git so if you wanted to see the other two folders they will not show up until we put stuff in them.
We use the .gitkeep
pattern to solve that.
We should also be pinning upstream nixpkgs
and the Polykey-CLI
flake; pin the nixpkgs
input into this overlay, and pin the upstream Polykey-CLI
nixpkgs
version to the one in the overlay when used there. The Polykey-CLI flake itself should also be pinned in the overlay.
So something like this:
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs?rev=aaaaaaaaaaaaaaaaa";
flake-utils.url = "github:numtide/flake-utils";
# Pin polykey-cli nixpkgs version
polykey-cli.url = "github:MatrixAI/Polykey-CLI?rev=bbbbbbbbbbbbbbbbbb"; # to pin the version of the polykey-cli flake
polykey-cli.inputs.nixpkgs.follows = "nixpkgs"; # to pin polykey-cli's nixpkgs version to the version of this flake
};
you can also pin it within the overlay expression itself, will look into all of these options.
Inputs are constrainted, outputs you can do anything. Are you sure package set registries are expected to put EVERYTHING into the inputs? Sounds like code-smell, there must be a better solution.
@brynblack so what's the status on putting everything into the inputs
?
Everything is in the inputs.
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs?rev=a1ff35c63891ec9e4df75189427a5d81b5882bb9"; # Pinned to revision
flake-utils.url = "github:numtide/flake-utils"; # No pinning needed (doesn't use nixpkgs)
# Custom packages
polykey-cli.url = "github:MatrixAI/Polykey-CLI?rev=2bcebd05046bbae86a7b9da67e22613720952627";
polykey-cli.inputs.nixpkgs.follows = "nixpkgs"; # Inheriting the nixpkgs input above; pinned
};