Icosa-Gallery

Open, decentralised platform for 3D assets

Declared in: projects/Icosa-Gallery/default.nix

Try the service in a VM

  1. Install Nix
    Bash
    $ curl -sSfL https://artifacts.nixos.org/nix-installer | sh -s -- install
    
    # to uninstall, run:
    $ /nix/nix-installer uninstall
    Bash
    $ apt install --yes curl git jq nix
    Bash
    $ apt install --yes curl git jq nix
    Bash
    $ pacman --sync --refresh --noconfirm curl git jq nix
    Bash
    $ dnf install -y curl git jq nix
  2. Download a configuration file
    # default.nix
    {
      ngipkgs ? import (fetchTarball "https://github.com/ngi-nix/ngipkgs/tarball/main") { },
    }:
    ngipkgs.demo-vm (
      { pkgs, ... }:
    
      {
        services.icosa-gallery = {
          enable = true;
          openFirewall = true;
          port = 8080;
          enableLocalDB = true;
          settings = {
            # Do *NOT* do this in production!
            POSTGRES_PASSWORD = "icosa-gallery";
            DJANGO_SECRET_KEY = "g3tu0@_-fvhdn&p09mv)x9+x6^7q58&&r9l*k61k-m2f72j&z";
            JWT_SECRET_KEY = "sd2k+@tt0x22_))w9wtv(h1278bc#mkd7jna5nannws(4vr^7";
    
            DJANGO_DISABLE_CACHE = "1";
            DEPLOYMENT_NO_SSL = "1";
            DEPLOYMENT_ENV = "local";
          };
        };
    
        # Do *NOT* do this in production!
        services.postgresql.initialScript = pkgs.writeText "init-sql-script" ''
          CREATE ROLE "icosa-gallery" LOGIN PASSWORD 'icosa-gallery';
        '';
      }
    )
    
  3. Enable binary substituters
    Bash
    $ export NIX_CONFIG='substituters = https://cache.nixos.org/ https://ngi.cachix.org/
    trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= ngi.cachix.org-1:n+CAL72ROC3qQuLxIHpV+Tw5t42WhXmMhprAGkRSrOw='
  4. Build and run a virtual machine
    Bash
    $ nix-build ./default.nix && ./result
    Bash
    $ nix-build ./default.nix && ./result
    Bash
    $ rev=$(nix-instantiate --eval --attr sources.nixpkgs.rev https://github.com/ngi-nix/ngipkgs/archive/master.tar.gz | jq --raw-output)
    $ nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/$rev.tar.gz --packages nix --run "nix-build ./default.nix && ./result"
    Bash
    $ nix-build ./default.nix && ./result
    Bash
    $ nix-build ./default.nix && ./result
  5. Missing Contribute usage instructions.

Options

Examples

Enable icosa-gallery
{ pkgs, ... }:

{
  services.icosa-gallery = {
    enable = true;
    openFirewall = true;
    port = 8080;
    enableLocalDB = true;
    settings = {
      # Do *NOT* do this in production!
      POSTGRES_PASSWORD = "icosa-gallery";
      DJANGO_SECRET_KEY = "g3tu0@_-fvhdn&p09mv)x9+x6^7q58&&r9l*k61k-m2f72j&z";
      JWT_SECRET_KEY = "sd2k+@tt0x22_))w9wtv(h1278bc#mkd7jna5nannws(4vr^7";

      DJANGO_DISABLE_CACHE = "1";
      DEPLOYMENT_NO_SSL = "1";
      DEPLOYMENT_ENV = "local";
    };
  };

  # Do *NOT* do this in production!
  services.postgresql.initialScript = pkgs.writeText "init-sql-script" ''
    CREATE ROLE "icosa-gallery" LOGIN PASSWORD 'icosa-gallery';
  '';
}

Declared in: projects/Icosa-Gallery/services/icosa-gallery/examples/basic.nix

Metadata

This project is funded by NLnet through these subgrants:

Commons
Icosa-Gallery
Entrust
IcosaGallery

Related links: