Added gtk demo app

This commit is contained in:
Qubasa
2023-11-21 18:13:30 +01:00
committed by Jörg Thalheim
parent 9698e57fa6
commit dddbe74d6a
12 changed files with 164 additions and 15 deletions

View File

@@ -2,11 +2,14 @@ import json
import os
import subprocess
import tempfile
import deal
from pathlib import Path
from typing import Any
import deal
from .dirs import nixpkgs_flake, nixpkgs_source
from .errors import ClanError
@deal.raises(ClanError)
def nix_command(flags: list[str]) -> list[str]:
@@ -25,6 +28,7 @@ def nix_flake_show(flake_url: str | Path) -> list[str]:
]
)
@deal.raises(ClanError)
def nix_build(
flags: list[str],
@@ -41,6 +45,7 @@ def nix_build(
+ flags
)
@deal.raises(ClanError)
def nix_config() -> dict[str, Any]:
cmd = nix_command(["show-config", "--json"])
@@ -51,6 +56,7 @@ def nix_config() -> dict[str, Any]:
config[key] = value["value"]
return config
@deal.raises(ClanError)
def nix_eval(flags: list[str]) -> list[str]:
default_flags = nix_command(
@@ -78,6 +84,7 @@ def nix_eval(flags: list[str]) -> list[str]:
)
return default_flags + flags
@deal.raises(ClanError)
def nix_shell(packages: list[str], cmd: list[str]) -> list[str]:
# we cannot use nix-shell inside the nix sandbox