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

Use writeShellApplication for packaging #22

Merged
merged 1 commit into from
Jan 10, 2023
Merged

Use writeShellApplication for packaging #22

merged 1 commit into from
Jan 10, 2023

Conversation

Kranzes
Copy link
Member

@Kranzes Kranzes commented Jan 10, 2023

With this change the packaging will be made with writeShellApplication which allows adding runtime inputs (deps) to the script by setting the $PATH variable at the top of the file. It also has a check phase which tests the shell file against shellcheck like we did before manually. It also sets the safety bash options.

you can read more about writeShellApplication here -> https://github.com/NixOS/nixpkgs/blob/d3a307c813cbd209fe1e13ac9246b3fa3ea93c12/pkgs/build-support/trivial-builders.nix#L282

@Kranzes
Copy link
Member Author

Kranzes commented Jan 10, 2023

I have a fork/branch for with some more improvements (& that utilizes of flake.parts), is that something you are interested in me PR'ing over?

@Mic92
Copy link
Member

Mic92 commented Jan 10, 2023

bors merge

@bors bors bot merged commit e518219 into nix-community:main Jan 10, 2023
@Mic92
Copy link
Member

Mic92 commented Jan 10, 2023

I have a fork/branch for with some more improvements (& that utilizes of flake.parts), is that something you are interested in me PR'ing over?

Yes. Looks useful: https://github.com/Kranzes/nixos-remote/commit/b400913411bf42a49479abd50c583935f704a0cb

@Mic92
Copy link
Member

Mic92 commented Jan 10, 2023

But maybe keep the packages with importable with callPackage. I think some folks still want to manually import them without using flakes.

@Kranzes
Copy link
Member Author

Kranzes commented Jan 10, 2023

But maybe keep the packages with importable with callPackage. I think some folks still want to manually import them without using flakes.

what about using builtins.getFlake? I am also not exactly sure what you are referring to but let me create a PR and you will add the suggestions.

Oh I get what you mean, but also I'm not sure that "some people don't use flakes" argument holds much considering basically all of this project depends on flakes. From the shell script (nixos-remote), disko and more.

@Kranzes
Copy link
Member Author

Kranzes commented Jan 10, 2023

I have a fork/branch for with some more improvements (& that utilizes of flake.parts), is that something you are interested in me PR'ing over?

Yes. Looks useful: Kranzes@b400913

I created the PR: #23

@Mic92
Copy link
Member

Mic92 commented Jan 10, 2023

nixos-remote can be still used without flakes. All parameter have fallbacks for store paths. It's mainly checks where also import flakes.

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.

3 participants