From adba030111af3de18c9ad41b5ee389b140811fbb Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 1 Dec 2020 21:15:47 -0500 Subject: nix shebangs, consider --- default.nix | 5 ++++- nixEnv/shells/shell-dmd-verNix.nix | 1 + nixEnv/shells/shell-dmd-verUser.nix | 1 + nixEnv/shells/shell-ldc-verNix.nix | 11 ++++++++-- nixEnv/shells/shell-ldc-verUser.nix | 11 ++++++++-- org/spine_build_scaffold.org | 40 +++++++++++++++++++++++++++---------- project.nix | 4 +++- 7 files changed, 57 insertions(+), 16 deletions(-) mode change 100644 => 100755 default.nix mode change 100644 => 100755 nixEnv/shells/shell-dmd-verNix.nix mode change 100644 => 100755 nixEnv/shells/shell-dmd-verUser.nix mode change 100644 => 100755 nixEnv/shells/shell-ldc-verNix.nix mode change 100644 => 100755 nixEnv/shells/shell-ldc-verUser.nix diff --git a/default.nix b/default.nix old mode 100644 new mode 100755 index ebadd91..bf5940a --- a/default.nix +++ b/default.nix @@ -1,3 +1,4 @@ +#!/usr/bin/env -S nix-build { pkgs ? import {}, stdenv ? pkgs.stdenv, }: @@ -6,7 +7,9 @@ mkDubDerivation rec { name = "spine-${version}"; version = "0.11.1"; src = ./.; - buildInputs = [ pkgs.sqlite ]; + buildInputs = [ + pkgs.sqlite + ]; meta = with stdenv.lib; { homepage = http://sisudoc.org; description = "a sisu like document parser"; diff --git a/nixEnv/shells/shell-dmd-verNix.nix b/nixEnv/shells/shell-dmd-verNix.nix old mode 100644 new mode 100755 index 7f16efe..cac08f4 --- a/nixEnv/shells/shell-dmd-verNix.nix +++ b/nixEnv/shells/shell-dmd-verNix.nix @@ -1,3 +1,4 @@ +#!/usr/bin/env -S nix-shell { pkgs ? import {} }: pkgs.mkShell { buildInputs = with pkgs; [ diff --git a/nixEnv/shells/shell-dmd-verUser.nix b/nixEnv/shells/shell-dmd-verUser.nix old mode 100644 new mode 100755 index 334aece..4e40c0b --- a/nixEnv/shells/shell-dmd-verUser.nix +++ b/nixEnv/shells/shell-dmd-verUser.nix @@ -1,3 +1,4 @@ +#!/usr/bin/env -S nix-shell { pkgs ? import { overlays = [ ]; } }: diff --git a/nixEnv/shells/shell-ldc-verNix.nix b/nixEnv/shells/shell-ldc-verNix.nix old mode 100644 new mode 100755 index 0a6aa9a..748f553 --- a/nixEnv/shells/shell-ldc-verNix.nix +++ b/nixEnv/shells/shell-ldc-verNix.nix @@ -1,5 +1,12 @@ +#!/usr/bin/env -S nix-shell { pkgs ? import {} }: pkgs.mkShell { - buildInputs = with pkgs; - [ (import ./packages-ldc.nix { inherit pkgs; }) ]; + buildInputs = with pkgs; [ + (import ./packages-ldc.nix { inherit pkgs; }) + ]; + shellHook = '' + # nix-build + ## nix-build -I nixpkgs= + ## nix-build -I nixpkgs=/nixpkgs-ra/nixpkgs + ''; } diff --git a/nixEnv/shells/shell-ldc-verUser.nix b/nixEnv/shells/shell-ldc-verUser.nix old mode 100644 new mode 100755 index 1c9c092..d7f3267 --- a/nixEnv/shells/shell-ldc-verUser.nix +++ b/nixEnv/shells/shell-ldc-verUser.nix @@ -1,7 +1,14 @@ +#!/usr/bin/env -S nix-shell { pkgs ? import { overlays = [ (import ../overlays/ldcVersion.nix) ]; } }: pkgs.mkShell { - buildInputs = with pkgs; - [ (import ./packages-ldc.nix { inherit pkgs; }) ]; + buildInputs = with pkgs; [ + (import ./packages-ldc.nix { inherit pkgs; }) + ]; + shellHook = '' + # nix-build + ## nix-build -I nixpkgs= + ## nix-build -I nixpkgs=/nixpkgs-ra/nixpkgs + ''; } diff --git a/org/spine_build_scaffold.org b/org/spine_build_scaffold.org index a646763..dd043e2 100644 --- a/org/spine_build_scaffold.org +++ b/org/spine_build_scaffold.org @@ -1773,7 +1773,9 @@ in mkShell { with import ./mkDub.nix { inherit pkgs; }; mkDubDerivation { src = ./.; - buildInputs = [ pkgs.sqlite ]; + buildInputs = [ + pkgs.sqlite + ]; } #+END_SRC @@ -1807,6 +1809,11 @@ fi #+END_SRC ** shells shell.nix SELECT :shell: + + nix-shell + nix-shell --pure -I nixpkgs=/nixpkgs-ra/nixpkgs + nix-shell --pure -p "with import /nixpkgs-ra/nixpkgs {}; ldc" + *** dmd shell :dmd: - ln -sf nixEnv/shells/shell-dmd-verNix.nix shell.nix @@ -1819,7 +1826,7 @@ fi - ln -sf nixEnv/shells/shell-dmd-verNix.nix shell.nix - ln -sf nixEnv/dub/mkDub-dmd.nix mkDub.nix -#+BEGIN_SRC nix :tangle ../nixEnv/shells/shell-dmd-verNix.nix +#+BEGIN_SRC nix :tangle ../nixEnv/shells/shell-dmd-verNix.nix :tangle-mode (identity #o755) :shebang "#!/usr/bin/env -S nix-shell" { pkgs ? import {} }: <> #+END_SRC @@ -1829,7 +1836,7 @@ fi - ln -sf nixEnv/shells/shell-dmd-verUser.nix shell.nix - ln -sf nixEnv/dub/mkDub-dmd.nix mkDub.nix -#+BEGIN_SRC nix :tangle ../nixEnv/shells/shell-dmd-verUser.nix +#+BEGIN_SRC nix :tangle ../nixEnv/shells/shell-dmd-verUser.nix :tangle-mode (identity #o755) :shebang "#!/usr/bin/env -S nix-shell" <> <> #+END_SRC @@ -1846,7 +1853,7 @@ fi - ln -sf nixEnv/shells/shell-ldc-verNix.nix shell.nix - ln -sf nixEnv/dub/mkDub-ldc.nix mkDub.nix -#+BEGIN_SRC nix :tangle ../nixEnv/shells/shell-ldc-verNix.nix +#+BEGIN_SRC nix :tangle ../nixEnv/shells/shell-ldc-verNix.nix :tangle-mode (identity #o755) :shebang "#!/usr/bin/env -S nix-shell" { pkgs ? import {} }: <> #+END_SRC @@ -1856,7 +1863,7 @@ fi - ln -sf nixEnv/shells/shell-ldc-verUser.nix shell.nix - ln -sf nixEnv/dub/mkDub-ldc.nix mkDub.nix -#+BEGIN_SRC nix :tangle ../nixEnv/shells/shell-ldc-verUser.nix +#+BEGIN_SRC nix :tangle ../nixEnv/shells/shell-ldc-verUser.nix :tangle-mode (identity #o755) :shebang "#!/usr/bin/env -S nix-shell" <> <> #+END_SRC @@ -1875,8 +1882,14 @@ fi #+NAME: nix_shell_mkshell_with_buildInputs_ldc #+BEGIN_SRC nix pkgs.mkShell { - buildInputs = with pkgs; - [ (import ./packages-ldc.nix { inherit pkgs; }) ]; + buildInputs = with pkgs; [ + (import ./packages-ldc.nix { inherit pkgs; }) + ]; + shellHook = '' + # nix-build + ## nix-build -I nixpkgs= + ## nix-build -I nixpkgs=/nixpkgs-ra/nixpkgs + ''; } #+END_SRC @@ -1994,7 +2007,12 @@ in pkgs.mkShell { ** default.nix :default: -#+BEGIN_SRC txt :tangle ../default.nix +- default.nix -I nixpkgs= + e.g. default.nix -I nixpkgs=/nixpkgs-ra/nixpkgs +- nix-build -I nixpkgs= + e.g. nix-build -I nixpkgs=/nixpkgs-ra/nixpkgs + +#+BEGIN_SRC txt :tangle ../default.nix :tangle-mode (identity #o755) :shebang "#!/usr/bin/env -S nix-build" <> #+END_SRC @@ -2012,7 +2030,9 @@ mkDubDerivation rec { name = "spine-${version}"; version = "<>"; src = ./.; - buildInputs = [ pkgs.sqlite ]; + buildInputs = [ + pkgs.sqlite + ]; meta = with stdenv.lib; { homepage = http://sisudoc.org; description = "a sisu like document parser"; @@ -2456,7 +2476,7 @@ babel tangle) org files in ./org/ to create .d source files in ./src/doc_reform/ (similar functionality is contained within the "makefile" created by this "dr_build_scaffold.org" file make tangle) -#+BEGIN_SRC sh :tangle ../tangle :tangle-mode (identity #o755) :shebang #!/bin/sh +#+BEGIN_SRC sh :tangle ../tangle :tangle-mode (identity #o755) :shebang "#!/bin/sh" # -*- mode: shell-script -*- # tangle files with org-mode DIR=`pwd` diff --git a/project.nix b/project.nix index ebadd91..9b335e3 100644 --- a/project.nix +++ b/project.nix @@ -6,7 +6,9 @@ mkDubDerivation rec { name = "spine-${version}"; version = "0.11.1"; src = ./.; - buildInputs = [ pkgs.sqlite ]; + buildInputs = [ + pkgs.sqlite + ]; meta = with stdenv.lib; { homepage = http://sisudoc.org; description = "a sisu like document parser"; -- cgit v1.2.3