Skip to content

Commit

Permalink
feat(nix): added nix derivation
Browse files Browse the repository at this point in the history
  • Loading branch information
Wittano committed Oct 29, 2023
1 parent 8337b73 commit 22769a1
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 0 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake;
28 changes: 28 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{ lib, buildGoModule, gcc, pkg-config, libopus, ffmpeg, opusfile }: buildGoModule {
pname = "komputer";
version = "v1.0.0";

src = ./.;

vendorHash = "sha256-TAbmS8xYqleXIU0cCRiJVyC93jiXiLuLepMD4WcS7IQ=";

nativeBuildInputs = [ gcc pkg-config libopus ];

CGO_ENABLED = 1;

proxyVendor = true;

preBuild = ''
go get layeh.com/gopus
'';

propagatedBuildInputs = [ ffmpeg opusfile ];

meta = with lib; {
homepage = "https://github.com/Wittano/komputer";
description = "Discord bot behave as like 'komputer'. One of character in Star Track parody series created by Dem3000";
license = licenses.gpl3;
maintainers = with maintainers; [ Wittano ];
platforms = platforms.linux;
};
}
27 changes: 27 additions & 0 deletions flake.lock

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

32 changes: 32 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
description = "komputer - discord bot";

inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";

outputs = { self, nixpkgs }:
let
pkgs = import nixpkgs {
system = "x86_64-linux";
};

lib = nixpkgs.lib.extend (self: super: {
my = import ./lib { inherit pkgs; lib = self; };
});
in rec {
inherit lib;

packages.x86_64-linux.komputer = pkgs.callPackage ./default.nix {};

defaultPackage.x86_64-linux = self.packages.x86_64-linux.komputer;

devShell = pkgs.mkShell {
packages = with pkgs; [
go
ffmpeg
rnix-lsp
nixfmt
nixpkgs-fmt
];
};
};
}

0 comments on commit 22769a1

Please sign in to comment.