From a1af9b3e6c94f435f9532c0c690898866e50527c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Thu, 1 Aug 2024 19:38:03 +0200 Subject: [PATCH] Thu 1 Aug 19:38:03 CEST 2024 --- default.nix | 27 ++++++++++++++++++++++++ flake.lock | 48 ++++++++++++++++++++++++++++++++++++++++++ flake.nix | 28 ++++++++++++++++++++++++ data.go => src/data.go | 0 go.mod => src/go.mod | 0 go.sum => src/go.sum | 0 main.go => src/main.go | 0 tui.go => src/tui.go | 0 8 files changed, 103 insertions(+) create mode 100644 default.nix create mode 100644 flake.lock create mode 100644 flake.nix rename data.go => src/data.go (100%) rename go.mod => src/go.mod (100%) rename go.sum => src/go.sum (100%) rename main.go => src/main.go (100%) rename tui.go => src/tui.go (100%) diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..4c1bba2 --- /dev/null +++ b/default.nix @@ -0,0 +1,27 @@ +{ + buildGoModule, + lib, +}: +buildGoModule { + pname = "fzgo"; + version = "0.1.0"; + + src = builtins.path { + name = "fzgo-source"; + path = ./src; + }; + vendorHash = "sha256-0YG2kf1500UpSdDK+ONGTKGZFrIivi/O1g2uIkgd4DA="; + + nativeBuildInputs = [ ]; + + buildInputs = [ ]; + + meta = with lib; { + description = "An alternative to FZF written in Go, specifically optimized for file path selection."; + homepage = "https://git.thomasave.be/thomasave/fzgo"; + license = licenses.mit; + maintainers = with maintainers; [thomasave]; + platforms = platforms.linux; + mainProgram = "fzgo"; + }; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..31f0e3e --- /dev/null +++ b/flake.lock @@ -0,0 +1,48 @@ +{ + "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1719994518, + "narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1722421184, + "narHash": "sha256-/DJBI6trCeVnasdjUo9pbnodCLZcFqnVZiLUfqLH4jA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9f918d616c5321ad374ae6cb5ea89c9e04bf3e58", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..a5b8d57 --- /dev/null +++ b/flake.nix @@ -0,0 +1,28 @@ +{ + description = "An alternative to FZF written in Go, specifically optimized for file path selection."; + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-parts = { + url = "github:hercules-ci/flake-parts"; + inputs.nixpkgs-lib.follows = "nixpkgs"; + }; + }; + + outputs = inputs @ {flake-parts, ...}: + flake-parts.lib.mkFlake {inherit inputs;} { + systems = ["x86_64-linux" "aarch64-linux"]; + perSystem = { + pkgs, + system, + ... + }: let + fzgo = pkgs.callPackage ./. {}; + in { + formatter = pkgs.alejandra; + packages = { + default = fzgo; + inherit fzgo; + }; + }; + }; +} diff --git a/data.go b/src/data.go similarity index 100% rename from data.go rename to src/data.go diff --git a/go.mod b/src/go.mod similarity index 100% rename from go.mod rename to src/go.mod diff --git a/go.sum b/src/go.sum similarity index 100% rename from go.sum rename to src/go.sum diff --git a/main.go b/src/main.go similarity index 100% rename from main.go rename to src/main.go diff --git a/tui.go b/src/tui.go similarity index 100% rename from tui.go rename to src/tui.go