callPackages and readme
This commit is contained in:
5
README.md
Normal file
5
README.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# NixOS Tutorial
|
||||||
|
This is a working repo for learning how to develop in NixOS and configure systems.
|
||||||
|
|
||||||
|
## Material
|
||||||
|
I'm currently following the tutorials at [Nix.dev](https://nix.dev/tutorials/)
|
||||||
7
callPackage/default.nix
Normal file
7
callPackage/default.nix
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
let
|
||||||
|
pkgs = import <nixpkgs> { };
|
||||||
|
in
|
||||||
|
rec{
|
||||||
|
hello = pkgs.callPackage ./hello.nix { audience = "people"; };
|
||||||
|
hello-folks = hello.override { audience = "folks"; };
|
||||||
|
}
|
||||||
7
callPackage/hello.nix
Normal file
7
callPackage/hello.nix
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
writeShellScriptBin,
|
||||||
|
audience ? "world",
|
||||||
|
}:
|
||||||
|
writeShellScriptBin "hello" ''
|
||||||
|
echo "Hello, ${audience}!"
|
||||||
|
''
|
||||||
Reference in New Issue
Block a user