Adding more flakes samples
This commit is contained in:
61
flake-mkDerivation/flake.lock
generated
Normal file
61
flake-mkDerivation/flake.lock
generated
Normal file
@ -0,0 +1,61 @@
|
||||
{
|
||||
"nodes": {
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1710146030,
|
||||
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1710631334,
|
||||
"narHash": "sha256-rL5LSYd85kplL5othxK5lmAtjyMOBg390sGBTb3LRMM=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "c75037bbf9093a2acb617804ee46320d6d1fea5a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
54
flake-mkDerivation/flake.nix
Normal file
54
flake-mkDerivation/flake.nix
Normal file
@ -0,0 +1,54 @@
|
||||
# Source: https://fasterthanli.me/series/building-a-rust-service-with-nix/part-10#a-flake-with-derivation
|
||||
# nix build .#packages.x86_64-linux.shaka-packager
|
||||
# nix build .#shaka-packager
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
outputs = { self, nixpkgs, flake-utils }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
name = "simple";
|
||||
src = ./.;
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
{
|
||||
packages.default = derivation {
|
||||
inherit system name src;
|
||||
builder = with pkgs; "${bash}/bin/bash";
|
||||
args = [ "-c" "echo foo > $out" ];
|
||||
};
|
||||
packages.shaka-packager =
|
||||
let
|
||||
version = "2.6.1";
|
||||
inherit (pkgs) stdenv lib;
|
||||
in
|
||||
stdenv.mkDerivation
|
||||
{
|
||||
name = "shaka-packager-${version}";
|
||||
|
||||
# https://nixos.wiki/wiki/Packaging/Binaries
|
||||
src = pkgs.fetchurl {
|
||||
url =
|
||||
"https://github.com/shaka-project/shaka-packager/releases/download/v${version}/packager-linux-x64";
|
||||
sha256 = "sha256-MoMX6PEtvPmloXJwRpnC2lHlT+tozsV4dmbCqweyyI0=";
|
||||
};
|
||||
|
||||
dontUnpack = true;
|
||||
sourceRoot = ".";
|
||||
|
||||
installPhase = ''
|
||||
install -m755 -D $src $out/bin/shaka-packager
|
||||
'';
|
||||
|
||||
meta = with nixpkgs.lib; {
|
||||
homepage = "https://shaka-project.github.io/shaka-packager/html/";
|
||||
description =
|
||||
"Media packaging framework for VOD and Live DASH and HLS applications";
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user