This commit is contained in:
Ana Hobden 2022-09-28 13:49:07 -07:00
parent 72a4356a8b
commit 08f1410f6a
3 changed files with 28 additions and 25 deletions

View file

@ -47,7 +47,7 @@
]); ]);
in in
{ {
devShell = forAllSystems ({ system, pkgs, ... }: devShells = forAllSystems ({ system, pkgs, ... }:
let let
toolchain = fenixToolchain system; toolchain = fenixToolchain system;
ci = import ./nix/ci.nix { inherit pkgs; }; ci = import ./nix/ci.nix { inherit pkgs; };
@ -60,29 +60,31 @@
. .
''; '';
in in
pkgs.mkShell { {
name = "nix-install-shell"; default = pkgs.mkShell {
name = "nix-install-shell";
RUST_SRC_PATH = "${toolchain}/lib/rustlib/src/rust/library"; RUST_SRC_PATH = "${toolchain}/lib/rustlib/src/rust/library";
nativeBuildInputs = with pkgs; [ nativeBuildInputs = with pkgs; [
pkg-config pkg-config
]; ];
buildInputs = with pkgs; [ buildInputs = with pkgs; [
toolchain toolchain
openssl openssl
rust-analyzer rust-analyzer
# CI dependencies # CI dependencies
jq jq
codespell codespell
findutils # for xargs findutils # for xargs
git git
nixpkgs-fmt nixpkgs-fmt
eclint eclint
] ]
++ ci ++ ci
++ lib.optionals (pkgs.stdenv.isDarwin) (with pkgs; [ libiconv darwin.apple_sdk.frameworks.Security ]); ++ lib.optionals (pkgs.stdenv.isDarwin) (with pkgs; [ libiconv darwin.apple_sdk.frameworks.Security ]);
};
}); });
packages = forAllSystems packages = forAllSystems
@ -118,7 +120,8 @@
}; };
}; };
in in
{ rec {
default = harmonic;
harmonic = naerskLib.buildPackage harmonic = naerskLib.buildPackage
(sharedAttrs // { }); (sharedAttrs // { });
} // lib.optionalAttrs (system == "x86_64-linux") { } // lib.optionalAttrs (system == "x86_64-linux") {

View file

@ -84,7 +84,7 @@ impl Actionable for CreateNixTree {
*action_state = ActionState::Progress; *action_state = ActionState::Progress;
tracing::debug!("Creating nix tree"); tracing::debug!("Creating nix tree");
// Just do sequential since parallizing this will have little benefit // Just do sequential since parallelizing this will have little benefit
for create_directory in create_directories { for create_directory in create_directories {
create_directory.execute().await? create_directory.execute().await?
} }
@ -131,7 +131,7 @@ impl Actionable for CreateNixTree {
*action_state = ActionState::Progress; *action_state = ActionState::Progress;
tracing::debug!("Deleting nix tree"); tracing::debug!("Deleting nix tree");
// Just do sequential since parallizing this will have little benefit // Just do sequential since parallelizing this will have little benefit
for create_directory in create_directories.iter_mut().rev() { for create_directory in create_directories.iter_mut().rev() {
create_directory.revert().await? create_directory.revert().await?
} }

View file

@ -29,7 +29,7 @@ pub(crate) async fn confirm(question: impl AsRef<str>) -> eyre::Result<bool> {
Some(Ok(event)) => { Some(Ok(event)) => {
if let crossterm::event::Event::Key(key) = event { if let crossterm::event::Event::Key(key) = event {
match key.code { match key.code {
KeyCode::Enter => continue, // Many users will hit enter accidently when they are agreeing/declining prompts. KeyCode::Enter => continue, // Many users will hit enter accidentally when they are agreeing/declining prompts.
// TODO(@hoverbear): Should maybe actually even wait for it? // TODO(@hoverbear): Should maybe actually even wait for it?
KeyCode::Char('y') => break Ok(true), KeyCode::Char('y') => break Ok(true),
_ => { _ => {