Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,48 @@ cargo build --release

---

### ❄️ Nix (Flakes)

A `flake.nix` is provided for [Nix](https://nixos.org/) users. Requires flakes
enabled (`experimental-features = nix-command flakes` in `~/.config/nix/nix.conf`).

**Run without installing:**

```bash
nix run github:timhartmann7/omnyssh
nix run github:timhartmann7/omnyssh -- --theme dracula
```

**Build a local checkout:**

```bash
git clone https://github.com/timhartmann7/omnyssh.git
cd omnyssh
nix build # binary at ./result/bin/omny
./result/bin/omny --version
```

**Install into your user profile:**

```bash
nix profile install github:timhartmann7/omnyssh
```

**Develop with a pinned toolchain:**

```bash
nix develop # drops you into a shell with rustc, cargo, clippy,
# rustfmt, rust-analyzer, and all build inputs ready
cargo build
```

The flake exposes `packages.default` (the `omny` binary plus man page),
`apps.default` (for `nix run`), and `devShells.default`. It evaluates
cleanly across `x86_64-linux`, `aarch64-linux`, `x86_64-darwin`, and
`aarch64-darwin`.

---

## Quick Start

1. **Install OmnySSH** (see above)
Expand Down
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

65 changes: 65 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
description = "OmnySSH — TUI SSH dashboard & server manager";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };

cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);

omnyssh = pkgs.rustPlatform.buildRustPackage {
pname = cargoToml.package.name;
version = cargoToml.package.version;

src = self;

cargoLock = {
lockFile = ./Cargo.lock;
};

nativeBuildInputs = [ pkgs.pkg-config pkgs.installShellFiles ];

postInstall = ''
installManPage doc/omny.1
'';

meta = with pkgs.lib; {
description = cargoToml.package.description;
homepage = cargoToml.package.repository;
license = licenses.asl20;
mainProgram = "omny";
};
};
in
{
packages = {
default = omnyssh;
omnyssh = omnyssh;
};

apps.default = {
type = "app";
program = "${omnyssh}/bin/omny";
meta = omnyssh.meta;
};

devShells.default = pkgs.mkShell {
inputsFrom = [ omnyssh ];
packages = with pkgs; [
rustc
cargo
rustfmt
clippy
rust-analyzer
];

RUST_SRC_PATH = "${pkgs.rustPlatform.rustLibSrc}";
};
});
}