callPackages and readme

This commit is contained in:
2026-02-24 16:10:01 -05:00
parent 75504d20cd
commit cc6f1dda06
3 changed files with 19 additions and 0 deletions

5
README.md Normal file
View 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
View 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
View File

@@ -0,0 +1,7 @@
{
writeShellScriptBin,
audience ? "world",
}:
writeShellScriptBin "hello" ''
echo "Hello, ${audience}!"
''