From 4c9e02cd697498957c23830db34fb4b57bd1aaf5 Mon Sep 17 00:00:00 2001 From: Lin Vieira Date: Sat, 23 Nov 2024 02:47:23 -0300 Subject: [PATCH] add Nix/NixOS Support --- flake.lock | 42 ++++++++++++++++++++++++++++++++++++++++++ flake.nix | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..50bf532 --- /dev/null +++ b/flake.lock @@ -0,0 +1,42 @@ +{ + "nodes": { + "nixos-unstable": { + "locked": { + "lastModified": 1732014248, + "narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "23e89b7da85c3640bbc2173fe04f4bd114342367", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1721949857, + "narHash": "sha256-DID446r8KsmJhbCzx4el8d9SnPiE8qa6+eEQOJ40vR0=", + "rev": "a1cc729dcbc31d9b0d11d86dc7436163548a9665", + "revCount": 633481, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.2405.633481%2Brev-a1cc729dcbc31d9b0d11d86dc7436163548a9665/0190ef32-8438-79be-9d83-2e97dc792840/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/NixOS/nixpkgs/0.2405.%2A.tar.gz" + } + }, + "root": { + "inputs": { + "nixos-unstable": "nixos-unstable", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..53f526a --- /dev/null +++ b/flake.nix @@ -0,0 +1,38 @@ +{ 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]; + }); + }; +} +