nixos-config/lib/env-specific/nixos.nix

15 lines
456 B
Nix
Raw Normal View History

# All of the functions suitable only for NixOS.
{ pkgs, lib, self }:
{
2024-02-28 10:44:27 +00:00
# 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;
2024-02-28 10:44:27 +00:00
# Checks if the NixOS config is being built for a particular format.
isFormat = config: format:
(config.formatAttr or "") == format;
}