-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use VERSION file to define version for both Makefile and flake.nix.
- Loading branch information
1 parent
627cb2a
commit 4bdff9d
Showing
6 changed files
with
112 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,3 +23,4 @@ | |
# End of https://www.gitignore.io/api/go | ||
/cmd/pistol/pistol | ||
/pistol | ||
result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.1.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
(import ( | ||
let | ||
lock = builtins.fromJSON (builtins.readFile ./flake.lock); | ||
in fetchTarball { | ||
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; | ||
sha256 = lock.nodes.flake-compat.locked.narHash; } | ||
) { | ||
src = ./.; | ||
}).defaultNix |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
description = "General purpose file previewer designed for Ranger, Lf to make scope.sh redundant"; | ||
|
||
# To make user overrides of the nixpkgs flake not take effect | ||
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; | ||
inputs.flake-utils.url = "github:numtide/flake-utils"; | ||
|
||
# https://nixos.wiki/wiki/Flakes#Using_flakes_project_from_a_legacy_Nix | ||
inputs.flake-compat = { | ||
url = "github:edolstra/flake-compat"; | ||
flake = false; | ||
}; | ||
|
||
outputs = { self, nixpkgs, flake-utils, flake-compat }: | ||
flake-utils.lib.eachDefaultSystem | ||
(system: | ||
let | ||
pkgs = nixpkgs.legacyPackages.${system}; | ||
pistol = pkgs.pistol.overrideAttrs(oldAttrs: rec { | ||
version = "${builtins.readFile ./VERSION}-flake"; | ||
buildFlagsArray = [ | ||
"-ldflags=-s -w -X main.Version=${version}" | ||
]; | ||
}); | ||
in rec { | ||
devShell = pkgs.mkShell { | ||
buildInputs = pistol.buildInputs ++ [ | ||
pkgs.w3m | ||
]; | ||
}; | ||
packages.pistol = pistol; | ||
defaultPackage = pistol; | ||
apps.pistol = { | ||
type = "app"; | ||
program = "${pistol}/bin/pistol"; | ||
}; | ||
defaultApp = apps.pistol; | ||
} | ||
); | ||
} |