mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 04:58:01 +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.
|
# All of the functions suitable only for NixOS.
|
||||||
{ pkgs, lib }:
|
{ pkgs, config, lib }:
|
||||||
|
|
||||||
rec {
|
rec {
|
||||||
# This is only used for home-manager users without a NixOS user counterpart.
|
# This is only used for home-manager users without a NixOS user counterpart.
|
||||||
@ -30,4 +30,14 @@ rec {
|
|||||||
settings
|
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
|
# All of the extra module arguments to be passed as part of the holistic NixOS
|
||||||
# system.
|
# system.
|
||||||
{ options, lib, pkgs, ... }:
|
{ config, options, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
foodogsquaredLib = import ../../../lib { inherit pkgs; };
|
foodogsquaredLib = import ../../../lib { inherit pkgs; };
|
||||||
@ -8,7 +8,7 @@ in
|
|||||||
{
|
{
|
||||||
_module.args.foodogsquaredLib =
|
_module.args.foodogsquaredLib =
|
||||||
foodogsquaredLib.extend (final: prev:
|
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) {
|
// lib.optionalAttrs (options?sops) {
|
||||||
sops-nix = import ../../../lib/sops.nix { inherit pkgs; lib = prev; };
|
sops-nix = import ../../../lib/sops.nix { inherit pkgs; lib = prev; };
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user