-
-
Save cleverca22/401691d963095103ebb67931aea23755 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, lib, pkgs, ... }: | |
with lib; | |
let | |
cfg = config.app1; | |
in { | |
options = { | |
app1.foo = mkOption { | |
description = "option foo"; | |
type = types.string; | |
}; | |
}; | |
config = { | |
system.build.app1 = pkgs.writeScriptBin "app1" '' | |
#!/usr/bin/env bash | |
export PATH=${config.system.build.app1_internal.env}/bin/ | |
hello | |
''; | |
system.build.app1_internal.env = pkgs.buildEnv { | |
name = "app1-env"; | |
paths = with pkgs; [ hello ]; | |
}; | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ lib, ... }: | |
with lib; | |
{ | |
options = { | |
system.build = mkOption { | |
internal = true; | |
default = {}; | |
description = "Attribute set of derivations used to setup the system."; | |
}; | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ ... }: | |
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let | |
pkgs = import <nixpkgs> {}; | |
pkgsModule = rec { | |
_file = ./default.nix; | |
key = _file; | |
config = { | |
nixpkgs.system = pkgs.lib.mkDefault builtins.currentSystem; | |
}; | |
}; | |
eval = pkgs.lib.evalModules { | |
prefix = []; | |
check = true; | |
modules = [ | |
./app1.nix ./config.nix ./common.nix | |
<nixpkgs/nixos/modules/misc/nixpkgs.nix> | |
pkgsModule | |
]; | |
args = {}; | |
}; | |
in eval |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment