0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 13:40:28 +03:00

treewide/nixos: remove with lib; part 2 (#335618)

This commit is contained in:
Philip Taron 2024-08-30 15:56:57 -07:00 committed by GitHub
commit 9916dc8728
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
143 changed files with 2196 additions and 2601 deletions

View file

@ -1,7 +1,4 @@
{ config, pkgs, lib, ... }:
with lib;
let
boolToStr = value: if value then "on" else "off";
cfg = config.vmware;
@ -17,35 +14,35 @@ let
in {
options = {
vmware = {
baseImageSize = mkOption {
type = with types; either (enum [ "auto" ]) int;
baseImageSize = lib.mkOption {
type = with lib.types; either (enum [ "auto" ]) int;
default = "auto";
example = 2048;
description = ''
The size of the VMWare base image in MiB.
'';
};
vmDerivationName = mkOption {
type = types.str;
vmDerivationName = lib.mkOption {
type = lib.types.str;
default = "nixos-vmware-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}";
description = ''
The name of the derivation for the VMWare appliance.
'';
};
vmFileName = mkOption {
type = types.str;
vmFileName = lib.mkOption {
type = lib.types.str;
default = "nixos-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}.vmdk";
description = ''
The file name of the VMWare appliance.
'';
};
vmSubformat = mkOption {
type = types.enum subformats;
vmSubformat = lib.mkOption {
type = lib.types.enum subformats;
default = "monolithicSparse";
description = "Specifies which VMDK subformat to use.";
};
vmCompat6 = mkOption {
type = types.bool;
vmCompat6 = lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
description = "Create a VMDK version 6 image (instead of version 4).";

View file

@ -1,14 +1,13 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.xe-guest-utilities;
in {
options = {
services.xe-guest-utilities = {
enable = mkEnableOption "the Xen guest utilities daemon";
enable = lib.mkEnableOption "the Xen guest utilities daemon";
};
};
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
services.udev.packages = [ pkgs.xe-guest-utilities ];
systemd.tmpfiles.rules = [ "d /run/xenstored 0755 - - -" ];