gitfetch icon indicating copy to clipboard operation
gitfetch copied to clipboard

Rewrite Nix Documentation

Open ilonic23 opened this issue 1 year ago • 2 comments

I would like to suggest a new documentation for Nix:

# Installation (Flakes):

To install, you should add an input to your flake:
```nix
gitfetch.url = "github:Matars/gitfetch";
```

Minimal flake variant for it to work:
```nix
{
  description = "My awesome flake";

	inputs = {
	  nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; # or your version
	  gitfetch.url = "github:Matars/gitfetch";
	};
  outputs = inputs@{ self, nixpkgs, gitfetch }:
  	let
  		system = "x86_64-linux";
  		pkgs = import nixpkgs { 
  		  inherit system; 
  		};
  	in {
  	  nixosConfigurations = {
  	  	nixos = nixpkgs.lib.nixosSystem {
  	  	  specialArgs = { inherit system; inherit inputs; };
		  modules = [
		    ./configuration.nix
		  ];
  	  	};
  	  };
  	};
}
```

Then in ``environment.systemPackages`` add this:
```nix
environment.systemPackages = with pkgs; [
	# ...
	inputs.gitfetch.packages.${system}.default # your actual input name
	gh # don't forget to install it and authenticate
]
```

# Updating (Flakes)

To update, run these commands and then rebuild
```shell
nix flake update gitfetch # gitfetch should be replaced by your input name in the flake
nixos-rebuild switch
```

For now, I couldn't find a proper way to install without flakes, I shall research more about that.

ilonic23 avatar Oct 27 '25 04:10 ilonic23

You can add this as a pull request

Zeviraty avatar Oct 27 '25 06:10 Zeviraty

Didn't see the docs folder, sorry

ilonic23 avatar Oct 27 '25 11:10 ilonic23