Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump version to 0.1.9 #89

Merged
merged 5 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fh"
version = "0.1.8"
version = "0.1.9"
authors = ["Determinate Systems <[email protected]>"]
edition = "2021"
license = "Apache 2.0"
Expand Down
6 changes: 3 additions & 3 deletions src/cli/cmd/add/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub(crate) struct AddSubcommand {
pub(crate) input_name: Option<String>,
/// The flake reference to add as an input.
///
/// A reference in the form of `NixOS/nixpkgs` or `NixOS/nixpkgs/0.2305.*` (without a URL
/// A reference in the form of `NixOS/nixpkgs` or `NixOS/nixpkgs/0.2311.*` (without a URL
/// scheme) will be inferred as a FlakeHub input.
pub(crate) input_ref: String,
/// Whether to insert a new input at the top of or the bottom of an existing `inputs` attrset.
Expand Down Expand Up @@ -138,10 +138,10 @@ async fn infer_flake_input_name_url(
))
}
}
// A URL like `nixos/nixpkgs` or `nixos/nixpkgs/0.2305`
// A URL like `nixos/nixpkgs` or `nixos/nixpkgs/0.2311`
Err(url::ParseError::RelativeUrlWithoutBase) => {
let (org, project, version) = match flake_ref.split('/').collect::<Vec<_>>()[..] {
// `nixos/nixpkgs/0.2305`
// `nixos/nixpkgs/0.2311`
[org, project, version] => {
let version = version.strip_suffix(".tar.gz").unwrap_or(version);
let version = version.strip_prefix('v').unwrap_or(version);
Expand Down
4 changes: 2 additions & 2 deletions src/cli/cmd/eject/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,13 +373,13 @@ mod test {
let server_url = server_addr.parse().unwrap();

let input_url =
url::Url::parse("https://flakehub.com/f/nixos/nixpkgs/0.2305.*.tar.gz").unwrap();
url::Url::parse("https://flakehub.com/f/nixos/nixpkgs/0.2311.*.tar.gz").unwrap();
let github_url = super::eject_input_to_github(&server_url, input_url)
.await
.ok()
.flatten()
.unwrap();
assert_eq!(github_url.to_string(), "github:nixos/nixpkgs/nixos-23.05");
assert_eq!(github_url.to_string(), "github:nixos/nixpkgs/nixos-23.11");
}

#[tokio::test]
Expand Down
8 changes: 4 additions & 4 deletions src/cli/cmd/init/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ impl FlakeHubUrl {
}

// Nixpkgs references
const NIXPKGS_LATEST: &str = "latest stable (currently 23.05)";
const NIXPKGS_23_05: &str = "23.05";
const NIXPKGS_LATEST: &str = "latest stable (currently 23.11)";
const NIXPKGS_23_11: &str = "23.11";
const NIXPKGS_UNSTABLE: &str = "unstable";
const NIXPKGS_SPECIFIC: &str = "select a specific release (not recommended in most cases)";

Expand Down Expand Up @@ -108,7 +108,7 @@ impl CommandExecute for InitSubcommand {
"Which Nixpkgs version would you like to include?",
&[
NIXPKGS_LATEST,
NIXPKGS_23_05,
NIXPKGS_23_11,
NIXPKGS_UNSTABLE,
NIXPKGS_SPECIFIC,
],
Expand All @@ -117,7 +117,7 @@ impl CommandExecute for InitSubcommand {
{
// MAYBE: find an enum-based approach to this
NIXPKGS_LATEST => FlakeHubUrl::latest("NixOS", "nixpkgs"),
NIXPKGS_23_05 => FlakeHubUrl::version("NixOS", "nixpkgs", "0.2305.*"),
NIXPKGS_23_11 => FlakeHubUrl::version("NixOS", "nixpkgs", "0.2311.*"),
NIXPKGS_UNSTABLE => FlakeHubUrl::unstable("NixOS", "nixpkgs"),
NIXPKGS_SPECIFIC => select_nixpkgs(&self.api_addr).await?,
// Just in case
Expand Down