mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-30 22:57:55 +00:00
lib/nixos: update to include config
This commit is contained in:
parent
b84d07ac0c
commit
c08289419c
@ -1,5 +1,5 @@
|
||||
# All of the functions suitable only for NixOS.
|
||||
{ pkgs, lib }:
|
||||
{ pkgs, config, lib }:
|
||||
|
||||
rec {
|
||||
# This is only used for home-manager users without a NixOS user counterpart.
|
||||
@ -30,4 +30,14 @@ rec {
|
||||
settings
|
||||
];
|
||||
});
|
||||
|
||||
# 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 =
|
||||
pkgs.lib.hasAttrByPath [ "formatAttr" ] config;
|
||||
|
||||
# Checks if the NixOS config is being built for a particular format.
|
||||
isFormat = format:
|
||||
hasNixosFormat && config.formatAttr == format;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
# All of the extra module arguments to be passed as part of the holistic NixOS
|
||||
# system.
|
||||
{ options, lib, pkgs, ... }:
|
||||
{ config, options, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
foodogsquaredLib = import ../../../lib { inherit pkgs; };
|
||||
@ -8,7 +8,7 @@ in
|
||||
{
|
||||
_module.args.foodogsquaredLib =
|
||||
foodogsquaredLib.extend (final: prev:
|
||||
import ../../../lib/nixos.nix { inherit pkgs; lib = prev; }
|
||||
import ../../../lib/nixos.nix { inherit pkgs config; lib = prev; }
|
||||
// lib.optionalAttrs (options?sops) {
|
||||
sops-nix = import ../../../lib/sops.nix { inherit pkgs; lib = prev; };
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user