From be006e35077f743ea592761916b77d0a90cf47fc Mon Sep 17 00:00:00 2001 From: tezlm Date: Mon, 5 Feb 2024 18:02:35 -0800 Subject: [PATCH] add flake --- .gitignore | 1 + Makefile | 2 +- flake.nix | 13 +++++++++++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index a701a5be..a3e53b77 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ nnn src/icons-generated*.h src/icons-hash-gen +result diff --git a/Makefile b/Makefile index e1590789..ca8e026f 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ VERSION = $(shell grep -m1 VERSION $(SRC) | cut -f 2 -d'"') -PREFIX ?= /usr/local +PREFIX ?= $(out) MANPREFIX ?= $(PREFIX)/share/man DESKTOPPREFIX ?= $(PREFIX)/share/applications DESKTOPICONPREFIX ?= $(PREFIX)/share/icons/hicolor diff --git a/flake.nix b/flake.nix index 4dbe0767..22bdc43d 100644 --- a/flake.nix +++ b/flake.nix @@ -2,9 +2,18 @@ description = "nnn, the file manager"; outputs = { self, nixpkgs }: - let pkgs = nixpkgs.legacyPackages.x86_64-linux; in { + let + pkgs = nixpkgs.legacyPackages.x86_64-linux; + buildInputs = [ pkgs.gnumake pkgs.gcc pkgs.readline pkgs.pkg-config ]; + in { devShell.x86_64-linux = pkgs.mkShell { - buildInputs = [ pkgs.gnumake pkgs.gcc pkgs.readline pkgs.pkg-config ]; + inherit buildInputs; + }; + packages.x86_64-linux.default = pkgs.stdenv.mkDerivation { + pname = "nnn"; + version = "v4.9"; + src = ./.; + inherit buildInputs; }; }; }