diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 29812d3..e5e42ce 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -85,3 +85,25 @@ jobs: ebuild /var/db/repos/localrepo/app-misc/psn/psn-9999.ebuild manifest FEATURES="-ipc-sandbox -network-sandbox -pid-sandbox -mount-sandbox -usersandbox -userpriv" \ emerge -pv =app-misc/psn-9999 + + nix: + runs-on: ubuntu-latest + container: + image: nixos/nix:2.34.0 + + steps: + - name: Enable flakes + run: | + mkdir -p /etc/nix + echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf + + - name: Clone repository + run: | + git init /psn + git -C /psn fetch --depth 1 "https://github.com/${GITHUB_REPOSITORY}.git" "${GITHUB_REF}" + git -C /psn checkout FETCH_HEAD + + - name: Build nix flake + run: | + cd /psn + nix build . --option sandbox false --print-build-logs diff --git a/AGENTS.md b/CLAUDE.md similarity index 100% rename from AGENTS.md rename to CLAUDE.md diff --git a/README.md b/README.md index 1cc9050..f7c265a 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,9 @@ [![Codecov](https://codecov.io/gh/l5yth/psn/graph/badge.svg)](https://codecov.io/gh/l5yth/psn) [![GitHub Release](https://img.shields.io/github/v/release/l5yth/psn)](https://github.com/l5yth/psn/releases) [![Crates.io](https://img.shields.io/crates/v/psn.svg)](https://crates.io/crates/psn) +[![AUR Version](https://img.shields.io/aur/version/psn-bin?logo=archlinux)](https://aur.archlinux.org/packages/psn-bin) +[![Nix Flake](https://img.shields.io/badge/nix-flake-5277C3?logo=nixos)](https://github.com/l5yth/psn/blob/main/flake.nix) +[![Gentoo](https://img.shields.io/badge/gentoo-ebuild-54487A?logo=gentoo)](https://github.com/l5yth/psn/tree/main/packaging/gentoo) [![Top Language](https://img.shields.io/github/languages/top/l5yth/psn)](https://github.com/l5yth/psn) [![License: Apache-2.0](https://img.shields.io/github/license/l5yth/psn)](https://github.com/l5yth/psn/blob/main/LICENSE) diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..8d169a6 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1772624091, + "narHash": "sha256-QKyJ0QGWBn6r0invrMAK8dmJoBYWoOWy7lN+UHzW1jc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "80bdc1e5ce51f56b19791b52b2901187931f5353", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..fbab246 --- /dev/null +++ b/flake.nix @@ -0,0 +1,19 @@ +# Copyright (c) 2026 l5yth +# SPDX-License-Identifier: Apache-2.0 +{ + description = "Terminal UI for process status navigation and control"; + + 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 = nixpkgs.legacyPackages.${system}; + in { + packages.default = pkgs.callPackage ./packaging/nix {}; + } + ); +} diff --git a/packaging/nix/default.nix b/packaging/nix/default.nix new file mode 100644 index 0000000..65adb93 --- /dev/null +++ b/packaging/nix/default.nix @@ -0,0 +1,20 @@ +# Copyright (c) 2026 l5yth +# SPDX-License-Identifier: Apache-2.0 +{ lib, rustPlatform }: + +rustPlatform.buildRustPackage { + pname = "psn"; + version = "0.1.2"; + + src = lib.cleanSource ../..; + + cargoLock.lockFile = ../../Cargo.lock; + + meta = with lib; { + description = "Terminal UI for process status navigation and control"; + homepage = "https://github.com/l5yth/psn"; + license = licenses.asl20; + mainProgram = "psn"; + platforms = platforms.linux; + }; +}