NIX-LIB
a reusable nix library for jtrrll's repositories
README
nix-lib
A reusable Nix library for jtrrll's repositories.
Usage
This is a plain Nix library, not a flake. Add it as a flake = false
input:
{
inputs = {
nix-lib = {
flake = false;
url = "github:jtrrll/nix-lib";
};
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = inputs: {
...
};
}Then import it with a nixpkgs lib. It returns an attribute set of
lib, modules, and separate library and package overlays:
inputs:
let
nix-lib = import inputs.nix-lib { lib = inputs.nixpkgs.lib; };
inherit (nix-lib)
lib
modules
overlays
;
in
{
# Apply the package overlay to access the new packages and extended lib.
nixpkgs' = import inputs.nixpkgs {
inherit system;
overlays = [ overlays.pkgs ];
};
# Access reusable modules, grouped by class.
# Each class exposes its individual modules and a `default` that imports all of them.
myNixosConfiguration = inputs.nixpkgs.lib.nixosSystem {
inherit lib; # Use the extended library during NixOS module evaluation.
modules = [
modules.nixos.default
{
nixpkgs.overlays = [ overlays.pkgs ];
}
{
...
}
];
};
# Use the extended lib directly.
transformedString = lib.strings.snakeToCamel "foo_bar";
}Outputs
modules
Show 5
-
devenvdefaultrespect-shell
-
flakedefaultflake-metadatagithub-binary-cache-actionshome-configuration-build-checksnixos-configuration-build-checksnixos-configuration-test-checkspackage-build-checkspackage-metadata-checkspackage-passthru-tests-checkspackages-by-name
-
homeManagerdefaultmetasnekcheck
-
nixosdefaultmetaopencodetests
-
treefmtdefaultnix
overlays
Show 2
-
libmaintainersmodulesstrings
-
pkgsbaseos- Bootable BaseOS image for the Anbernic rgspcleanyourtv-shell- Shell with ADB, Python, JDK 17 and the Android SDK for following cleanyourtv's PROMPT.mdgrout- RomM client for Linux retro handheldsnextui-h700- NextUI frontend card contents for Anbernic H700 handheldsrompatcher-js- Browser and CLI ROM patching toolslk- A blazingly fast Slack TUIsnekcheck- An opinionated filename linter that loves snake caseterminal-browser- Real browser that runs inside your terminal
License
This repository is licensed under the terms in LICENSE.
That license covers the repository's own code (the library, overlays,
and module definitions). It does not inherently apply to the
packages built by this repository. Some of them package third-party
software with its own licensing. Consult each package's individual
license before use or redistribution.