Unverified Commit a338deb8 authored by cinereal's avatar cinereal
Browse files

lib/services: move portable service infrastructure out of nixos/

Move the portable modular service base from
nixos/modules/system/service/portable/ to lib/services/, making it
importable by any module system (home-manager, nix-darwin) without
reaching into the nixos/ tree.

Moved files: service.nix, lib.nix, config-data.nix, config-data-item.nix,
test.nix. All external references updated (systemd/system.nix,
doc/manual/default.nix, assertions.nix, README.md).

No functional changes - only import paths differ.
parent f5c9fba9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
# Tests in: ../../../../tests/modular-service-etc/test.nix
# Tests in: ../../nixos/tests/modular-service-etc/test.nix
# This file is a function that returns a module.
pkgs:
{
+1 −1
Original line number Diff line number Diff line
# Tests in: ../../../../tests/modular-service-etc/test.nix
# Tests in: ../../nixos/tests/modular-service-etc/test.nix

# Non-modular context provided by the modular services integration.
{ pkgs }:
+2 −2
Original line number Diff line number Diff line
@@ -16,8 +16,8 @@ in
  # https://nixos.org/manual/nixos/unstable/#modular-services
  _class = "service";
  imports = [
    ../../../../../modules/generic/meta-maintainers.nix
    ../../../misc/assertions.nix
    ../../modules/generic/meta-maintainers.nix
    ../../nixos/modules/misc/assertions.nix
    (lib.modules.importApply ./config-data.nix { inherit pkgs; })
  ];
  options = {
+2 −2
Original line number Diff line number Diff line
# Run:
#   nix-instantiate --eval nixos/modules/system/service/portable/test.nix
#   nix-instantiate --eval lib/services/test.nix
let
  lib = import ../../../../../lib;
  lib = import ../.;

  inherit (lib) mkOption types;

Loading