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

Generate tool integration shell fragments with chezmoi #5

Open
kergoth opened this issue Jan 8, 2024 · 1 comment
Open

Generate tool integration shell fragments with chezmoi #5

kergoth opened this issue Jan 8, 2024 · 1 comment

Comments

@kergoth
Copy link
Owner

kergoth commented Jan 8, 2024

See Optimizing Shell Startup Time, the main idea being to call out to them in templates, such as {{ output "/opt/homebrew/bin/brew" "shellenv" | trim }}. There are items to confirm when looking into this approach. We'd have to ensure that changes to the packages result in changing the template, and package installation would have to be done with a before script to ensure they're available for the templates to use. They would also have to not depend on my user PATH changes.

kergoth added a commit that referenced this issue Jan 9, 2024
<<< /nix/store/scf2ikh8sdsrrag46aab0bl2byv9bgk4-home-manager-generation
>>> /nix/store/1mf9mf5li8njvxp4692l0rq8qxqyxa3d-home-manager-generation
Version changes:
[U.]  #1  c-grammar-neovim       0.9.4 -> 0.9.5
[U.]  #2  dua                    2.24.1 -> 2.24.2
[U.]  #3  fzf                    0.44.1, 0.44.1-man -> 0.45.0, 0.45.0-man
[C.]  #4  lima                   0.18.0, 0.19.0 -> 0.19.0, 0.19.1
[U.]  #5  lua-grammar-neovim     0.9.4 -> 0.9.5
[U.]  #6  neovim                 0.9.4 -> 0.9.5
[U.]  #7  neovim-unwrapped       0.9.4 -> 0.9.5
[U.]  #8  query-grammar-neovim   0.9.4 -> 0.9.5
[U.]  #9  vim-grammar-neovim     0.9.4 -> 0.9.5
[U.]  #10  vimdoc-grammar-neovim  0.9.4 -> 0.9.5
Closure size: 374 -> 374 (28 paths added, 28 paths removed, delta +0, disk usage +259.2KiB).

Signed-off-by: Christopher Larson <[email protected]>
kergoth added a commit that referenced this issue Jan 16, 2024
  Home Manager input changes:

    • Updated input 'home-manager':
        'github:nix-community/home-manager/e13aa9e287b3365473e5897e3667ea80a899cdfb' (2024-01-09)
      → 'github:nix-community/home-manager/37d6eeceee464adc03585404eebd68765b3c8615' (2024-01-16)
    • Updated input 'nixpkgs':
        'github:nixos/nixpkgs/317484b1ead87b9c1b8ac5261a8d2dd748a0492d' (2024-01-08)
      → 'github:NixOS/nixpkgs/9b19f5e77dd906cb52dade0b7bd280339d2a1f3d' (2024-01-13)

  Home Manager packages changes:

    <<< /nix/store/adzsk4a78z8m4nr5qbaanjpallq4lcmd-home-manager-generation
    >>> /nix/store/rm2qnvwzhbxz901bg0ppfrqndxlh2py4-home-manager-generation
    Version changes:
    [U.]  #1  aws-c-auth          0.7.0 -> 0.7.7
    [U.]  #2  aws-c-cal           0.6.0 -> 0.6.9
    [U.]  #3  aws-c-common        0.8.23 -> 0.9.10
    [U.]  #4  aws-c-event-stream  0.3.1 -> 0.3.2
    [U.]  #5  aws-c-http          0.7.11 -> 0.7.14
    [U.]  #6  aws-c-io            0.13.29 -> 0.13.36
    [U.]  #7  aws-c-mqtt          0.8.14 -> 0.9.10
    [U.]  #8  aws-c-s3            0.3.13 -> 0.4.0
    [U.]  #9  aws-crt-cpp         0.20.3 -> 0.24.7
    [U.]  #10  aws-sdk-cpp         1.11.118 -> 1.11.207
    [U.]  #11  bundler             2.4.22 -> 2.5.3
    [U.]  #12  cargo               1.74.0 -> 1.75.0
    [U.]  #13  docker-buildx       0.12.0 -> 0.12.1
    [U.]  #14  docker-compose      2.23.3 -> 2.24.0
    [U.]  #15  du-dust             0.8.6 -> 0.9.0
    [U.]  #16  eza                 0.17.0, 0.17.0-man -> 0.17.1, 0.17.1-man
    [U.]  #17  gcc                 12.3.0-lib, 12.3.0-libgcc -> 13.2.0-lib, 13.2.0-libgcc
    [U.]  #18  gh                  2.40.1 -> 2.41.0
    [U.]  #19  git                 2.42.0, 2.42.0-doc -> 2.43.0, 2.43.0-doc
    [U.]  #20  glib                2.78.1 -> 2.78.3
    [U.]  #21  iproute2            6.5.0 -> 6.6.0
    [U.]  #22  jira-cli-go         1.4.0 -> 1.5.0
    [U*]  #23  jq                  1.7, 1.7-bin, 1.7-doc, 1.7-lib, 1.7-man -> 1.7.1, 1.7.1-bin, 1.7.1-doc, 1.7.1-lib, 1.7.1-man
    [U.]  #24  json-c              0.16 -> 0.17
    [U.]  #25  libbpf              1.2.2 -> 1.3.0
    [U.]  #26  libnl               3.7.0 -> 3.8.0
    [U.]  #27  libseccomp          2.5.4-lib -> 2.5.5-lib
    [U.]  #28  libxml2             2.11.5 -> 2.12.3-unstable-2023-12-14
    [U.]  #29  llvm                16.0.6, 16.0.6-dev, 16.0.6-lib -> 17.0.6, 17.0.6-dev, 17.0.6-lib
    [U.]  #30  pcsclite            1.9.5 -> 2.0.1
    [C.]  #31  python3             3.10.13, 3.10.13-env, 3.11.6, 3.11.6-env -> 3.10.13, 3.10.13-env, 3.11.7, 3.11.7-env
    [U.]  #32  python3.10-pip      23.2.1, 23.2.1-man -> 23.3.1, 23.3.1-man
    [U.]  #33  python3.11-msgpack  1.0.5 -> 1.0.7
    [U.]  #34  rustc               1.74.0 -> 1.75.0
    [U.]  #35  rustc-wrapper       1.74.0 -> 1.75.0
    [U.]  #36  s2n-tls             1.3.56 -> 1.4.1
    [U.]  #37  sqlite              3.43.2 -> 3.44.2
    [U.]  #38  tzdata              2023c -> 2023d
    [U.]  #39  util-linux          2.39.2-bin, 2.39.2-lib, 2.39.2-login, 2.39.2-mount, 2.39.2-swap -> 2.39.3-bin, 2.39.3-lib, 2.39.3-login, 2.39.3-mount, 2.39.3-swap
    [U.]  #40  util-linux-minimal  2.39.2-bin, 2.39.2-lib, 2.39.2-login, 2.39.2-mount, 2.39.2-swap -> 2.39.3-bin, 2.39.3-lib, 2.39.3-login, 2.39.3-mount, 2.39.3-swap
    [U.]  #41  xgcc                12.3.0-libgcc -> 13.2.0-libgcc
    Added packages:
    [A+]  #1  nix-lib-nmd  0.5.0
    Removed packages:
    [R-]  #1  source  <none>
    Closure size: 341 -> 341 (339 paths added, 339 paths removed, delta +0, disk usage +78.9MiB).
kergoth added a commit that referenced this issue May 7, 2024
Signed-off-by: Christopher Larson <[email protected]>
kergoth added a commit that referenced this issue May 7, 2024
Signed-off-by: Christopher Larson <[email protected]>
@kergoth
Copy link
Owner Author

kergoth commented May 7, 2024

The biggest issue with this approach is ensuring the availability of the tools which are installed in the home directory at the time of chezmoi application. They can be installed in a before_ script, but we may well need certain config files to be installed before they can be installed, such as is the case with nix home manager. I don't believe chezmoi's locks allow for a before_ script to partially apply a chezmoi config, but there's potential to leverage chemzoi execute-template for this in the before_ script instead.

kergoth added a commit that referenced this issue May 7, 2024
Signed-off-by: Christopher Larson <[email protected]>
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

No branches or pull requests

1 participant