Re-introduce flake support

Relevant issue: #24
This commit is contained in:
Utku Demir 2021-06-17 10:55:07 +12:00
parent 415a0acb62
commit 7b01789fb6
No known key found for this signature in database
GPG Key ID: F3F8629C3E0BF60B
3 changed files with 75 additions and 0 deletions

View File

@ -21,6 +21,12 @@ To run the current development version:
nix-shell -p '(import (builtins.fetchTarball "https://github.com/utdemir/nix-tree/archive/main.tar.gz") {}).nix-tree' --run nix-tree
```
Or, if you use a Nix version with flake support:
```
nix run github:utdemir/nix-tree
```
## Usage
```

44
flake.lock Normal file
View File

@ -0,0 +1,44 @@
{
"nodes": {
"flake-utils": {
"locked": {
"lastModified": 1623875721,
"narHash": "sha256-A8BU7bjS5GirpAUv4QA+QnJ4CceLHkcXdRp4xITDB0s=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "f7e004a55b120c02ecb6219596820fcd32ca8772",
"type": "github"
},
"original": {
"owner": "numtide",
"ref": "master",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1623176226,
"narHash": "sha256-54a9uvHlIlK3i0b36HfGMc4zqM0BpMOOiFYBxEhQFK8=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "51bb9f3e9ab6161a3bf7746e20b955712cef618b",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

25
flake.nix Normal file
View File

@ -0,0 +1,25 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils/master";
};
description = "Interactively browse the dependency graph of your Nix derivations.";
outputs = { self, nixpkgs, flake-utils }:
let
overlay = self: super: {
nix-tree =
(self.callPackage ./default.nix { }).nix-tree;
};
in
{ inherit overlay; } // flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; overlays = [ overlay ]; };
in
{
defaultPackage = pkgs.nix-tree;
devShell = (pkgs.callPackage ./default.nix { }).shell;
}
);
}