Skip to content

Instantly share code, notes, and snippets.

@eyJhb
Last active November 6, 2020 11:20
Show Gist options
  • Save eyJhb/9caf7ac4af6dbb3c070e49d56d613393 to your computer and use it in GitHub Desktop.
Save eyJhb/9caf7ac4af6dbb3c070e49d56d613393 to your computer and use it in GitHub Desktop.
{ pkgs ? import <nixpkgs> {} }:
let
mypkg = pkgs.callPackage ./pkg.nix {};
in mypkg.overrideAttrs(oldAttrs: rec {
config = "NEW config";
})
{ pkgs ? import <nixpkgs> {} }:
let
config = "thisismyconfig";
in pkgs.stdenv.mkDerivation {
name = "test";
phases = "buildPhase";
config = config;
buildPhase = ''
echo ${config} > $out
'';
}
{ pkgs ? import <nixpkgs> {} }:
let
mypkg = pkgs.callPackage ./test2-pkg.nix {};
in pkgs.callPackage mypkg.build { config = "lal"; }
{ pkgs ? import <nixpkgs> {} }:
let
config = "thisismyconfig";
build = cfg: pkgs.stdenv.mkDerivation {
name = "test";
phases = "buildPhase";
buildPhase = ''
echo ${cfg.config} > $out
'';
};
in {
"config" = config;
"build" = pkgs.callPackage build { "config" = config; };
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment