mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 10:58:02 +00:00
15 lines
456 B
Nix
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;
|
|
}
|