Don't use with.
Using with is an antipattern: https://nix.dev/anti-patterns/language.html#with-attrset-expression
This commit is contained in:
parent
400c2dac1c
commit
d7147baefc
2 changed files with 12 additions and 13 deletions
12
ginsim.nix
12
ginsim.nix
|
@ -86,14 +86,12 @@ stdenv.mkDerivation rec {
|
|||
--set _JAVA_AWT_WM_NONREPARENTING 1
|
||||
'';
|
||||
|
||||
# Some easy metadata, in case I forget. I use the with statement to
|
||||
# avoid typing stdenv.lib to specify the license, the platform and
|
||||
# the maintainer.
|
||||
meta = with stdenv.lib; {
|
||||
# Some easy metadata, in case I forget.
|
||||
meta = {
|
||||
homepage = "http://ginsim.org/";
|
||||
description = "A computer tool for the modeling and simulation of genetic regulatory networks.";
|
||||
license = licenses.gpl3;
|
||||
platforms = platforms.unix;
|
||||
maintainers = [ maintainers.scolobb ];
|
||||
license = stdenv.lib.licenses.gpl3;
|
||||
platforms = stdenv.lib.platforms.unix;
|
||||
maintainers = [ stdenv.lib.maintainers.scolobb ];
|
||||
};
|
||||
}
|
||||
|
|
13
shell.nix
13
shell.nix
|
@ -19,11 +19,12 @@
|
|||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
# The with statement imports the nixpkgs namespace, so the tools like
|
||||
# stdenv and callPackage become available.
|
||||
with import <nixpkgs> {};
|
||||
stdenv.mkDerivation {
|
||||
# Import nixpkgs under the local binding pkgs to be able to use stdenv
|
||||
# and callPackage.
|
||||
let
|
||||
pkgs = import <nixpkgs> {};
|
||||
in
|
||||
pkgs.stdenv.mkDerivation {
|
||||
name = "GINsim-shell";
|
||||
|
||||
# Bring the package defined in ginsim.nix in scope. buildInputs is
|
||||
|
@ -35,5 +36,5 @@ stdenv.mkDerivation {
|
|||
# callPackage can also be replaced by import. In this case, the
|
||||
# arguments of the anonymous function defined in ginsim.nix get
|
||||
# their respective default values.
|
||||
buildInputs = [ (callPackage ./ginsim.nix {}) ];
|
||||
buildInputs = [ (pkgs.callPackage ./ginsim.nix {}) ];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue