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

om show: Display description for flake apps #251

Merged
merged 5 commits into from
Sep 2, 2024
Merged

om show: Display description for flake apps #251

merged 5 commits into from
Sep 2, 2024

Conversation

shivaraj-bh
Copy link
Member

@shivaraj-bh shivaraj-bh commented Sep 2, 2024

Add our custom schema until DeterminateSystems/flake-schemas#31 is merged.

Merge with official schema.

resolves #163

image

Comment on lines +42 to +45
DEFAULT_FLAKE_SCHEMAS = lib.cleanSourceWith {
name = "flake-schemas";
src = flake.inputs.self + /nix/flake-schemas;
};
Copy link
Member Author

Choose a reason for hiding this comment

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

I think this can be replaced with:

DEFAULT_FLAKE_SCHEMAS = flake.inputs.self + /nix/flake-schemas;

It should behave the same since there is no filter provided for cleanSourceWith?

Copy link
Member Author

Choose a reason for hiding this comment

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

@srid why does OM_INIT_REGISTRY use cleanSourceWith if there is no filter?

Copy link
Member

Choose a reason for hiding this comment

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

That's the actual semantics of cleanSourceWith,

Proof:

❯ echo $OM_INIT_REGISTRY
/nix/store/9j2sil7h6w2lx7p71x2khhy0ba7v0i9d-flakreate-registry

With,

diff --git a/crates/omnix-cli/crate.nix b/crates/omnix-cli/crate.nix
index 0f99d6d..04043bd 100644
--- a/crates/omnix-cli/crate.nix
+++ b/crates/omnix-cli/crate.nix
@@ -34,11 +34,7 @@ in
         ) ++ lib.optionals pkgs.stdenv.isLinux [
         pkgsStatic.openssl
       ];
-      OM_INIT_REGISTRY =
-        lib.cleanSourceWith {
-          name = "flakreate-registry";
-          src = flake.inputs.self + /crates/flakreate/registry;
-        };
+      OM_INIT_REGISTRY = flake.inputs.self + /crates/flakreate/registry;
       DEVOUR_FLAKE = inputs.devour-flake;
       OMNIX_SOURCE = inputs.self;
       NIX_FLAKE_SCHEMAS_BIN = lib.getExe pkgs.nix-flake-schemas;

That becomes:

❯ echo $OM_INIT_REGISTRY
/nix/store/fsrav4xa7wrhnw19h04r4jk7cdpkbh6g-source/crates/flakreate/registry

@roberth was the one originally came across this pattern, in haskell-flake:

https://github.com/srid/haskell-flake/blob/e48718c26fa9ba2e7c2b3a8e5df2781b64acb011/nix/build-haskell-package.nix#L15-L24

Since this function is not self-documenting (what does "clean source" even mean here?) perhaps there should be another function that is?

@srid srid merged commit 679852f into main Sep 2, 2024
5 checks passed
@srid srid deleted the apps-description branch September 2, 2024 20:55
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.

om show: display description for flake apps
2 participants