ToyVo / nh_darwin

Yet another nix cli helper
European Union Public License 1.2
15 stars 3 forks source link

Installation #1

Closed bestlem closed 4 months ago

bestlem commented 4 months ago

How do you install this.

The README documentation shows the instructions from @ViperML's original.

Your fork is obviously not in nixpkgs as the name would conflict.

Also does the fork work with the Nix-Darwin PR https://github.com/LnL7/nix-darwin/pull/942

ToyVo commented 4 months ago

I install this by importing the module and enabling the program option

{ inputs, ... }: {
  imports = [
    inputs.nh.nixDarwinModules.default
   ];

  config = {
    programs.nh.enable = true;
  };
}

Now with that PR, it will use nh from nixpkgs, in which case we can then set programs.nh.package = inputs.nh.packages.${pkgs.stdenv.hostPlatform.system}.default;

Once that PR is pulled in, I'll modify my darwin module to simply override the default program used like I've done in the nixos module.

I am open to a name suggestion for a fork I was thinking nn, which doesn't exist but there does exist nnn, nng, and others

if you want to run this without installing you can run nix run github:toyvo/nh os switch

bestlem commented 4 months ago

A possible name would be nh-darwin. So shows it is a version of nh and also what is special about it.

We are not on slow teletypes or 120baud serial lines so don't need short names.

bestlem commented 4 months ago

I have been running with the nix run with no problems.

I just tried using your Nix-Darwin patch. nh --version should return something showing it is the darwin version. Shouldn't you darwin patch set program.nk.package to your version or does that immediately for Nix-Darwin to include your repo in flake inputs (or does nix lazily evaluate enough?)

ToyVo commented 4 months ago

I just rebased on upstream and I updated the version to add that darwin suffix you requested so you can easily tell if you are using this fork

ToyVo commented 4 months ago

I have now renamed to nh-darwin. I have not added a module option to add an alias, you'll have to do that yourself. Additionally the default darwin module is now designed for after the nix-darwin PR is merged, for before hand if you want my version of the module you can use prebuiltin module instead of the default one

{ inputs, ... }: {
  imports = [
    inputs.nh.nixDarwinModules.prebuiltin
   ];

  config = {
    programs.nh.enable = true;
  };
}