Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pedorich-n/home-manager-diff
Display difference between HM generations automatically
https://github.com/pedorich-n/home-manager-diff
home-manager nix nvd
Last synced: 30 days ago
JSON representation
Display difference between HM generations automatically
- Host: GitHub
- URL: https://github.com/pedorich-n/home-manager-diff
- Owner: pedorich-n
- Created: 2023-08-19T04:13:28.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-02T09:58:56.000Z (about 1 month ago)
- Last Synced: 2025-01-02T12:57:26.062Z (about 1 month ago)
- Topics: home-manager, nix, nvd
- Language: Python
- Homepage:
- Size: 105 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Home Manager Diff
Home Manager Diff (`hmd`) is a wrapper around [nvd](https://gitlab.com/khumba/nvd), that simplifies the process of comparing different Home-Manager generations.
It also provides an `activation` script that runs `hmd` during `home-manager switch`, showing the differences between the latest and current generations.> **Warning**
> Only works with standalone Home-Manager installation at the moment.## Installation
In your `flake.nix`:
```nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
home-manager-diff.url = "github:pedorich-n/home-manager-diff";
};outputs = { self, nixpkgs, home-manager, home-manager-diff }: {
homeConfigurations.example = home-manager.lib.homeManagerConfiguration {
...
modules = [
home-manager-diff.hmModules.default
./configuration.nix
];
};
};
}```
`configuration.nix`:
```nix
{...}: {
programs.hmd = {
enable = true;
runOnSwitch = true; # enabled by default
};
}```
## Usage
After the installation, simply run `home-manager switch` as usual. HMD will automatically show the differences between the latest and current generations.
You can also run `hmd` from CLI to compare any two Home-Manager generations.
## Demo
Here's an example what `hmd` prints out on a `home-manager switch`. In this generation `neovim` was added and `wslu` removed:
[![asciicast](https://asciinema.org/a/aWEeIIn6THrQCPsKSczd97ZXV.svg)](https://asciinema.org/a/aWEeIIn6THrQCPsKSczd97ZXV)
And here's ane example of comparing any two Home-Manager generations using `hmd`:
[![asciicast](https://asciinema.org/a/UyTKnK74mx1HWsua8GwVsj6b0.svg)](https://asciinema.org/a/UyTKnK74mx1HWsua8GwVsj6b0)