added script to build all packages
This commit is contained in:
parent
5fac2a9657
commit
f788899505
2 changed files with 53 additions and 9 deletions
18
flake.lock
18
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": {
|
||||
|
|
44
scripts/build_packages.py
Executable file
44
scripts/build_packages.py
Executable file
|
@ -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())
|
Loading…
Reference in a new issue