Code Monkey home page Code Monkey logo

Comments (5)

halostatue avatar halostatue commented on June 9, 2024 1

Another options is to use a modify_ script.

In general, yes. lazy-lock.json is a bit of a special case akin to go.sum. I don't think Iā€™d want to have a modify_ script for go.sum or Gemfile.lock.

from chezmoi.

halostatue avatar halostatue commented on June 9, 2024

lazy-lock.json should not be templated, full stop. It's a state file that, if you use different plug-ins on different machines, will always differ, and using chezmoi's approach for substituting state here is the wrong choice.

Your main options are:

  1. Use the same plug-ins on all machines. This keeps a stable lazy-lock.json that just needs to be merged when you update it.

  2. Configure lazy.nvim to use a different lockfile for personal and work machines. When you call lazy.setup({}), do something like this in your (now templated) setup file:

    lazy.setup({
      lockfile = vim.fn.stdpath("config") .. {{ if isPersonal }}"/lazy-lock.json" {{ else }}"/work-lazy-lock.json"{{ end }}
    })
    

See https://github.com/folke/lazy.nvim?tab=readme-ov-file#%EF%B8%8F-configuration.

from chezmoi.

twpayne avatar twpayne commented on June 9, 2024

Another options is to use a modify_ script.

from chezmoi.

tartopohm avatar tartopohm commented on June 9, 2024

lazy-lock.json should not be templated, full stop. It's a state file that, if you use different plug-ins on different machines, will always differ, and using chezmoi's approach for substituting state here is the wrong choice.

Your main options are:

1. Use the same plug-ins on all machines. This keeps a stable `lazy-lock.json` that just needs to be merged when you update it.

2. Configure `lazy.nvim` to use a different lockfile for personal and work machines. When you call `lazy.setup({})`, do something like this in your (now templated) setup file:
   ```
   lazy.setup({
     lockfile = vim.fn.stdpath("config") .. {{ if isPersonal }}"/lazy-lock.json" {{ else }}"/work-lazy-lock.json"{{ end }}
   })
   ```

See https://github.com/folke/lazy.nvim?tab=readme-ov-file#%EF%B8%8F-configuration.

Here, the file differing on different machines is a feature, not a bug. I care much less about breaking my editor at home than at work. I still want the lockfile to be version-controlled so I can easily roll it back if I need to, as suggested here.

from chezmoi.

tartopohm avatar tartopohm commented on June 9, 2024

Another options is to use a modify_ script.

In general, yes. lazy-lock.json is a bit of a special case akin to go.sum. I don't think Iā€™d want to have a modify_ script for go.sum or Gemfile.lock.

I will look into modify scripts and your option number 2. I mostly wanted more options to consider, thank you both for the suggestions!

from chezmoi.

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.