-
-
Save PicoGeyer/eb3379871b11a9dcb2e4c1a9a0e576dd to your computer and use it in GitHub Desktop.
Flakes simple shell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
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 ]; | |
}; | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nix develop '.#buildShell' --command python --version | |
Python 3.8.16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nix develop --command ruby --version | |
ruby 2.7.7p221 (2022-11-24 revision 168ec2b1e5) [x86_64-linux] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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