Skip to content

Commit

Permalink
convert to a flake
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHicks committed Jul 8, 2021
1 parent 2c94132 commit 87ff983
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 15 deletions.
15 changes: 0 additions & 15 deletions default.nix

This file was deleted.

60 changes: 60 additions & 0 deletions flake.lock

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

36 changes: 36 additions & 0 deletions flake.nix
@@ -0,0 +1,36 @@
{
description = "sort lines by their similarity to a candidate string";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs?ref=release-21.05";
gitignore = {
url = "github:hercules-ci/gitignore";
flake = false;
};
flake-utils.url = "github:numtide/flake-utils";
};

outputs = inputs:
inputs.flake-utils.lib.eachDefaultSystem (system:
let
pkgs = inputs.nixpkgs.legacyPackages.${system};
gitignore = pkgs.callPackage inputs.gitignore { };
in rec {
packages.similar-sort = pkgs.stdenv.mkDerivation {
name = "similar-sort";
buildInputs = [ pkgs.go ];
src = gitignore.gitignoreSource ./.;

buildPhase = ''
env HOME=$(pwd) GOPATH=$(pwd) go build similar-sort.go
'';

installPhase = ''
mkdir -p $out/bin
cp similar-sort $out/bin
'';
};

defaultPackage = packages.similar-sort;
});
}

0 comments on commit 87ff983

Please sign in to comment.