Skip to content

Commit

Permalink
Add support for Nix/NixOS
Browse files Browse the repository at this point in the history
  • Loading branch information
Lin Vieira committed Nov 21, 2024
1 parent 091038f commit 7bf22a3
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ main
*.so
*.dylib
*.dll
result
42 changes: 42 additions & 0 deletions flake.lock

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

40 changes: 40 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

{ description = "Go Anime Nix Flake";

inputs = {
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.2405.*.tar.gz";
nixos-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs, nixos-unstable }:
let
allSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];


forAllSystems = f: nixpkgs.lib.genAttrs allSystems (system: f {

pkgs = import nixos-unstable { inherit system; };
});
in
{
packages = forAllSystems ({ pkgs }: {
default = pkgs.buildGoModule {
name = "GoAnime";
go = pkgs.go_1_23;
src = self;
vendorHash = "sha256-dqfgiBMcEhq5hr524BKIbP0ulByWJa7gkoxSy4598v8=";
subPackages = [ "cmd/goanime" ];
propagatedBuildInputs = with pkgs;[ mpv yt-dlp ];
};
});
devShell = forAllSystems ({ pkgs }: pkgs.mkShell {
buildInputs = with pkgs;[ mpv yt-dlp];
});
};
}


0 comments on commit 7bf22a3

Please sign in to comment.