Skip to content

Commit

Permalink
Merge pull request #1 from marcesquerra/AddNix
Browse files Browse the repository at this point in the history
Add nix
  • Loading branch information
bechampion authored Jun 12, 2024
2 parents 8004d68 + 9be28d1 commit 6be1636
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs="
fi

use flake
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.direnv/
result
61 changes: 61 additions & 0 deletions flake.lock

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

43 changes: 43 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem
(system:
let
overlays = [];
pkgs = import nixpkgs {
inherit system overlays;
};
gohip-package = (pkgs.buildGoModule {
name = "gohip";
pname = "gohip";

src = ./.;
vendorHash = "sha256-kikKkz2XnAo6MVVbu4VOMyW9xUqlxjTrjhzAaGph1CY=";
excludedPackages = ["osdata" "others" "systemd" "types"];
});

in
with pkgs;
{
devShells.default = (import ./shell.nix) pkgs;
apps = rec {
gohip = flake-utils.lib.mkApp {
drv = pkgs.writeShellScriptBin "gohip" ''
cd `mktemp -d`
"${gohip-package}"/bin/hip
'';
};
default = gohip;
};
packages = rec {
gohip = gohip-package;
default = gohip;
};
}
);

}
5 changes: 5 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pkgs :

pkgs.mkShell {
buildInputs = [ pkgs.go ];
}

0 comments on commit 6be1636

Please sign in to comment.