nixos-config/lib/nixos.nix
Gabriel Arazas ba6b30ca95
lib: standardize arguments (again)
We'll just copy what we did with Bahaghari project.
2024-03-03 16:39:32 +08:00

15 lines
456 B
Nix

# All of the functions suitable only for NixOS.
{ pkgs, lib, self }:
{
# Checks if the NixOS configuration is part of the nixos-generator build.
# Typically, we just check if there's a certain attribute that is imported
# from it.
hasNixosFormat = config:
lib.hasAttrByPath [ "formatAttr" ] config;
# Checks if the NixOS config is being built for a particular format.
isFormat = config: format:
(config.formatAttr or "") == format;
}