forked from mirrors/nixpkgs
Merge pull request #146815 from ElvishJerricco/systemd-utils-expressions
Move systemd-lib.nix and systemd-unit-options.nix into utils
This commit is contained in:
commit
eee45bb295
|
@ -1,7 +1,7 @@
|
||||||
{ config, lib }:
|
{ lib, systemdUtils }:
|
||||||
|
|
||||||
|
with systemdUtils.lib;
|
||||||
with lib;
|
with lib;
|
||||||
with import ./systemd-lib.nix { inherit config lib pkgs; };
|
|
||||||
|
|
||||||
let
|
let
|
||||||
checkService = checkUnitConfig "Service" [
|
checkService = checkUnitConfig "Service" [
|
|
@ -1,4 +1,4 @@
|
||||||
pkgs: with pkgs.lib;
|
{ lib, config, pkgs }: with lib;
|
||||||
|
|
||||||
rec {
|
rec {
|
||||||
|
|
||||||
|
@ -165,4 +165,9 @@ rec {
|
||||||
${builtins.toJSON set}
|
${builtins.toJSON set}
|
||||||
EOF
|
EOF
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
systemdUtils = {
|
||||||
|
lib = import ./systemd-lib.nix { inherit lib config pkgs; };
|
||||||
|
unitOptions = import ./systemd-unit-options.nix { inherit lib systemdUtils; };
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{ pkgs, ... }:
|
{ lib, config, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
_module.args = {
|
_module.args = {
|
||||||
utils = import ../../lib/utils.nix pkgs;
|
utils = import ../../lib/utils.nix { inherit lib config pkgs; };
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, utils, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
toplevelConfig = config;
|
toplevelConfig = config;
|
||||||
inherit (lib) types;
|
inherit (lib) types;
|
||||||
inherit (import ../system/boot/systemd-lib.nix {
|
inherit (utils.systemdUtils.lib) mkPathSafeName;
|
||||||
inherit config pkgs lib;
|
|
||||||
}) mkPathSafeName;
|
|
||||||
in {
|
in {
|
||||||
options.systemd.services = lib.mkOption {
|
options.systemd.services = lib.mkOption {
|
||||||
type = types.attrsOf (types.submodule ({ name, config, ... }: {
|
type = types.attrsOf (types.submodule ({ name, config, ... }: {
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, utils, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
# Type for a valid systemd unit option. Needed for correctly passing "timerConfig" to "systemd.timers"
|
# Type for a valid systemd unit option. Needed for correctly passing "timerConfig" to "systemd.timers"
|
||||||
unitOption = (import ../../system/boot/systemd-unit-options.nix { inherit config lib; }).unitOption;
|
inherit (utils.systemdUtils.unitOptions) unitOption;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.services.restic.backups = mkOption {
|
options.services.restic.backups = mkOption {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, utils, ... }:
|
||||||
|
|
||||||
|
with utils.systemdUtils.unitOptions;
|
||||||
|
with utils.systemdUtils.lib;
|
||||||
with lib;
|
with lib;
|
||||||
with import ./systemd-unit-options.nix { inherit config lib; };
|
|
||||||
with import ./systemd-lib.nix { inherit config lib pkgs; };
|
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
{ config, lib , pkgs, ...}:
|
{ config, lib, pkgs, utils, ...}:
|
||||||
|
|
||||||
|
with utils.systemdUtils.unitOptions;
|
||||||
|
with utils.systemdUtils.lib;
|
||||||
with lib;
|
with lib;
|
||||||
with import ./systemd-unit-options.nix { inherit config lib; };
|
|
||||||
with import ./systemd-lib.nix { inherit config lib pkgs; };
|
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.systemd.nspawn;
|
cfg = config.systemd.nspawn;
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
{ config, lib, pkgs, utils, ... }:
|
{ config, lib, pkgs, utils, ... }:
|
||||||
|
|
||||||
with utils;
|
with utils;
|
||||||
|
with systemdUtils.unitOptions;
|
||||||
|
with systemdUtils.lib;
|
||||||
with lib;
|
with lib;
|
||||||
with import ./systemd-unit-options.nix { inherit config lib; };
|
|
||||||
with import ./systemd-lib.nix { inherit config lib pkgs; };
|
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue