From ea1518da4565042fe0b4f8c4367709857ade333c Mon Sep 17 00:00:00 2001 From: xkm Date: Tue, 24 Feb 2026 16:05:13 +0800 Subject: [PATCH] init and add hello-2.2 --- .gitignore | 1 + STDENV.md | 1 + hello.nix | 12 ++++++++++++ 3 files changed, 14 insertions(+) create mode 100644 .gitignore create mode 100644 STDENV.md create mode 100644 hello.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b2be92b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +result diff --git a/STDENV.md b/STDENV.md new file mode 100644 index 0000000..fbd7518 --- /dev/null +++ b/STDENV.md @@ -0,0 +1 @@ +offical doc: https://github.com/NixOS/nixpkgs/blob/master/doc/stdenv/stdenv.chapter.md diff --git a/hello.nix b/hello.nix new file mode 100644 index 0000000..9a12a1b --- /dev/null +++ b/hello.nix @@ -0,0 +1,12 @@ +let + pkgs = import {}; + inherit (pkgs) stdenv fetchurl; +in +stdenv.mkDerivation (finalAttrs: { + pname = "hello"; + version = "2.2"; + src = fetchurl { + url = "https://ftp.gnu.org/gnu/hello/hello-${finalAttrs.version}.tar.gz"; + hash = "sha256-aaKGGx/OxlfBoOyKh704+48AcqHewIX91WU9qsm+V1E="; + }; +})