diff --git a/flake.nix b/flake.nix index 214c890..7fee504 100644 --- a/flake.nix +++ b/flake.nix @@ -79,6 +79,7 @@ ./flake/formatter.nix ./flake/hosts.nix ./flake/modules.nix + ./flake/packages.nix ]; }; } diff --git a/flake/packages.nix b/flake/packages.nix new file mode 100644 index 0000000..def4840 --- /dev/null +++ b/flake/packages.nix @@ -0,0 +1,29 @@ +_: +{ + perSystem = + { pkgs, ... }: + { + packages.kuma-cli = pkgs.rustPlatform.buildRustPackage (finalAttrs: { + pname = "kuma-cli"; + version = "1.0.0"; + + src = pkgs.fetchFromGitHub { + owner = "BigBoot"; + repo = "AutoKuma"; + rev = "v${finalAttrs.version}"; + hash = "sha256-o1W0ssR4cjzx9VWg3qS2RhJEe4y4Ez/Y+4yRgXs6q0Y="; + }; + + cargoRoot = "kuma-cli"; + buildAndTestSubdir = finalAttrs.cargoRoot; + cargoLock.lockFile = "${finalAttrs.src}/Cargo.lock"; + + postUnpack = '' + cp ${finalAttrs.src}/Cargo.lock ${finalAttrs.cargoRoot}/Cargo.lock + ''; + + nativeBuildInputs = [ pkgs.pkg-config ]; + buildInputs = [ pkgs.openssl.dev ]; + }); + }; +}