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

Available as Home-Manager Module #17

Closed
nickgarber opened this issue Mar 15, 2023 · 3 comments
Closed

Available as Home-Manager Module #17

nickgarber opened this issue Mar 15, 2023 · 3 comments

Comments

@nickgarber
Copy link

nickgarber commented Mar 15, 2023

Hiya :)

Would you be open to enabling support for configuring and using Garden from Home-Manager [1], which is a declarative user-config manager within the Nix ecosystem?

I'd be interesting in contributing or supporting this with your guidance.

Home-Manager provides a wide array of configuration options [2] but nothing at all to manage git repos - in this way, it seems Garden and Home-Manager are extremely complementary to each other.

For my purposes, I'd like to use Home-Manager to install Garden, Push/Sync my Garden config file, and perhaps even (optionally) apply that garden config on login.

Happy to discuss more and thanks so much for the project!

[1] https://nix-community.github.io/home-manager/index.html
[2] https://nix-community.github.io/home-manager/options.html

@davvid davvid mentioned this issue Mar 17, 2023
davvid added a commit that referenced this issue Dec 15, 2023
Add a flake.nix recipe that uses crane to build and test garden.

Related-to: #17
Resolves: #16
@davvid
Copy link
Member

davvid commented Dec 15, 2023

Garden now includes a flake.nix file so it should be possible to install garden using home manager. Let me know if there's anything more that can be done to facilitate using garden alongside home manager.

davvid added a commit that referenced this issue Dec 16, 2023
@davvid
Copy link
Member

davvid commented Sep 27, 2024

We have a fully-functioning flake.nix (thanks @jordilin) so I'm going to close this issue out as completed. Let me know if there's anything else we can do here from your perspective nonetheless.

@davvid davvid closed this as completed Sep 27, 2024
@jordilin
Copy link
Contributor

Well, with home-manager you can actually build garden using a derivation and make it widely available across repos without the need to run a nix shell (flake.nix).

For example, if you setup this in a folder /path/to/home-manager/derivations/garden.nix

garden.nix

{ lib, fetchFromGitHub, rustPlatform }:

rustPlatform.buildRustPackage rec {
  pname = "garden";
  version = "v1.8.0";

  src = fetchFromGitHub {
    owner = "garden-rs";
    repo = "garden";
    rev = version;
    hash = "sha256-+hcjHuJvqxkp+5FikVb8+mpU6rObC4xkMj/NBZDYTrQ=";
  };
  cargoHash = "sha256-12X4bMDAQTLZfiPSbY9cPXB8cW1L0zYrts5F5CXzV7Y=";
}

Note 1: hashes hash and cargoHash above are for v.1.8.0 specifically. One could set them to lib.fakeHash; let the build fail with the error specifying the right hash, paste the correct hash and rebuild.
Note 2: If tests fail due to missing git in your build environment, one can set this up with doCheck = false.

you can activate the derivation above in your home.nix with

home.nix

{ config, pkgs, ... }:
    let garden =  pkgs.callPackage ./derivations/garden.nix {};
in
{
   home.packages = [
       garden
  ]
}

davvid added a commit that referenced this issue Sep 29, 2024
* jordilin/updatenixdoc:
  flake.nix: Fix crane warning during build
  Document Nix home-manager integration
  Add mdbook in development shell

Closes: #17
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

3 participants