From 8ceed2b4ddd1f6f67f607b2897f255f468bebb87 Mon Sep 17 00:00:00 2001 From: nain <126972030+nain-F49FF806@users.noreply.github.com> Date: Wed, 21 Feb 2024 15:46:04 +0100 Subject: [PATCH] feat: alias rust alternatives using symlinks --- Containerfile | 11 +++++++---- .../etc}/profile.d/rusty-aliases.sh | 0 .../etc}/profile.d/rusty-bashrc.sh | 0 customization/common/opt/cargo/bin/cat | 1 + customization/common/opt/cargo/bin/diff | 1 + customization/common/opt/cargo/bin/du | 1 + customization/common/opt/cargo/bin/find | 1 + customization/common/opt/cargo/bin/grep | 1 + customization/common/opt/cargo/bin/hexdump | 1 + customization/common/opt/cargo/bin/ls | 1 + customization/common/opt/cargo/bin/time | 1 + customization/common/opt/cargo/bin/top | 1 + customization/rusty-arch | 2 +- customization/rusty-fedora | 1 + customization/rusty-ubuntu | 2 +- 15 files changed, 19 insertions(+), 6 deletions(-) rename customization/{rusty-fedora => common/etc}/profile.d/rusty-aliases.sh (100%) rename customization/{rusty-fedora => common/etc}/profile.d/rusty-bashrc.sh (100%) create mode 120000 customization/common/opt/cargo/bin/cat create mode 120000 customization/common/opt/cargo/bin/diff create mode 120000 customization/common/opt/cargo/bin/du create mode 120000 customization/common/opt/cargo/bin/find create mode 120000 customization/common/opt/cargo/bin/grep create mode 120000 customization/common/opt/cargo/bin/hexdump create mode 120000 customization/common/opt/cargo/bin/ls create mode 120000 customization/common/opt/cargo/bin/time create mode 120000 customization/common/opt/cargo/bin/top create mode 120000 customization/rusty-fedora diff --git a/Containerfile b/Containerfile index 527d1ce..2114118 100644 --- a/Containerfile +++ b/Containerfile @@ -29,9 +29,10 @@ LABEL org.opencontainers.image.description "${SUMMARY}. ${USAGE}" ## If you wish to cache binaries installed with cargo install, you need to cache the bin/ folder and the .crates.toml and .crates2.json files. COPY --from=builder /usr/local/cargo/bin/ /opt/cargo/bin/ COPY --from=builder /usr/local/cargo/.crates.toml /usr/local/cargo/.crates2.json /opt/cargo/ -ENV PATH=/opt/cargo/bin:$PATH +ENV PATH=/opt/cargo/bin:$PATH -COPY customization/rusty-fedora/profile.d/* /etc/profile.d/ +COPY customization/rusty-fedora/opt/cargo/bin/* /opt/cargo/bin/ +COPY customization/rusty-fedora/etc/profile.d/* /etc/profile.d/ # --- Ubuntu --- @@ -57,7 +58,8 @@ COPY --from=builder /usr/local/cargo/bin/ /opt/cargo/bin/ COPY --from=builder /usr/local/cargo/.crates.toml /usr/local/cargo/.crates2.json /opt/cargo/ ENV PATH=/opt/cargo/bin:$PATH -COPY customization/rusty-ubuntu/profile.d/* /etc/profile.d/ +COPY customization/rusty-ubuntu/opt/cargo/bin/* /opt/cargo/bin/ +COPY customization/rusty-ubuntu/etc/profile.d/* /etc/profile.d/ # --- Arch --- @@ -83,4 +85,5 @@ COPY --from=builder /usr/local/cargo/bin/ /opt/cargo/bin/ COPY --from=builder /usr/local/cargo/.crates.toml /usr/local/cargo/.crates2.json /opt/cargo/ ENV PATH=/opt/cargo/bin:$PATH -COPY customization/rusty-arch/profile.d/* /etc/profile.d/ \ No newline at end of file +COPY customization/rusty-arch/opt/cargo/bin/* /opt/cargo/bin/ +COPY customization/rusty-arch/etc/profile.d/* /etc/profile.d/ \ No newline at end of file diff --git a/customization/rusty-fedora/profile.d/rusty-aliases.sh b/customization/common/etc/profile.d/rusty-aliases.sh similarity index 100% rename from customization/rusty-fedora/profile.d/rusty-aliases.sh rename to customization/common/etc/profile.d/rusty-aliases.sh diff --git a/customization/rusty-fedora/profile.d/rusty-bashrc.sh b/customization/common/etc/profile.d/rusty-bashrc.sh similarity index 100% rename from customization/rusty-fedora/profile.d/rusty-bashrc.sh rename to customization/common/etc/profile.d/rusty-bashrc.sh diff --git a/customization/common/opt/cargo/bin/cat b/customization/common/opt/cargo/bin/cat new file mode 120000 index 0000000..e0dd98c --- /dev/null +++ b/customization/common/opt/cargo/bin/cat @@ -0,0 +1 @@ +bat \ No newline at end of file diff --git a/customization/common/opt/cargo/bin/diff b/customization/common/opt/cargo/bin/diff new file mode 120000 index 0000000..3d2667b --- /dev/null +++ b/customization/common/opt/cargo/bin/diff @@ -0,0 +1 @@ +delta \ No newline at end of file diff --git a/customization/common/opt/cargo/bin/du b/customization/common/opt/cargo/bin/du new file mode 120000 index 0000000..50aac85 --- /dev/null +++ b/customization/common/opt/cargo/bin/du @@ -0,0 +1 @@ +dust \ No newline at end of file diff --git a/customization/common/opt/cargo/bin/find b/customization/common/opt/cargo/bin/find new file mode 120000 index 0000000..2761c6c --- /dev/null +++ b/customization/common/opt/cargo/bin/find @@ -0,0 +1 @@ +fd \ No newline at end of file diff --git a/customization/common/opt/cargo/bin/grep b/customization/common/opt/cargo/bin/grep new file mode 120000 index 0000000..5b2ddf3 --- /dev/null +++ b/customization/common/opt/cargo/bin/grep @@ -0,0 +1 @@ +rg \ No newline at end of file diff --git a/customization/common/opt/cargo/bin/hexdump b/customization/common/opt/cargo/bin/hexdump new file mode 120000 index 0000000..d8cfe4f --- /dev/null +++ b/customization/common/opt/cargo/bin/hexdump @@ -0,0 +1 @@ +hexyl \ No newline at end of file diff --git a/customization/common/opt/cargo/bin/ls b/customization/common/opt/cargo/bin/ls new file mode 120000 index 0000000..5144458 --- /dev/null +++ b/customization/common/opt/cargo/bin/ls @@ -0,0 +1 @@ +eza \ No newline at end of file diff --git a/customization/common/opt/cargo/bin/time b/customization/common/opt/cargo/bin/time new file mode 120000 index 0000000..c18e947 --- /dev/null +++ b/customization/common/opt/cargo/bin/time @@ -0,0 +1 @@ +hyperfine \ No newline at end of file diff --git a/customization/common/opt/cargo/bin/top b/customization/common/opt/cargo/bin/top new file mode 120000 index 0000000..7ad7001 --- /dev/null +++ b/customization/common/opt/cargo/bin/top @@ -0,0 +1 @@ +btm \ No newline at end of file diff --git a/customization/rusty-arch b/customization/rusty-arch index bc96ec9..d66298e 120000 --- a/customization/rusty-arch +++ b/customization/rusty-arch @@ -1 +1 @@ -rusty-fedora \ No newline at end of file +common \ No newline at end of file diff --git a/customization/rusty-fedora b/customization/rusty-fedora new file mode 120000 index 0000000..d66298e --- /dev/null +++ b/customization/rusty-fedora @@ -0,0 +1 @@ +common \ No newline at end of file diff --git a/customization/rusty-ubuntu b/customization/rusty-ubuntu index bc96ec9..d66298e 120000 --- a/customization/rusty-ubuntu +++ b/customization/rusty-ubuntu @@ -1 +1 @@ -rusty-fedora \ No newline at end of file +common \ No newline at end of file