Lib
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
# Add this flake as an input.
plusultra.url = "path:/home/short/work/config";
};
outputs = { nixpkgs, plusultra, ... }: {
# Use plusultra.lib
};
}
Type
false
Documentation
Quickly disable an option.
services.nginx = enabled;
Type
true
Documentation
Quickly enable an option.
services.nginx = enabled;
Type
Path -> String -> String
Documentation
Append text to the contents of a file
fileWithText ./some.txt "appended text"
Type
Path -> String -> String
Documentation
Prepend text to the contents of a file
fileWithText' ./some.txt "prepended text"
Type
Type -> Any -> String
Documentation
Create a NixOS module option.
lib.mkOpt nixpkgs.lib.types.str "My default" "Description of my option."
Type
Type -> Any -> String
Documentation
Create a NixOS module option without a description.
lib.mkOpt' nixpkgs.lib.types.str "My default"
Type
Type -> Any -> String
Documentation
Create a boolean NixOS module option.
lib.mkBoolOpt true "Description of my option."
Type
Type -> Any -> String
Documentation
Create a boolean NixOS module option without a description.
lib.mkBoolOpt true
Type
{ port: Int ? null, host: String ? "127.0.0.1", proxy-web-sockets: Bool ? false, extra-config: Attrs ? { } } -> Attrs
Documentation
Create proxy configuration for NGINX virtual hosts.
services.nginx.virtualHosts."example.com" = lib.network.create-proxy {
port = 3000;
host = "0.0.0.0";
proxy-web-sockets = true;
extra-config = {
forceSSL = true;
};
}
``
Split an address to get its host name or ip and its port. Type: String -> Attrs Usage: get-address-parts "bismuth:3000" result: { host = "bismuth"; port = "3000"; }
Type
{ name: String, description: String } -> { matches: List, apply_properties: Attrs }
Documentation
Renames an alsa device from a given name
using the new description
.
Type
{ name: String, factory: String ? "adapter", ... } -> { factory: String, args: Attrs }
Documentation
Create a pipewire audio node.
Type
{ name: String, ... } -> { factory: "adapter", args: Attrs }
Documentation
Create a virtual pipewire audio node.
Type
{ name: String?, from: String, to: String, ... } -> { name: "libpipewire-module-loopback", args: Attrs }
Documentation
Connect two pipewire audio nodes
Type
Attrs -> Package -> Package
Documentation
Override a package’s metadata
let
new-meta = {
description = "My new description";
};
in
lib.override-meta new-meta pkgs.hello
Type
{ self: Flake, overrides: Attrs ? {} } -> Attrs
Documentation
Create deployment configuration for use with deploy-rs.
mkDeploy {
inherit self;
overrides = {
my-host.system.sudo = "doas -u";
};
}