ida-org ยท Codeberg.org

Institute for Digital Autonomy


This is the IDA monorepo. It contains all our projects, infrastructure, and branding materials.

A rough overview of the repository structure is as follows:

๐Ÿ“ branding

Logo and and various branding resources and documents

๐Ÿ“ infra

NixOS hosts, modules, profiles for our services

๐Ÿ“ lib

Shared Nix library functions

๐Ÿ“ overlays

Nix overlays for tools and dependencies we patch or package ourselves

๐Ÿ“ projects

The packages that we maintain, both horizontal and vertical

๐Ÿ“„ flake.nix

Entry point for the build system: packages, dev shells, overlays, NixOS configs

The subdirectories have their own READMEs that we recommend reading for more information.

Using IDA packages

Using our packages does not require cloning our entire monorepo. Pick whichever approach fits your project:

Haskell packages

Using Hackage releases

Most IDA Haskell packages are released on Hackage. See the released packages here:

https://hackage.haskell.org/user/IDA

Using a Nix flake input

IDA exposes a Nix flake with an overlays output that makes it particularly easy to use for Nix users.

{
    inputs = {
        nixpkgs = "github:nixos/nixpkgs/nixos-unstable";
        ida = {
            url = "git+https://codeberg.org/ida-org/ida";
            inputs.nixpkgs.follows = "nixpkgs";
        };
    };
    # ...
    haskellOverlay = lib.composeManyExtensions [
        (inputs.ida.overlays.haskell pkgs)
        (hfinal: hprev: {
            # your packages here
        })
    ];
}

Using Cabal and `source-repository-package`

Cabal users can use source-repository-package to use IDA packages even if they have not been released on Hackage:

source-repository-package
    type: git
    location: https://codeberg.org/ida-org/ida.git
    tag: <commit hash>
    subdir: projects/<package>

Contributing to IDA projects

Read about the structure of IDA projects here.

Build-time dependencies

To develop our Haskell projects, you will need:

  • a recent version of GHC and Cabal
  • (optional) a matching version of the Haskell Language Server
  • the transitive dependency closure
  • Fourmolu and cabal-gild to format the source files

IDA provides a Nix development shell that can get you started with one command:

$ nix develop

Or, using nix-direnv:

$ echo use flake > .envrc
$ direnv allow

An explicit version of the GHC can also be provided:

$ nix develop .#ghc912
$ echo use flake .#ghc912 > .envrc
$ direnv allow

Run-time dependencies

Some IDA programs (e.g. servers, integration tests) need things at runtime that a dev shell doesn't provide: a database to connect to, an OpenTelemetry collector to send traces to, and so on.

The IDA flake exposes a NixOS configuration with these services set up, which you can boot as a disposable VM via nixos-shell.

To boot the VM, run this from inside the dev shell:

$ nixos-shell .#nixos-shell

Once the VM boots up, you can run IDA projects against the services configured inside, either on the host or in the VM.

See the nixos-shell host README for more information.

Read the original on codeberg.org โ†—