From 1599875a5cb4a75755a3bfc08c55b9650ad31d96 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Mon, 17 Jun 2024 11:25:35 -0500 Subject: [PATCH] adding ags stuff --- .config/ags/clconfig.cljs | 8 +++++ .config/ags/config.js.bak | 20 ++++++++++++ .config/ags/deps.edn | 1 + .config/ags/flake.lock | 61 +++++++++++++++++++++++++++++++++++++ .config/ags/flake.nix | 44 +++++++++++++++++--------- .config/ags/project.clj | 14 +++++++++ .config/ags/src/config.cljs | 8 +++++ 7 files changed, 142 insertions(+), 14 deletions(-) create mode 100644 .config/ags/clconfig.cljs create mode 100644 .config/ags/config.js.bak create mode 100644 .config/ags/deps.edn create mode 100644 .config/ags/flake.lock create mode 100644 .config/ags/project.clj create mode 100644 .config/ags/src/config.cljs diff --git a/.config/ags/clconfig.cljs b/.config/ags/clconfig.cljs new file mode 100644 index 0000000..20466dc --- /dev/null +++ b/.config/ags/clconfig.cljs @@ -0,0 +1,8 @@ +(ns ags-config) + +(defn bar [monitor] + (let [my-label (Widget.Label. + (clj->js { + :label "some example content" + }))]) + ) diff --git a/.config/ags/config.js.bak b/.config/ags/config.js.bak new file mode 100644 index 0000000..ce201a8 --- /dev/null +++ b/.config/ags/config.js.bak @@ -0,0 +1,20 @@ +function Bar(monitor = 0) { + const myLabel = Widget.Label({ + label: 'some example content', + }) + + return Widget.Window({ + monitor, + name: `bar${monitor}`, // this name has to be unique + anchor: ['top', 'left', 'right'], + child: myLabel, + }) +} + +App.config({ + windows: [ + Bar(0), // can be instantiated for each monitor + Bar(1), + Bar(2), + ], +}) diff --git a/.config/ags/deps.edn b/.config/ags/deps.edn new file mode 100644 index 0000000..2e9a0fb --- /dev/null +++ b/.config/ags/deps.edn @@ -0,0 +1 @@ +{:deps {org.clojure/clojurescript {:mvn/version "1.11.54"}}} diff --git a/.config/ags/flake.lock b/.config/ags/flake.lock new file mode 100644 index 0000000..90b5b72 --- /dev/null +++ b/.config/ags/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1718318537, + "narHash": "sha256-4Zu0RYRcAY/VWuu6awwq4opuiD//ahpc2aFHg2CWqFY=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "e9ee548d90ff586a6471b4ae80ae9cfcbceb3420", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/.config/ags/flake.nix b/.config/ags/flake.nix index 4d9f222..6fbbf18 100644 --- a/.config/ags/flake.nix +++ b/.config/ags/flake.nix @@ -7,19 +7,35 @@ flake-utils.url = "github:numtide/flake-utils"; }; - outputs = { nixpkgs, ... }: - { - flake-utils.lib.eachDefaultSystem - (system: - let - pkgs = import nixpkgs { - inherit system; + outputs = inputs: with inputs; + flake-utils.lib.eachDefaultSystem + (system: + let + pkgs = import nixpkgs { + inherit system; + }; + + nativeBuildInputs = with pkgs; [ + ]; + + buildInputs = with pkgs; [ + stdenv + clojure + clojure-lsp + clj-kondo + leiningen + ]; + + nativeLibs = with pkgs; [ + ]; + in rec + { + devShell = pkgs.mkShell { + nativeBuildInputs = nativeBuildInputs; + buildInputs = buildInputs; + nativeLibs = nativeLibs; }; - in rec - { - devShell = import ./shell.nix { inherit pkgs; }; - defaultPackage = pkgs.libsForQt5.callPackage ./default.nix { }; - } - ); - }; + defaultPackage = pkgs.libsForQt5.callPackage ./default.nix { }; + } + ); } diff --git a/.config/ags/project.clj b/.config/ags/project.clj new file mode 100644 index 0000000..459fa4b --- /dev/null +++ b/.config/ags/project.clj @@ -0,0 +1,14 @@ +(defproject ags-config "0.0.1" + :dependencies [[org.clojure/clojurescript "1.11.54"] + [org.clojure/clojure "1.11.3"]] + :plugins [[lein-cljsbuild "1.1.8"]] + :cljsbuild { + :builds [{ + ; The path to the top-level ClojureScript source directory: + :source-paths ["src"] + ; The standard ClojureScript compiler options: + ; (See the ClojureScript compiler documentation for details.) + :compiler { + :output-to "config.js" ; default: target/cljsbuild-main.js + :optimizations :simple + :pretty-print true}}]}) diff --git a/.config/ags/src/config.cljs b/.config/ags/src/config.cljs new file mode 100644 index 0000000..a14cb8a --- /dev/null +++ b/.config/ags/src/config.cljs @@ -0,0 +1,8 @@ +(ns ags) + +(defn bar [monitor] + (let [my-label (Widget.Label. + (clj->js { + :label "some example content" + }))]) + )