Skip to content

Commit 24aeefe

Browse files
committed
chore: nixos package
1 parent 720cd79 commit 24aeefe

3 files changed

Lines changed: 119 additions & 0 deletions

File tree

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,32 @@ Or install with go:
1212
go get github.com/rwxd/vmrss
1313
```
1414

15+
### NixOS / Nix
16+
17+
Add to your `flake.nix`:
18+
19+
```nix
20+
{
21+
inputs.vmrss.url = "github:rwxd/vmrss";
22+
# Or use a specific version:
23+
# inputs.vmrss.url = "github:rwxd/vmrss/v1.0.0";
24+
}
25+
```
26+
27+
Then use in your configuration:
28+
29+
```nix
30+
environment.systemPackages = [ inputs.vmrss.packages.${system}.vmrss ];
31+
```
32+
33+
Or run directly:
34+
35+
```bash
36+
nix run github:rwxd/vmrss -- -m <pid>
37+
# Or use a specific version:
38+
# nix run github:rwxd/vmrss/v1.0.0 -- -m <pid>
39+
```
40+
1541
## Usage
1642

1743
### Continuously monitor a process

flake.lock

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
description = "A simple tool to show the memory usage of a process and its children";
3+
4+
inputs = {
5+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
6+
flake-utils.url = "github:numtide/flake-utils";
7+
};
8+
9+
outputs = { self, nixpkgs, flake-utils }:
10+
flake-utils.lib.eachDefaultSystem (system:
11+
let
12+
pkgs = nixpkgs.legacyPackages.${system};
13+
in
14+
{
15+
packages.vmrss = pkgs.buildGoModule {
16+
pname = "vmrss";
17+
version = "0.1.0";
18+
src = ./.;
19+
vendorHash = null;
20+
};
21+
22+
apps.default = {
23+
type = "app";
24+
program = "${self.packages.${system}.vmrss}/bin/vmrss";
25+
};
26+
27+
devShells.default = pkgs.mkShell {
28+
buildInputs = with pkgs; [ go ];
29+
};
30+
}
31+
);
32+
}

0 commit comments

Comments
 (0)