Skip to content

Instantly share code, notes, and snippets.

@PicoGeyer
Last active February 24, 2023 21:49
Show Gist options
  • Save PicoGeyer/eb3379871b11a9dcb2e4c1a9a0e576dd to your computer and use it in GitHub Desktop.
Save PicoGeyer/eb3379871b11a9dcb2e4c1a9a0e576dd to your computer and use it in GitHub Desktop.
Flakes simple shell
{
description = "Multishell test";
inputs = {
nixpkgs.url = "nixpkgs/nixos-22.11";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
rec {
devShells.default = pkgs.mkShell {
packages = with pkgs; [
ruby
];
};
devShells.buildShell = pkgs.mkShell {
packages = with pkgs; [
python38
];
};
# Not sure how to avoid duplication yet
packages.default = pkgs.mkShell {
packages = with pkgs; [ ruby ];
};
packages.buildShell = pkgs.mkShell {
packages = with pkgs; [ python38 ];
};
});
}
nix develop '.#buildShell' --command python --version
Python 3.8.16
nix develop --command ruby --version
ruby 2.7.7p221 (2022-11-24 revision 168ec2b1e5) [x86_64-linux]
nix shell -c ruby
error: unable to execute 'ruby': No such file or directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment