From 20e485026a85355c520b8f29528b0fbbcafdd3f2 Mon Sep 17 00:00:00 2001 From: Minghong Xu Date: Fri, 12 Jan 2024 12:47:24 +0000 Subject: [PATCH] build(flake): ensure that nix flake have deterministic outputs TODO: Install dependencies declared in `pyproject.toml` through nix instead of pip so as to pin the python dev dependencies. The old way to do this is pinning them in `requirements-dev.txt` generated by pip-compile and reproducing with pip-sync in a virtual environment. After doing this, build this lib as a nix python package. Bibliography: - https://github.com/ryan4yin/nixos-and-flakes-book/blob/e30b9a44f27dbacb7415f4449b0353e2a94f3b01/docs/zh/development/dev-environments.md?plain=1#L54-L66 - https://github.com/nix-community/pyproject.nix - https://github.com/nix-community/pyproject.nix/blob/5edc794d76ec64eb699f75d65fd19299ee42c99e/templates/pyproject/flake.nix#L53-L63 --- flake.lock | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 flake.lock diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..3aa3e23 --- /dev/null +++ b/flake.lock @@ -0,0 +1,59 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1704842529, + "narHash": "sha256-OTeQA+F8d/Evad33JMfuXC89VMetQbsU4qcaePchGr4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "eabe8d3eface69f5bb16c18f8662a702f50c20d5", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "utils": "utils" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +}