Giter VIP home page Giter VIP logo

Comments (3)

TheLocehiliosan avatar TheLocehiliosan commented on September 26, 2024

yadm.distro_family is populated via the ID_LIKE value in /etc/os-release.

Do you think it would help to do something like this:

  • Set a local class value within your bootstrap by running
    • yadm config local.class $(awk -F= '$1=="VARIANT_ID" {print $2}' /etc/os-release)
  • And then use yadm.class in your template?

from yadm.

grasegger avatar grasegger commented on September 26, 2024

Thanks for the reply @TheLocehiliosan

While I did not use the solution you proposed it nudged me in the right direction.

After some tinkering I landed on the following solution, which also allows me to rebase my silverblue to kinonite for example. I switched to esh for templating and I think it also makes it easier to document why there is an if:

# WARNING: Do not edit this file.
# It was generated by processing <%= $YADM_SOURCE %>

<% if type rpm-ostree > /dev/null; then -%>
# On rpm-ostree based systems rewrite the npm prefix to avoid trying
# to write to a read only mount.
prefix=<%= $HOME %>/.npm-global
<% fi %>
progress=false

from yadm.

TheLocehiliosan avatar TheLocehiliosan commented on September 26, 2024

Ah yes. That's a good solution and does make it more clear why that system is treated differently.

The "built-in" templating is very basic and really meant to allow some templating without much need for dependencies. But if you can use a more capable template processor it will open up the possibilities. 👍

from yadm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.