diff options
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/lib/utils.nix | 5 | ||||
-rw-r--r-- | nixos/modules/module-list.nix | 1 | ||||
-rw-r--r-- | nixos/modules/services/hardware/vdr.nix | 71 | ||||
-rw-r--r-- | nixos/modules/services/network-filesystems/ipfs.nix | 2 | ||||
-rw-r--r-- | nixos/modules/services/x11/display-managers/default.nix | 7 | ||||
-rw-r--r-- | nixos/release-combined.nix | 10 |
6 files changed, 86 insertions, 10 deletions
diff --git a/nixos/lib/utils.nix b/nixos/lib/utils.nix index 1ef915d40612..b68e55a40b90 100644 --- a/nixos/lib/utils.nix +++ b/nixos/lib/utils.nix @@ -7,9 +7,8 @@ rec { || elem fs.mountPoint [ "/" "/nix" "/nix/store" "/var" "/var/log" "/var/lib" "/etc" ]; # Check whenever `b` depends on `a` as a fileSystem - # FIXME: it's incorrect to simply use hasPrefix here: "/dev/a" is not a parent of "/dev/ab" - fsBefore = a: b: ((any (x: elem x [ "bind" "move" ]) b.options) && (a.mountPoint == b.device)) - || (hasPrefix a.mountPoint b.mountPoint); + fsBefore = a: b: a.mountPoint == b.device + || hasPrefix "${a.mountPoint}${optionalString (!(hasSuffix "/" a.mountPoint)) "/"}" b.mountPoint; # Escape a path according to the systemd rules, e.g. /dev/xyzzy # becomes dev-xyzzy. FIXME: slow. diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index e342c08f1bed..4a392b6f5c9c 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -304,6 +304,7 @@ ./services/hardware/usbmuxd.nix ./services/hardware/thermald.nix ./services/hardware/undervolt.nix + ./services/hardware/vdr.nix ./services/logging/SystemdJournal2Gelf.nix ./services/logging/awstats.nix ./services/logging/fluentd.nix diff --git a/nixos/modules/services/hardware/vdr.nix b/nixos/modules/services/hardware/vdr.nix new file mode 100644 index 000000000000..75136a2f7964 --- /dev/null +++ b/nixos/modules/services/hardware/vdr.nix @@ -0,0 +1,71 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.services.vdr; + libDir = "/var/lib/vdr"; +in { + + ###### interface + + options = { + + services.vdr = { + enable = mkEnableOption "enable VDR. Please put config into ${libDir}."; + + package = mkOption { + type = types.package; + default = pkgs.vdr; + defaultText = "pkgs.vdr"; + example = literalExample "pkgs.wrapVdr.override { plugins = with pkgs.vdrPlugins; [ hello ]; }"; + description = "Package to use."; + }; + + videoDir = mkOption { + type = types.path; + default = "/srv/vdr/video"; + description = "Recording directory"; + }; + + extraArguments = mkOption { + type = types.listOf types.str; + default = []; + description = "Additional command line arguments to pass to VDR."; + }; + }; + }; + + ###### implementation + + config = mkIf cfg.enable { + systemd.tmpfiles.rules = [ + "d ${cfg.videoDir} 0755 vdr vdr -" + "Z ${cfg.videoDir} - vdr vdr -" + ]; + + systemd.services.vdr = { + description = "VDR"; + wantedBy = [ "multi-user.target" ]; + serviceConfig = { + ExecStart = '' + ${cfg.package}/bin/vdr \ + --video="${cfg.videoDir}" \ + --config="${libDir}" \ + ${escapeShellArgs cfg.extraArguments} + ''; + User = "vdr"; + CacheDirectory = "vdr"; + StateDirectory = "vdr"; + Restart = "on-failure"; + }; + }; + + users.users.vdr = { + group = "vdr"; + home = libDir; + }; + + users.groups.vdr = {}; + }; +} diff --git a/nixos/modules/services/network-filesystems/ipfs.nix b/nixos/modules/services/network-filesystems/ipfs.nix index 412d57b27b82..602cd50d8f55 100644 --- a/nixos/modules/services/network-filesystems/ipfs.nix +++ b/nixos/modules/services/network-filesystems/ipfs.nix @@ -74,7 +74,7 @@ in { services.ipfs = { - enable = mkEnableOption "Interplanetary File System"; + enable = mkEnableOption "Interplanetary File System (WARNING: may cause severe network degredation)"; user = mkOption { type = types.str; diff --git a/nixos/modules/services/x11/display-managers/default.nix b/nixos/modules/services/x11/display-managers/default.nix index 035029150c81..047321bd9495 100644 --- a/nixos/modules/services/x11/display-managers/default.nix +++ b/nixos/modules/services/x11/display-managers/default.nix @@ -194,9 +194,12 @@ let ${xorg.lndir}/bin/lndir ${pkg}/share/xsessions $out/share/xsessions '') cfg.displayManager.extraSessionFilePackages} - mkdir -p "$out/share/wayland-sessions" + ${concatMapStrings (pkg: '' - ${xorg.lndir}/bin/lndir ${pkg}/share/wayland-sessions $out/share/wayland-sessions + if test -d ${pkg}/share/wayland-sessions; then + mkdir -p "$out/share/wayland-sessions" + ${xorg.lndir}/bin/lndir ${pkg}/share/wayland-sessions $out/share/wayland-sessions + fi '') cfg.displayManager.extraSessionFilePackages} ''; diff --git a/nixos/release-combined.nix b/nixos/release-combined.nix index 429afe2b145e..ea8b92e94f01 100644 --- a/nixos/release-combined.nix +++ b/nixos/release-combined.nix @@ -4,8 +4,8 @@ { nixpkgs ? { outPath = (import ../lib).cleanSource ./..; revCount = 56789; shortRev = "gfedcba"; } , stableBranch ? false -, supportedSystems ? [ "x86_64-linux" "aarch64-linux" ] -, limitedSupportedSystems ? [ "i686-linux" ] +, supportedSystems ? [ "x86_64-linux" ] +, limitedSupportedSystems ? [ "i686-linux" "aarch64-linux" ] }: let @@ -54,10 +54,12 @@ in rec { (all nixos.dummy) (all nixos.manual) - nixos.iso_minimal.x86_64-linux or [] - nixos.iso_minimal.i686-linux or [] nixos.iso_graphical.x86_64-linux or [] + nixos.iso_minimal.aarch64-linux or [] + nixos.iso_minimal.i686-linux or [] + nixos.iso_minimal.x86_64-linux or [] nixos.ova.x86_64-linux or [] + nixos.sd_image.aarch64-linux or [] #(all nixos.tests.containers) (all nixos.tests.containers-imperative) |