From 55213a4826bb5e299071fe0c0dcc468bdea74051 Mon Sep 17 00:00:00 2001 From: Emile Clark-Boman Date: Mon, 7 Jul 2025 22:45:21 +1000 Subject: [PATCH] init --- .gitignore | 1 + README | 7 +++++++ fenix.nimble | 14 ++++++++++++++ src/fenix.nim | 7 +++++++ src/fenix/submodule.nim | 6 ++++++ tests/config.nims | 1 + tests/test1.nim | 12 ++++++++++++ 7 files changed, 48 insertions(+) create mode 100644 .gitignore create mode 100644 README create mode 100644 fenix.nimble create mode 100644 src/fenix.nim create mode 100644 src/fenix/submodule.nim create mode 100644 tests/config.nims create mode 100644 tests/test1.nim diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e660fd9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +bin/ diff --git a/README b/README new file mode 100644 index 0000000..dd8ae20 --- /dev/null +++ b/README @@ -0,0 +1,7 @@ + + + + +Things to rewrite in Nim: +1. https://git.sr.ht/~khumba/nvd/tree/master/item/src/nvd1 +2. https://github.com/maralorn/nix-output-monitor diff --git a/fenix.nimble b/fenix.nimble new file mode 100644 index 0000000..f80046e --- /dev/null +++ b/fenix.nimble @@ -0,0 +1,14 @@ +# Package + +version = "0.1.0" +author = "Emile Clark-Boman" +description = "Improved toolchain for NixOS" +license = "MIT" +srcDir = "src" +installExt = @["nim"] +bin = @["fenix"] + + +# Dependencies + +requires "nim >= 2.2.0" diff --git a/src/fenix.nim b/src/fenix.nim new file mode 100644 index 0000000..6b99673 --- /dev/null +++ b/src/fenix.nim @@ -0,0 +1,7 @@ +# This is just an example to get you started. A typical hybrid package +# uses this file as the main entry point of the application. + +import fenix/submodule + +when isMainModule: + echo(getWelcomeMessage()) diff --git a/src/fenix/submodule.nim b/src/fenix/submodule.nim new file mode 100644 index 0000000..2997c03 --- /dev/null +++ b/src/fenix/submodule.nim @@ -0,0 +1,6 @@ +# This is just an example to get you started. Users of your hybrid library will +# import this file by writing ``import fenixpkg/submodule``. Feel free to rename or +# remove this file altogether. You may create additional modules alongside +# this file as required. + +proc getWelcomeMessage*(): string = "Hello, World!" diff --git a/tests/config.nims b/tests/config.nims new file mode 100644 index 0000000..3bb69f8 --- /dev/null +++ b/tests/config.nims @@ -0,0 +1 @@ +switch("path", "$projectDir/../src") \ No newline at end of file diff --git a/tests/test1.nim b/tests/test1.nim new file mode 100644 index 0000000..4066320 --- /dev/null +++ b/tests/test1.nim @@ -0,0 +1,12 @@ +# This is just an example to get you started. You may wish to put all of your +# tests into a single file, or separate them into multiple `test1`, `test2` +# etc. files (better names are recommended, just make sure the name starts with +# the letter 't'). +# +# To run these tests, simply execute `nimble test`. + +import unittest + +import fenix/submodule +test "correct welcome": + check getWelcomeMessage() == "Hello, World!"