modules/systemd-extras: init
This commit is contained in:
parent
a79b829da5
commit
5e755ea855
4 changed files with 24 additions and 4 deletions
|
@ -8,10 +8,6 @@ with lib;
|
|||
{
|
||||
options.systemd.services = mkOption {
|
||||
type = with types; attrsOf (submodule ({ config, ... }: {
|
||||
options.strictMounts = mkOption {
|
||||
type = with types; listOf path;
|
||||
default = [];
|
||||
};
|
||||
config = mkIf (config.strictMounts != []) (let
|
||||
findFilesystemsFor = mount: pipe cfg.fileSystems [
|
||||
(filterAttrs (_: fs: hasPrefix "${fs.mountpoint}/" "${mount}/"))
|
||||
|
|
|
@ -29,6 +29,7 @@ in
|
|||
ssh = ./ssh;
|
||||
system-info = ./system-info;
|
||||
system-recovery = ./system-recovery;
|
||||
systemd-extras = ./systemd-extras;
|
||||
tested = ./tested;
|
||||
|
||||
machineBase = group [
|
||||
|
@ -38,6 +39,7 @@ in
|
|||
minimal
|
||||
port-magic
|
||||
ssh
|
||||
systemd-extras
|
||||
];
|
||||
|
||||
serverBase = group [
|
||||
|
|
5
modules/systemd-extras/default.nix
Normal file
5
modules/systemd-extras/default.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
imports = [
|
||||
./strict-mounts.nix
|
||||
];
|
||||
}
|
17
modules/systemd-extras/strict-mounts.nix
Normal file
17
modules/systemd-extras/strict-mounts.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{ lib, ... }:
|
||||
|
||||
with lib;
|
||||
{
|
||||
options.systemd.services = mkOption {
|
||||
type = with types; attrsOf (submodule ({ config, ... }: {
|
||||
options.strictMounts = mkOption {
|
||||
description = "Mount points which this service strictly depends on. What that means is up to other modules.";
|
||||
type = with types; listOf path;
|
||||
default = [];
|
||||
};
|
||||
config = mkIf (config.strictMounts != []) {
|
||||
unitConfig.RequiresMountsFor = config.strictMounts;
|
||||
};
|
||||
}));
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue