diff --git a/flake.lock b/flake.lock index 2d87dbe..59222bc 100644 --- a/flake.lock +++ b/flake.lock @@ -20,6 +20,100 @@ "type": "github" } }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1673362319, + "narHash": "sha256-Pjp45Vnj7S/b3BRpZEVfdu8sqqA6nvVjvYu59okhOyI=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "82c16f1682cf50c01cb0280b38a1eed202b3fe9f", + "type": "github" + }, + "original": { + "id": "flake-parts", + "type": "indirect" + } + }, + "flake-parts_3": { + "inputs": { + "nixpkgs-lib": [ + "hercules-ci-effects", + "hercules-ci-agent", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1666885127, + "narHash": "sha256-uXA/3lhLhwOTBMn9a5zJODKqaRT+SuL5cpEmOz2ULoo=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "0e101dbae756d35a376a5e1faea532608e4a4b9a", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-utils": { + "locked": { + "lastModified": 1667077288, + "narHash": "sha256-bdC8sFNDpT0HK74u9fUkpbf1MEzVYJ+ka7NXCdgBoaA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "6ee9ebb6b1ee695d2cacc4faa053a7b9baa76817", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "hercules-ci-agent": { + "inputs": { + "flake-parts": "flake-parts_3", + "nix-darwin": "nix-darwin", + "nixpkgs": "nixpkgs", + "pre-commit-hooks-nix": "pre-commit-hooks-nix" + }, + "locked": { + "lastModified": 1673183923, + "narHash": "sha256-vb+AEQJAW4Xn4oHsfsx8H12XQU0aK8VYLtWYJm/ol28=", + "owner": "hercules-ci", + "repo": "hercules-ci-agent", + "rev": "b3f8aa8e4a8b22dbbe92cc5a89e6881090b933b3", + "type": "github" + }, + "original": { + "id": "hercules-ci-agent", + "type": "indirect" + } + }, + "hercules-ci-effects": { + "inputs": { + "flake-parts": "flake-parts_2", + "hercules-ci-agent": "hercules-ci-agent", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1676558019, + "narHash": "sha256-obUHCMMWbffb3k0b9YIChsJ2Z281BcDYnTPTbJRP6vs=", + "owner": "hercules-ci", + "repo": "hercules-ci-effects", + "rev": "fdbc15b55db8d037504934d3af52f788e0593380", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "hercules-ci-effects", + "type": "github" + } + }, "invokeai-src": { "flake": false, "locked": { @@ -54,7 +148,78 @@ "type": "github" } }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "hercules-ci-effects", + "hercules-ci-agent", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1667419884, + "narHash": "sha256-oLNw87ZI5NxTMlNQBv1wG2N27CUzo9admaFlnmavpiY=", + "owner": "LnL7", + "repo": "nix-darwin", + "rev": "cfc0125eafadc9569d3d6a16ee928375b77e3100", + "type": "github" + }, + "original": { + "owner": "LnL7", + "repo": "nix-darwin", + "type": "github" + } + }, "nixpkgs": { + "locked": { + "lastModified": 1672262501, + "narHash": "sha256-ZNXqX9lwYo1tOFAqrVtKTLcJ2QMKCr3WuIvpN8emp7I=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e182da8622a354d44c39b3d7a542dc12cd7baa5f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "dir": "lib", + "lastModified": 1672350804, + "narHash": "sha256-jo6zkiCabUBn3ObuKXHGqqORUMH27gYDIFFfLq5P4wg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "677ed08a50931e38382dbef01cba08a8f7eac8f6", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1673760129, + "narHash": "sha256-m8JdWtElEMd4TY5eUUTbw+3yEjImsE9ifo/UVSbdU7g=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e8e9febf8bc4e90f1b38d3b22a704d347a99a74a", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1675763311, "narHash": "sha256-bz0Q2H3mxsF1CUfk26Sl9Uzi8/HFjGFD/moZHz1HebU=", @@ -70,12 +235,36 @@ "type": "github" } }, + "pre-commit-hooks-nix": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "hercules-ci-effects", + "hercules-ci-agent", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1667760143, + "narHash": "sha256-+X5CyeNEKp41bY/I1AJgW/fn69q5cLJ1bgiaMMCKB3M=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "06f48d63d473516ce5b8abe70d15be96a0147fcd", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, "root": { "inputs": { "flake-parts": "flake-parts", + "hercules-ci-effects": "hercules-ci-effects", "invokeai-src": "invokeai-src", "koboldai-src": "koboldai-src", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs_3" } } }, diff --git a/flake.nix b/flake.nix index 331505e..3e12db7 100644 --- a/flake.nix +++ b/flake.nix @@ -22,17 +22,23 @@ url = "github:hercules-ci/flake-parts"; inputs.nixpkgs-lib.follows = "nixpkgs"; }; + hercules-ci-effects = { + url = "github:hercules-ci/hercules-ci-effects"; + inputs.nixpkgs-lib.follows = "nixpkgs"; + }; }; - outputs = { flake-parts, invokeai-src, ... }@inputs: + outputs = { flake-parts, invokeai-src, hercules-ci-effects, ... }@inputs: flake-parts.lib.mkFlake { inherit inputs; } { systems = [ "x86_64-linux" ]; imports = [ + hercules-ci-effects.flakeModule ./modules/dependency-sets ./modules/aipython3 ./projects/invokeai ./projects/koboldai + ./website ]; }; } diff --git a/website/default.nix b/website/default.nix new file mode 100644 index 0000000..e357dc7 --- /dev/null +++ b/website/default.nix @@ -0,0 +1,9 @@ +{ + hercules-ci.github-pages.branch = "master"; + perSystem = { pkgs, config, ... }: { + hercules-ci.github-pages.settings.contents = config.packages.website.webroot; + packages = { + website = pkgs.callPackage ./package.nix { }; + }; + }; +} diff --git a/website/package.nix b/website/package.nix new file mode 100644 index 0000000..d4ec689 --- /dev/null +++ b/website/package.nix @@ -0,0 +1,30 @@ +{ lib, pandoc, stdenvNoCC }: + +lib.fix (self: stdenvNoCC.mkDerivation { + pname = "nixified-ai-website"; + version = "1.0.0"; + + src = ./src; + + nativeBuildInputs = [ + pandoc + ]; + + buildCommand = '' + unpackPhase + cd $sourceRoot + + pandoc \ + --css=./styles.css \ + -H header.html \ + -V pagetitle='Nixified AI' \ + -s index.md \ + -o index.html + + webroot=$out/share/www/nixified.ai + mkdir -p $webroot + cp -v index.html *.css *.png CNAME $webroot + ''; + + passthru.webroot = "${self}/share/www/nixified.ai"; +}) diff --git a/website/src/CNAME b/website/src/CNAME new file mode 100644 index 0000000..5bf001e --- /dev/null +++ b/website/src/CNAME @@ -0,0 +1 @@ +nixified.ai diff --git a/website/src/header.html b/website/src/header.html new file mode 100644 index 0000000..1aa0acc --- /dev/null +++ b/website/src/header.html @@ -0,0 +1 @@ + diff --git a/website/src/index.md b/website/src/index.md new file mode 100644 index 0000000..385749d --- /dev/null +++ b/website/src/index.md @@ -0,0 +1,63 @@ + +

+
+ + + +

+ +--- + +## Making AI reproducible and easy to run + +The goal of nixified.ai is to simplify and make available a large repository of +AI executable code that would otherwise be impractical to run yourself, due to +package management and complexity issues. + +- Self-contained, without containers: + - Each AI project in the repository is packaged as a self-contained Nix package, including all the necessary dependencies to run the code. This guarantees that you don't have to worry about version conflicts, missing dependencies, or the state of your operating system. Nix uses an approach different from containers, which eliminates the need for complex container runtimes or virtualization. +- Easy to contribute to: + - nixified.ai is an open-source project that welcomes contributions from the community. If there is a project you think you could help with packaging, or want packaged, then please [make an issue on GitHub](https://github.com/nixified-ai/flake/issues) +- Reproducible + - By using a reproducible build process, nixified.ai aims to provide users with the ability to confidently run AI workloads in the long term, without worrying about the shifting sands of the software ecosystem +- Built from source + - Each AI project in the repository is built from source, along with all of its input dependencies, ensuring that the code is reproducible and can be trusted. Nix allows advanced users to customize and modify the build process at any granularity if desired. +- Cached + - Thanks to a Nix concept called "Binary Substitution", any `nix` command ran by the user will not need to be built from source unless they have made modifications to the source code. This is because when code is built by our CI [(Hercules CI)](https://hercules-ci.com), it is pushed to cachix.org, where it can be pulled by any `nix` client like a traditional binary distribution. If this infrastructure were to disappear however, the user could still reproduce everything locally thanks to Nix. +- Easy to run + - Users can install and run AI executable code from the nixified.ai repository using a single `nix` command, on any distribution of Linux, and even Windows by using the Nix package manager. +- Support for NVIDIA and AMD GPUs +- Works with Windows Subsystem for Linux + - nixified.ai provides support for running AI executable code on the Windows Subsystem for Linux (WSL), a compatibility layer for running Linux applications on Windows. With the help of [NixOS-WSL](https://github.com/nix-community/NixOS-WSL), users can run GPU-accelerated AI workloads on WSL, providing a seamless experience for users who prefer to use Windows as their primary operating system. + +--- + +# Packaged Projects + +### KoboldAI + +- [Official website](https://github.com/KoboldAI/KoboldAI-Client) + +A browser-based front-end for AI-assisted writing with multiple local & remote AI models. + +#### Get started + +- `nix run github:nixified-ai/flake#koboldai-amd` +- `nix run github:nixified-ai/flake#koboldai-nvidia` + +![](https://raw.githubusercontent.com/nixified-ai/flake/images/koboldai.webp) + +--- + +### InvokeAI (A Stable Diffusion WebUI) + +- [Official website](https://invoke-ai.github.io/InvokeAI/) + +InvokeAI is an implementation of Stable Diffusion, the open source text-to-image and image-to-image generator. It provides a streamlined process with various new features and options to aid the image generation process. + +#### Get started + +- `nix run github:nixified-ai/flake#invokeai-amd` +- `nix run github:nixified-ai/flake#invokeai-nvidia` + +![](https://raw.githubusercontent.com/nixified-ai/flake/images/invokeai.webp) diff --git a/website/src/nixified-ai-icon.png b/website/src/nixified-ai-icon.png new file mode 100644 index 0000000..34411dc Binary files /dev/null and b/website/src/nixified-ai-icon.png differ diff --git a/website/src/styles.css b/website/src/styles.css new file mode 100644 index 0000000..7911948 --- /dev/null +++ b/website/src/styles.css @@ -0,0 +1,36 @@ +* { + color: #eeeeee; + font-family: sans-serif; +} + +body { + background: radial-gradient(circle, #4362a0 0%, #000000 100%); + margin-left: 20%; + margin-right: 20%; +} + +img { + max-width: 100%; +} + +li code { + font-family: monospace; + font-size: 1.2em; + background-color: #111111; + border-radius: 0.3em; + padding: 0.2em; +} + +li { + margin-bottom: 0.5em; +} + +hr { + border-color: #7ebae4; + color: #7ebae4; +} + +h2 { + text-align: center; + width: 100%; +}