diff --git a/flake.lock b/flake.lock index 8f82757..82b6479 100644 --- a/flake.lock +++ b/flake.lock @@ -27,11 +27,11 @@ ] }, "locked": { - "lastModified": 1733045511, - "narHash": "sha256-n8AldXJRNVMm2UZ6yN0HwVxlARY2Cm/uhdOw76tQ0OI=", + "lastModified": 1733133928, + "narHash": "sha256-gU40r9AfpIr4eq+0noM8yH1Hxf+EA3dqfIpFtQl8Y1E=", "owner": "nix-community", "repo": "home-manager", - "rev": "4964f3c6fc17ae4578e762d3dc86b10fe890860e", + "rev": "873e39d5f4437d2f3ab06881fea8e63e45e1d011", "type": "github" }, "original": { @@ -57,11 +57,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1732483221, - "narHash": "sha256-kF6rDeCshoCgmQz+7uiuPdREVFuzhIorGOoPXMalL2U=", + "lastModified": 1733139194, + "narHash": "sha256-PVQW9ovo0CJbhuhCsrhFJGGdD1euwUornspKpBIgdok=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "45348ad6fb8ac0e8415f6e5e96efe47dd7f39405", + "rev": "c6c90887f84c02ce9ebf33b95ca79ef45007bf88", "type": "github" }, "original": { @@ -73,11 +73,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1732837521, - "narHash": "sha256-jNRNr49UiuIwaarqijgdTR2qLPifxsVhlJrKzQ8XUIE=", + "lastModified": 1733015953, + "narHash": "sha256-t4BBVpwG9B4hLgc6GUBuj3cjU7lP/PJfpTHuSqE+crk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "970e93b9f82e2a0f3675757eb0bfc73297cc6370", + "rev": "ac35b104800bff9028425fec3b6e8a41de2bbfff", "type": "github" }, "original": { diff --git a/scripts/build_packages.py b/scripts/build_packages.py new file mode 100755 index 0000000..9ffe144 --- /dev/null +++ b/scripts/build_packages.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python3.12 + +import json +import shutil +import subprocess as sp + +from pathlib import Path + + +def main() -> int: + if not Path("./flake.nix").exists(): + raise Exception( + "You need to be in the root of the project (where the `flake.nix` is)" + ) + response = sp.run( + [shutil.which("nix"), "flake", "show", "--json"], capture_output=True + ) + + json_data = json.loads(response.stdout.decode("utf-8")) + packages = json_data.get("packages") + + built_packages_paths = [] + for package in packages.get("x86_64-linux").keys(): + out_path = ( + sp.check_output( + [ + shutil.which("nix"), + "build", + f".#{package}", + "--no-link", + "--print-out-paths", + ] + ) + .decode("utf-8") + .strip() + ) + built_packages_paths.append(out_path) + + print(built_packages_paths) + return 0 + + +if __name__ == "__main__": + raise SystemExit(main())