commit bc251b3af0d75c5178d1f1c5c9ac68049f5831c5 Author: Nickiel12 Date: Wed Feb 21 20:21:57 2024 -0800 basic commit with testing data diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..1e71ffb --- /dev/null +++ b/.envrc @@ -0,0 +1,4 @@ +# shellcheck shell=bash +# For use with direnv. +# Installing nix-direnv will ensure a smoother experience. +use flake \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bff96d2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,30 @@ +.direnv/* +*.annot +*.cmo +*.cma +*.cmi +*.a +*.o +*.cmx +*.cmxs +*.cmxa + +# ocamlbuild working directory +_build/ + +# ocamlbuild targets +*.byte +*.native + +# oasis generated files +setup.data +setup.log + +# Merlin configuring file for Vim and Emacs +.merlin + +# Dune generated files +*.install + +# Local OPAM switch +_opam/ diff --git a/NicksLearning/NicksLearning.opam b/NicksLearning/NicksLearning.opam new file mode 100644 index 0000000..36cd213 --- /dev/null +++ b/NicksLearning/NicksLearning.opam @@ -0,0 +1,31 @@ +# This file is generated by dune, edit dune-project instead +opam-version: "2.0" +synopsis: "A short synopsis" +description: "A longer description" +maintainer: ["Maintainer Name"] +authors: ["Author Name"] +license: "LICENSE" +tags: ["topics" "to describe" "your" "project"] +homepage: "https://github.com/username/reponame" +doc: "https://url/to/documentation" +bug-reports: "https://github.com/username/reponame/issues" +depends: [ + "ocaml" + "dune" {>= "3.12"} + "odoc" {with-doc} +] +build: [ + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] +] +dev-repo: "git+https://github.com/username/reponame.git" diff --git a/NicksLearning/_build/.lock b/NicksLearning/_build/.lock new file mode 100644 index 0000000..26e1479 --- /dev/null +++ b/NicksLearning/_build/.lock @@ -0,0 +1 @@ +759614 \ No newline at end of file diff --git a/NicksLearning/_build/log b/NicksLearning/_build/log new file mode 100644 index 0000000..040ba28 --- /dev/null +++ b/NicksLearning/_build/log @@ -0,0 +1,31 @@ +# dune build -w +# OCAMLPARAM: unset +# Shared cache: disabled +# Shared cache location: /home/nixolas/.cache/dune/db +# Workspace root: /home/nixolas/Documents/ocaml_testing/NicksLearning +# Auto-detected concurrency: 12 +# Dune context: +# { name = "default" +# ; kind = "default" +# ; profile = Dev +# ; merlin = true +# ; fdo_target_exe = None +# ; build_dir = In_build_dir "default" +# ; installed_env = +# map +# { "INSIDE_DUNE" : +# "/home/nixolas/Documents/ocaml_testing/NicksLearning/_build/default" +# ; "OCAML_COLOR" : "always" +# ; "OPAMCOLOR" : "always" +# } +# ; instrument_with = [] +# } +$ /nix/store/9j24zr09jz1wgi8m306avyccwirbl229-ocaml-base-compiler-5.1.1_rc1/bin/ocamlc.opt -config > /tmp/dune_da31cc_output +$ (cd _build/default && /nix/store/9j24zr09jz1wgi8m306avyccwirbl229-ocaml-base-compiler-5.1.1_rc1/bin/ocamlopt.opt -w @1..3@5..28@30..39@43@46..47@49..57@61..62@67@69-40 -strict-sequence -strict-formats -short-paths -keep-locs -g -I bin/.main.eobjs/byte -I bin/.main.eobjs/native -I lib/.NicksLearning.objs/byte -I lib/.NicksLearning.objs/native -intf-suffix .ml -no-alias-deps -opaque -o bin/.main.eobjs/native/dune__exe__Main.cmx -c -impl bin/main.ml) +> File "bin/main.ml", line 5, characters 0-0: +> Error: Syntax error +[2] +$ (cd _build/default && /nix/store/9j24zr09jz1wgi8m306avyccwirbl229-ocaml-base-compiler-5.1.1_rc1/bin/ocamlopt.opt -w @1..3@5..28@30..39@43@46..47@49..57@61..62@67@69-40 -strict-sequence -strict-formats -short-paths -keep-locs -g -I bin/.main.eobjs/byte -I bin/.main.eobjs/native -I lib/.NicksLearning.objs/byte -I lib/.NicksLearning.objs/native -intf-suffix .ml -no-alias-deps -opaque -o bin/.main.eobjs/native/dune__exe__Main.cmx -c -impl bin/main.ml) +$ (cd _build/default && /nix/store/9j24zr09jz1wgi8m306avyccwirbl229-ocaml-base-compiler-5.1.1_rc1/bin/ocamlopt.opt -w @1..3@5..28@30..39@43@46..47@49..57@61..62@67@69-40 -strict-sequence -strict-formats -short-paths -keep-locs -g -o bin/main.exe lib/NicksLearning.cmxa bin/.main.eobjs/native/dune__exe__Main.cmx) +$ (cd _build/default && /nix/store/9j24zr09jz1wgi8m306avyccwirbl229-ocaml-base-compiler-5.1.1_rc1/bin/ocamlopt.opt -w @1..3@5..28@30..39@43@46..47@49..57@61..62@67@69-40 -strict-sequence -strict-formats -short-paths -keep-locs -g -I bin/.main.eobjs/byte -I bin/.main.eobjs/native -I lib/.NicksLearning.objs/byte -I lib/.NicksLearning.objs/native -intf-suffix .ml -no-alias-deps -opaque -o bin/.main.eobjs/native/dune__exe__Main.cmx -c -impl bin/main.ml) +$ (cd _build/default && /nix/store/9j24zr09jz1wgi8m306avyccwirbl229-ocaml-base-compiler-5.1.1_rc1/bin/ocamlopt.opt -w @1..3@5..28@30..39@43@46..47@49..57@61..62@67@69-40 -strict-sequence -strict-formats -short-paths -keep-locs -g -o bin/main.exe lib/NicksLearning.cmxa bin/.main.eobjs/native/dune__exe__Main.cmx) diff --git a/NicksLearning/bin/dune b/NicksLearning/bin/dune new file mode 100644 index 0000000..800027a --- /dev/null +++ b/NicksLearning/bin/dune @@ -0,0 +1,4 @@ +(executable + (public_name NicksLearning) + (name main) + (libraries NicksLearning)) diff --git a/NicksLearning/bin/main.ml b/NicksLearning/bin/main.ml new file mode 100644 index 0000000..47254e0 --- /dev/null +++ b/NicksLearning/bin/main.ml @@ -0,0 +1,5 @@ +let x = "hello world" in + print_endline x + + +let () = print_endline "Hello, World!" diff --git a/NicksLearning/dune-project b/NicksLearning/dune-project new file mode 100644 index 0000000..d9f9506 --- /dev/null +++ b/NicksLearning/dune-project @@ -0,0 +1,26 @@ +(lang dune 3.12) + +(name NicksLearning) + +(generate_opam_files true) + +(source + (github username/reponame)) + +(authors "Author Name") + +(maintainers "Maintainer Name") + +(license LICENSE) + +(documentation https://url/to/documentation) + +(package + (name NicksLearning) + (synopsis "A short synopsis") + (description "A longer description") + (depends ocaml dune) + (tags + (topics "to describe" your project))) + +; See the complete stanza docs at https://dune.readthedocs.io/en/stable/dune-files.html#dune-project diff --git a/NicksLearning/lib/dune b/NicksLearning/lib/dune new file mode 100644 index 0000000..b16ca82 --- /dev/null +++ b/NicksLearning/lib/dune @@ -0,0 +1,2 @@ +(library + (name NicksLearning)) diff --git a/NicksLearning/test/dune b/NicksLearning/test/dune new file mode 100644 index 0000000..5680ba7 --- /dev/null +++ b/NicksLearning/test/dune @@ -0,0 +1,2 @@ +(test + (name test_NicksLearning)) diff --git a/NicksLearning/test/test_NicksLearning.ml b/NicksLearning/test/test_NicksLearning.ml new file mode 100644 index 0000000..e69de29 diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..b3775f2 --- /dev/null +++ b/flake.lock @@ -0,0 +1,189 @@ +{ + "nodes": { + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1627913399, + "narHash": "sha256-hY8g6H2KFL8ownSiFeMOjwPC8P0ueXpCVEbxgda3pko=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "12c64ca55c1014cdc1b16ed5a804aa8576601ff2", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "locked": { + "lastModified": 1638122382, + "narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "74f7e4319258e287b0f9cb95426c9853b282730b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "mirage-opam-overlays": { + "flake": false, + "locked": { + "lastModified": 1661959605, + "narHash": "sha256-CPTuhYML3F4J58flfp3ZbMNhkRkVFKmBEYBZY5tnQwA=", + "owner": "dune-universe", + "repo": "mirage-opam-overlays", + "rev": "05f1c1823d891ce4d8adab91f5db3ac51d86dc0b", + "type": "github" + }, + "original": { + "owner": "dune-universe", + "repo": "mirage-opam-overlays", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1682362401, + "narHash": "sha256-/UMUHtF2CyYNl4b60Z2y4wwTTdIWGKhj9H301EDcT9M=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "884ac294018409e0d1adc0cae185439a44bd6b0b", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "opam-nix": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": "flake-utils_2", + "mirage-opam-overlays": "mirage-opam-overlays", + "nixpkgs": "nixpkgs", + "opam-overlays": "opam-overlays", + "opam-repository": "opam-repository", + "opam2json": "opam2json" + }, + "locked": { + "lastModified": 1706878465, + "narHash": "sha256-0k0KSkU7epRQshZZKsOpyE79lnwn/0q2VagzDhIeZpE=", + "owner": "tweag", + "repo": "opam-nix", + "rev": "9f03f7e0664c369f25e614d3f3be74ea78b647fa", + "type": "github" + }, + "original": { + "owner": "tweag", + "repo": "opam-nix", + "type": "github" + } + }, + "opam-overlays": { + "flake": false, + "locked": { + "lastModified": 1654162756, + "narHash": "sha256-RV68fUK+O3zTx61iiHIoS0LvIk0E4voMp+0SwRg6G6c=", + "owner": "dune-universe", + "repo": "opam-overlays", + "rev": "c8f6ef0fc5272f254df4a971a47de7848cc1c8a4", + "type": "github" + }, + "original": { + "owner": "dune-universe", + "repo": "opam-overlays", + "type": "github" + } + }, + "opam-repository": { + "flake": false, + "locked": { + "lastModified": 1705008664, + "narHash": "sha256-TTjTal49QK2U0yVOmw6rJhTGYM7tnj3Kv9DiEEiLt7E=", + "owner": "ocaml", + "repo": "opam-repository", + "rev": "fa77046c6497f8ca32926acdb7eb1e61777d4c17", + "type": "github" + }, + "original": { + "owner": "ocaml", + "repo": "opam-repository", + "type": "github" + } + }, + "opam2json": { + "inputs": { + "nixpkgs": [ + "opam-nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1671540003, + "narHash": "sha256-5pXfbUfpVABtKbii6aaI2EdAZTjHJ2QntEf0QD2O5AM=", + "owner": "tweag", + "repo": "opam2json", + "rev": "819d291ea95e271b0e6027679de6abb4d4f7f680", + "type": "github" + }, + "original": { + "owner": "tweag", + "repo": "opam2json", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "opam-nix", + "nixpkgs" + ], + "opam-nix": "opam-nix" + } + }, + "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/flake.nix b/flake.nix new file mode 100644 index 0000000..2a2f0ba --- /dev/null +++ b/flake.nix @@ -0,0 +1,57 @@ +{ + inputs = { + opam-nix.url = "github:tweag/opam-nix"; + flake-utils.url = "github:numtide/flake-utils"; + nixpkgs.follows = "opam-nix/nixpkgs"; + }; + outputs = { self, flake-utils, opam-nix, nixpkgs }@inputs: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + on = opam-nix.lib.${system}; + localPackagesQuery = builtins.mapAttrs (_: pkgs.lib.last) + (on.listRepo (on.makeOpamRepo ./.)); + devPackagesQuery = { + # You can add "development" packages here. They will get added to the devShell automatically. + ocaml-lsp-server = "*"; + merlin = "*"; + ocamlformat = "*"; + utop = "*"; + }; + query = devPackagesQuery // { + ## You can force versions of certain packages here, e.g: + ## - force the ocaml compiler to be taken from opam-repository: + ocaml-base-compiler = "*"; + ## - or force the compiler to be taken from nixpkgs and be a certain version: + # ocaml-system = "4.14.0"; + ## - or force ocamlfind to be a certain version: + # ocamlfind = "1.9.2"; + }; + scope = on.buildOpamProject' { } ./. query; + overlay = final: prev: + { + # You can add overrides here + }; + scope' = scope.overrideScope' overlay; + # Packages from devPackagesQuery + devPackages = builtins.attrValues + (pkgs.lib.getAttrs (builtins.attrNames devPackagesQuery) scope'); + # Packages in this workspace + packages = + pkgs.lib.getAttrs (builtins.attrNames localPackagesQuery) scope'; + in { + legacyPackages = scope'; + + inherit packages; + + ## If you want to have a "default" package which will be built with just `nix build`, do this instead of `inherit packages;`: + # packages = packages // { default = packages.; }; + + devShells.default = pkgs.mkShell { + inputsFrom = builtins.attrValues packages; + buildInputs = devPackages ++ [ + # You can add packages from nixpkgs here + ]; + }; + }); +} diff --git a/paint_usage.db b/paint_usage.db new file mode 100644 index 0000000..874a7cb Binary files /dev/null and b/paint_usage.db differ