feat: nixos module is configurable now

This commit is contained in:
2025-07-06 22:53:09 +02:00
parent 2574ef4ac0
commit 16901b14c8
5 changed files with 106 additions and 2 deletions

View File

@@ -1,4 +1,13 @@
{ config, pkgs, lib, ...}: pkgs.stdenv.mkDerivation rec {
{ config, pkgs, lib, ...}:
let
cfg-file = if config.cfg != null then
import ./get-cfg-file.nix {
inherit lib;
inherit (config) cfg src;
}
else null;
in
pkgs.stdenv.mkDerivation rec {
pname = "lidm";
version = config.version;
src = config.src;
@@ -16,7 +25,9 @@
++ lib.optional (config.xsessions != null)
"CPPFLAGS+=-DSESSIONS_XSESSIONS=\\\"${config.xsessions}\\\""
++ lib.optional (config.wayland-sessions != null)
"CPPFLAGS+=-DSESSIONS_WAYLAND=\\\"${config.wayland-sessions}\\\"";
"CPPFLAGS+=-DSESSIONS_WAYLAND=\\\"${config.wayland-sessions}\\\""
++ lib.optional (cfg-file != null)
"CPPFLAGS+=-DLIDM_CONF_PATH=\\\"${cfg-file}\\\"";
fixupPhase = ''
rm -rf $out/etc