diff --git a/apps/servers/octopus/shell.nix b/apps/servers/octopus/shell.nix index aefc4932482..190a8e828d1 100644 --- a/apps/servers/octopus/shell.nix +++ b/apps/servers/octopus/shell.nix @@ -1,10 +1,5 @@ -with import {}; - -stdenv.mkDerivation { - name = "webgit"; - buildInputs = with pkgs; [ - rustracer rustup clangStdenv - - cargo-watch openssl pkg-config - ]; +import { + userPackages = (pkgs: with pkgs; [ + openssl pkg-config + ]); } diff --git a/infra/libkookie/build b/infra/libkookie/build index 934f19a5fb1..6637a54af68 100755 --- a/infra/libkookie/build +++ b/infra/libkookie/build @@ -21,6 +21,7 @@ function build { -I "nixpkgs-overlays=$DIR/overlays" \ -I "home-manager=$DIR/home-manager" \ -I "modules=$DIR/modules" \ + -I "shells=$DIR/shells" \ -I "configuration=$DIR/configuration" \ --out-link "$OUT" "$@" } @@ -49,6 +50,7 @@ function vmimage { -I "nixpkgs-overlays=$DIR/overlays" \ -I "home-manager=$DIR/home-manager" \ -I "modules=$DIR/modules" \ + -I "shells=$DIR/shells" \ -I "configuration=$DIR/configuration" \ --argstr system x86_64-linux "$@" diff --git a/infra/libkookie/configuration/nix/default.nix b/infra/libkookie/configuration/nix/default.nix index 2f341f95a8b..72586f6936a 100644 --- a/infra/libkookie/configuration/nix/default.nix +++ b/infra/libkookie/configuration/nix/default.nix @@ -8,6 +8,7 @@ "home-manager=/run/current-system/libkookie/home-manager" "nixpkgs-overlays=/run/current-system/libkookie/overlays" "nixpkgs=/run/current-system/libkookie/nixpkgs/unstable" + "shells=/run/current-system/libkookie/shells" ]; system.extraSystemBuilderCmds = '' diff --git a/infra/libkookie/overlays/default.nix b/infra/libkookie/overlays/default.nix index 5492537ea40..697ab3a68e1 100644 --- a/infra/libkookie/overlays/default.nix +++ b/infra/libkookie/overlays/default.nix @@ -25,3 +25,6 @@ self: super: { iosevka = self.callPackage ./patches/iosevka { inherit (super) iosevka; }; any-nix-shell = self.callPackage ./patches/any-nix-shell { inherit (super) any-nix-shell; }; } + +## Include the rust overlay +// (import ./rust self super) diff --git a/infra/libkookie/shells/README.md b/infra/libkookie/shells/README.md new file mode 100644 index 00000000000..7191c63d487 --- /dev/null +++ b/infra/libkookie/shells/README.md @@ -0,0 +1,29 @@ +# nix builders + +To make development on NixOS slightly less excruciating, libkookie +ships with a set of development shells. These are environments that +can be included a by projects to provide the basic set of tools +required by a language or development framework. + +libkookie itself then provides the `` key in the NIX_PATH, +which means that existing shells can easily be included and layered by +other `shell.nix` files. + + +## How to use + +Create a `shell.nix` for a project that you want to include. The tool +`msh` (Make SHell) is available to generate these based on common +defaults. Afterwards both `lorri` and `nix-shell` will be able to +pick up the required environment for development. + +```nix +{...}: import {} +``` + +The above snippet includes the basic Rust development toolchain. You +can also provide a set of additional packages to install + +```nix +{ pkgs, ... }: import { packages = [ pkgs.hello ]; } +``` diff --git a/infra/libkookie/shells/base.nix b/infra/libkookie/shells/base.nix new file mode 100644 index 00000000000..231d0825c45 --- /dev/null +++ b/infra/libkookie/shells/base.nix @@ -0,0 +1,6 @@ +name: mkBuildInputs: { userPackages }: +with import {}; +stdenv.mkDerivation { + inherit name; + buildInputs = (mkBuildInputs pkgs) ++ (userPackages pkgs); +} diff --git a/infra/libkookie/shells/elixir/default.nix b/infra/libkookie/shells/elixir/default.nix new file mode 100644 index 00000000000..7084aec89be --- /dev/null +++ b/infra/libkookie/shells/elixir/default.nix @@ -0,0 +1 @@ +import "elixir-dev" (pkgs: with pkgs; [ elixir ]) diff --git a/infra/libkookie/shells/raku/default.nix b/infra/libkookie/shells/raku/default.nix new file mode 100644 index 00000000000..f5010714ed3 --- /dev/null +++ b/infra/libkookie/shells/raku/default.nix @@ -0,0 +1,4 @@ +import "raku-devel" (pkgs: with pkgs; [ + rakudo + zef +]) diff --git a/infra/libkookie/shells/rust.nix b/infra/libkookie/shells/rust.nix deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/infra/libkookie/shells/rust/nightly/default.nix b/infra/libkookie/shells/rust/nightly/default.nix new file mode 100644 index 00000000000..539b4ff9a69 --- /dev/null +++ b/infra/libkookie/shells/rust/nightly/default.nix @@ -0,0 +1,8 @@ +import "rust-nightly" (pkgs: with pkgs; [ + # Use latest nightly from overlay which has a complete toolchain + (rust-bin.selectLatestNightlyWith (toolchain: toolchain.default)) + + cargo-watch + clangStdenv + rust-analyzer +]) diff --git a/infra/libkookie/shells/rust/stable/default.nix b/infra/libkookie/shells/rust/stable/default.nix new file mode 100644 index 00000000000..83ec4e10d2e --- /dev/null +++ b/infra/libkookie/shells/rust/stable/default.nix @@ -0,0 +1,7 @@ +import "rust-stable" (pkgs: with pkgs; [ + rust-bin.stable.latest.default # Use latest stable from overlay + + cargo-watch + clangStdenv + rust-analyzer +]) diff --git a/nix/README.md b/nix/README.md deleted file mode 100644 index 82ef1dd55ea..00000000000 --- a/nix/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# nix builders - -The kookienomicon is a collection of projects, each with their own -dependencies, and build setups. Nix and Lorri are used extentsively -to facilitate switching between build tools and dependency scopes. - -The root of the repository adds a new key to the `NIX_PATH` -environment variable, which can then be used to look-up development -builders. - - -## How to use - -There are default builders for common programming language setups -(such as Rust). - -```nix - -``` diff --git a/nix/default.nix b/nix/default.nix deleted file mode 100644 index 475af25ecbf..00000000000 --- a/nix/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Kookienomicon overlay definition - * - * - * - */ - -self: super: { - -} diff --git a/nix/raku.nix b/nix/raku.nix deleted file mode 100644 index a9829f88051..00000000000 --- a/nix/raku.nix +++ /dev/null @@ -1,6 +0,0 @@ -with import {}; - -stdenv.mkDerivation { - name = "raku-dev"; - buildInputs = with pkgs; [ rakudo zef ]; -} diff --git a/nix/rust.nix b/nix/rust.nix deleted file mode 100644 index 5b1dca78f5d..00000000000 --- a/nix/rust.nix +++ /dev/null @@ -1,11 +0,0 @@ -with import {}; - -stdenv.mkDerivation { - name = "rust-devel"; - buildInputs = with pkgs; [ - rust-analyzer rustc - cargo-watch - clangStdenv - hello - ]; -}