Skip to content

fix: add dependencies to nix flake (solves #257 & solves #259)#258

Draft
faretek1 wants to merge 7 commits intoaspizu:mainfrom
faretek1:main
Draft

fix: add dependencies to nix flake (solves #257 & solves #259)#258
faretek1 wants to merge 7 commits intoaspizu:mainfrom
faretek1:main

Conversation

@faretek1
Copy link

@faretek1 faretek1 commented Mar 20, 2026

motivation

considerations

  • it may be a good idea to make and use a rust-toolchain.toml file for this and other stuff. afaik, It's like .python-version but for rust
  • I'm not very good at nix so this may be bad
  • It seems like default.nix is called by external flakes, but there is a lot of setup in flake.nix. Is there a way to simplify this in a proper way?
Here is a nix flake you can use to open a shell with goboscript installed. It will cache so it only builds goboscript once
{
  description = "Goboscript development environment";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
    flake-utils.url = "github:numtide/flake-utils";
    rust-overlay.url = "github:oxalica/rust-overlay";
    goboscript.url = "github:faretek1/goboscript?ref=9145b8330c092f15d4a11b728c28979e7b08a5bc";
  };

  outputs = inputs@{ self, nixpkgs, flake-utils, rust-overlay, goboscript, ... }:
  flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-darwin" ] (system: let
    overlays = [ (import rust-overlay) ];
    pkgs = import nixpkgs {
      inherit system overlays;
    };
    rust = pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default);
  in rec {

    devShell = pkgs.mkShell {
      buildInputs = with pkgs; [ ];
      packages = [ 
        (import goboscript
        {
          inherit (pkgs) lib rustPlatform pkg-config openssl;
          inherit rust;
        })
      ];
      nativeBuildInputs = [ rust ];
    };
  });
}

@faretek1 faretek1 changed the title fix: add dependencies to nix flake fix: add dependencies to nix flake (solves #257 & solves #259) Mar 20, 2026
@faretek1 faretek1 marked this pull request as ready for review March 20, 2026 20:18
outputs = inputs@{ self, nixpkgs, flake-utils, ... }:
outputs = inputs@{ self, nixpkgs, flake-utils, rust-overlay, ... }:
flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-darwin" ] (system: let
pkgs = nixpkgs.legacyPackages.${system};
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this line is important, so i changed it to the more conventional import nixpkgs { inherit system};

This was referenced Mar 21, 2026
@faretek1 faretek1 marked this pull request as draft March 22, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant