Compare commits

...

3 commits

Author SHA1 Message Date
09aa87e51f flake.lock: Update
Flake lock file updates:

• Updated input 'lix':
    '24db81eaf2.tar.gz?narHash=sha256-tB4Y3Rrv67ZdEo3HJzxYL5XX9wqtvWwIX1z8k399W0s%3D&rev=24db81eaf28259ab8f8334ccd6368673a26ed422' (2024-09-11)
  → 'df0137226d.tar.gz?narHash=sha256-VfnBb2oNwLsnKbeaGyhLx2aHU%2B3AS3tzMpW9VdZGzgo%3D&rev=df0137226d7db4bfac455076be9f37dae6f01ffe' (2024-09-11)
• Updated input 'nixpkgs-wayland':
    'github:nix-community/nixpkgs-wayland/5d6271a06b79364aa838cdc68c5852d383b17236' (2024-09-11)
  → 'github:nix-community/nixpkgs-wayland/ace4183b2665fa1b7acf1ce74a83519bbf828a58' (2024-09-11)
2024-09-12 00:43:34 +00:00
16ff586de4
syntax 2024-09-11 15:11:06 -05:00
09c2d08540
don't install chromium 2024-09-11 14:17:48 -05:00
6 changed files with 39 additions and 43 deletions

View file

@ -504,11 +504,11 @@
"lix": { "lix": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1726016547, "lastModified": 1726072500,
"narHash": "sha256-tB4Y3Rrv67ZdEo3HJzxYL5XX9wqtvWwIX1z8k399W0s=", "narHash": "sha256-VfnBb2oNwLsnKbeaGyhLx2aHU+3AS3tzMpW9VdZGzgo=",
"rev": "24db81eaf28259ab8f8334ccd6368673a26ed422", "rev": "df0137226d7db4bfac455076be9f37dae6f01ffe",
"type": "tarball", "type": "tarball",
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/24db81eaf28259ab8f8334ccd6368673a26ed422.tar.gz?rev=24db81eaf28259ab8f8334ccd6368673a26ed422" "url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/df0137226d7db4bfac455076be9f37dae6f01ffe.tar.gz?rev=df0137226d7db4bfac455076be9f37dae6f01ffe"
}, },
"original": { "original": {
"type": "tarball", "type": "tarball",
@ -744,11 +744,11 @@
"nixpkgs": "nixpkgs_6" "nixpkgs": "nixpkgs_6"
}, },
"locked": { "locked": {
"lastModified": 1726058240, "lastModified": 1726089853,
"narHash": "sha256-p74soeV48Sry7+wOxDJ8Gqx3JT26lH9AY4+slpJemyw=", "narHash": "sha256-cpP8CDvELczaYLY0RIfYu0vLC8kU/PgM46AZRDAQEe8=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixpkgs-wayland", "repo": "nixpkgs-wayland",
"rev": "5d6271a06b79364aa838cdc68c5852d383b17236", "rev": "ace4183b2665fa1b7acf1ce74a83519bbf828a58",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -23,11 +23,13 @@ mkOizysModule config "chrome" {
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
(chromium.override { # (chromium.override {
commandLineArgs = [ "--force-dark-mode" ]; # commandLineArgs = [ "--force-dark-mode" ];
enableWideVine = true; # enableWideVine = true;
}) # })
(google-chrome.override { commandLineArgs = [ "--force-dark-mode" ]; }) (google-chrome.override {
commandLineArgs = [ "--force-dark-mode" ];
})
]; ];
} }

View file

@ -23,22 +23,19 @@ proc initContext*(): OizysContext =
result.ci = getEnv("GITHUB_STEP_SUMMARY") != "" result.ci = getEnv("GITHUB_STEP_SUMMARY") != ""
var oc = initContext() var oc = initContext()
proc checkPath(s: string): string = proc checkPath(s: string): string =
## fail if path doesn't exist ## fail if path doesn't exist
if not s.dirExists: if not s.dirExists: fatalQuit fmt"flake path: {s} does not exist"
errorQuit fmt"flake path: {s} does not exist"
s s
# public api -------------------------------------
proc updateContext*( proc updateContext*(
host: seq[string], host: seq[string],
flake: string, flake: string,
debug: bool, debug: bool,
resetCache: bool resetCache: bool
) = ) =
if host.len > 0: if host.len > 0: oc.hosts = host
oc.hosts = host
oc.debug = debug oc.debug = debug
oc.resetCache = resetCache oc.resetCache = resetCache
if flake != "": if flake != "":
@ -49,9 +46,9 @@ proc updateContext*(
debug bb(fmt"""[b]flake[/]: {oc.flake}, [b]hosts[/]: {oc.hosts.join(" ")}""") debug bb(fmt"""[b]flake[/]: {oc.flake}, [b]hosts[/]: {oc.hosts.join(" ")}""")
proc getHosts*(): seq[string] = return oc.hosts proc getHosts*(): seq[string] = return oc.hosts
proc getFlake*(): string = return oc.flake proc getFlake*(): string = return oc.flake
proc isDebug*(): bool = return oc.debug proc isDebug*(): bool = return oc.debug
proc isResetCache*(): bool = return oc.resetCache proc isResetCache*(): bool = return oc.resetCache
proc isCi*(): bool = return oc.ci proc isCi*(): bool = return oc.ci

View file

@ -32,12 +32,12 @@ proc runCmdCapt*(
args = args[1..^1], args = args[1..^1],
options = {poUsePath} options = {poUsePath}
) )
# NOTE: if I didn't use streams could I just read from the file handle instead?
let let
outstrm = peekableOutputStream p outstrm = peekableOutputStream p
errstrm = peekableErrorStream p errstrm = peekableErrorStream p
result.exitCode = -1 result.exitCode = -1
var line: string var line: string
# var cnt: int
while true: while true:
if CaptStdout in capture: if CaptStdout in capture:
if outstrm.readLine(line): if outstrm.readLine(line):
@ -48,9 +48,6 @@ proc runCmdCapt*(
result.exitCode = peekExitCode(p) result.exitCode = peekExitCode(p)
if result.exitCode != -1: break if result.exitCode != -1: break
# result.exitCode = waitForExit p
# result.exitCode = waitForExit p
# close p
close p close p
proc runCmdCaptWithSpinner*( proc runCmdCaptWithSpinner*(

View file

@ -10,9 +10,9 @@ when defined(amd64) and (defined(gcc) or defined(clang)):
template withTmpDir(body: untyped): untyped = template withTmpDir(body: untyped): untyped =
let tmpDir {.inject.} = createTempDir("oizys","") let tmpDir {.inject.} = createTempDir("oizys","")
body body
removeDir(tmpDir) removeDir tmpDir
var ghToken = getEnv("GITHUB_TOKEN") var ghToken = getEnv "GITHUB_TOKEN"
proc checkToken() {.inline.} = proc checkToken() {.inline.} =
if ghToken == "": fatalQuit "GITHUB_TOKEN not set" if ghToken == "": fatalQuit "GITHUB_TOKEN not set"
@ -50,7 +50,8 @@ proc postGhApi(url: string, body: JsonNode) =
let response = client.post(url, body = $body) let response = client.post(url, body = $body)
info fmt"Status: {response.code}" info fmt"Status: {response.code}"
except: except:
error "failed to get response code" errorQuit "failed to get response code"
proc createDispatch*(workflowFileName: string, `ref`: string) = proc createDispatch*(workflowFileName: string, `ref`: string) =
## https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#create-a-workflow-dispatch-event ## https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#create-a-workflow-dispatch-event
@ -174,7 +175,7 @@ proc fetch(r: GitRepo) =
checkGit code checkGit code
proc status(r: GitRepo) = proc status(r: GitRepo) =
let (output, _, code) = runCmdCapt(r.git("status", "--porcelain")) let (output, _, code) = runCmdCapt r.git("status", "--porcelain")
checkGit code checkGit code
if output.len > 0: if output.len > 0:
info "unstaged commits, cowardly exiting..." info "unstaged commits, cowardly exiting..."
@ -188,6 +189,4 @@ proc rebase(r: GitRepo, `ref`: string) =
proc updateRepo*() = proc updateRepo*() =
let repo = GitRepo(path: getFlake()) let repo = GitRepo(path: getFlake())
fetch repo fetch repo
rebase repo, "origin/flake-lock" rebase(repo, "origin/flake-lock")

View file

@ -2,8 +2,7 @@ import std/macros
type type
OverlayKind = enum OverlayKind = enum
oPre oPre, oPost
oPost
OverlayProc = object OverlayProc = object
node: NimNode node: NimNode
kind: OverlayKind kind: OverlayKind
@ -27,6 +26,7 @@ proc applyOverlay(child: NimNode, overlayProc: OverlayProc) =
macro overlay*(x: untyped): untyped = macro overlay*(x: untyped): untyped =
##[ ##[
apply pre and post operations to procs: apply pre and post operations to procs:
```nim ```nim
overlay: overlay:
proc pre(a: bool) = proc pre(a: bool) =
@ -43,7 +43,8 @@ macro overlay*(x: untyped): untyped =
echo "inside mine" echo "inside mine"
echo "after" echo "after"
``` ```
]## ]##
result = newStmtList() result = newStmtList()
var overlays: seq[OverlayProc] var overlays: seq[OverlayProc]
for child in x.children(): for child in x.children():