Initial commit
This commit is contained in:
16
hello-derivation/default.nix
Normal file
16
hello-derivation/default.nix
Normal file
@ -0,0 +1,16 @@
|
||||
let
|
||||
nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-23.05";
|
||||
pkgs = import nixpkgs { config = {}; overlays = []; };
|
||||
in
|
||||
derivation {
|
||||
name = "hello";
|
||||
builder = "${pkgs.bash}/bin/bash";
|
||||
args = [ ./hello_builder.sh ];
|
||||
inherit (pkgs) gnutar gzip gnumake gcc coreutils gawk gnused gnugrep;
|
||||
bintools = pkgs.binutils.bintools;
|
||||
src = pkgs.fetchzip {
|
||||
url = "https://ftp.gnu.org/gnu/hello/hello-2.12.1.tar.gz";
|
||||
sha256 = "sha256-1kJjhtlsAkpNB7f6tZEs+dbKd8z7KoNHyDHEJ0tmhnc=";
|
||||
};
|
||||
system = builtins.currentSystem;
|
||||
}
|
12
hello-derivation/hello_builder.sh
Normal file
12
hello-derivation/hello_builder.sh
Normal file
@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
export PATH="$gnutar/bin:$gcc/bin:$gnumake/bin:$coreutils/bin:$gawk/bin:$gzip/bin:$gnugrep/bin:$gnused/bin:$bintools/bin"
|
||||
|
||||
echo $src
|
||||
# I guess changing nixos version will change behavior of how fetchzip or something.
|
||||
# This script differs from the version used against <nixpkgs>.
|
||||
cd $src
|
||||
ls -l
|
||||
./configure --prefix=$out
|
||||
make
|
||||
make install
|
Reference in New Issue
Block a user