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

Additional inputs #54

Merged
merged 7 commits into from
Oct 10, 2023
Merged

Additional inputs #54

merged 7 commits into from
Oct 10, 2023

Conversation

grahamc
Copy link
Member

@grahamc grahamc commented Oct 7, 2023

Extends convert to support more cases.

URI-types become strings:

     fenix = {
-      url = github:nix-community/fenix;
+      url = "https://flakehub.com/f/nix-community/fenix/0.1.1618.tar.gz";
       inputs.nixpkgs.follows = "nixpkgs";
     };

and IndentedStrings, such as they are, are converted too:

-     flake-utils.url = ''github:numtide/flake-utils'';
+     flake-utils.url = ''https://flakehub.com/f/numtide/flake-utils/0.1.87.tar.gz'';

and nixpkgs/release-mm.yy are supported -- migrated to releases now.

Also, while running fh across every determinatesystems project, I found another issue. When a flake.nix looks like this:

{
  inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";

  inputs.rust-overlay.url = "github:oxalica/rust-overlay";
  inputs.rust-overlay.inputs.nixpkgs.follows = "nixpkgs";

rust-overlay's input URL appears to be replaced with "nixpkgs", causing the result to be:

{
  inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.532072.tar.gz";

  inputs.rust-overlay.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.532072.tar.gz";
  inputs.rust-overlay.inputs.nixpkgs.follows = "nixpkgs";

I fixed this as well by not considering inputs.rust-overlay.inputs.nixpkgs.follows = "nixpkgs"; to be an input line.

@grahamc grahamc mentioned this pull request Oct 7, 2023
src/cli/cmd/add/flake.rs Outdated Show resolved Hide resolved
src/cli/cmd/add/flake.rs Outdated Show resolved Hide resolved
src/cli/cmd/add/flake.rs Outdated Show resolved Hide resolved
src/cli/cmd/add/flake.rs Show resolved Hide resolved
src/cli/cmd/convert.rs Outdated Show resolved Hide resolved
src/cli/cmd/convert.rs Outdated Show resolved Hide resolved
Base automatically changed from cole/ds-1270-fh-convert-replace-github-urls-with-flakehubcom-urls-when to main October 10, 2023 14:57
Copy link
Member

@cole-h cole-h left a comment

Choose a reason for hiding this comment

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

I hate that flake.nix supports indented strings.

@grahamc grahamc merged commit 17c4a36 into main Oct 10, 2023
7 checks passed
@grahamc grahamc deleted the additional-inputs branch October 10, 2023 19:46
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.

2 participants