Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/udev: add enable option #197870

Merged
merged 1 commit into from
Oct 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions nixos/modules/services/hardware/udev.nix
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ in
###### interface

options = {

boot.hardwareScan = mkOption {
type = types.bool;
default = true;
Expand All @@ -205,6 +204,9 @@ in
};

services.udev = {
enable = mkEnableOption (lib.mdDoc "udev") // {
default = true;
};

packages = mkOption {
type = types.listOf types.path;
Expand Down Expand Up @@ -345,7 +347,7 @@ in

###### implementation

config = mkIf (!config.boot.isContainer) {
config = mkIf cfg.enable {

services.udev.extraRules = nixosRules;

Expand Down
3 changes: 3 additions & 0 deletions nixos/modules/virtualisation/container-config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ with lib;
# Containers should be light-weight, so start sshd on demand.
services.openssh.startWhenNeeded = mkDefault true;

# containers do not need to setup devices
services.udev.enable = false;

# Shut up warnings about not having a boot loader.
system.build.installBootLoader = lib.mkDefault "${pkgs.coreutils}/bin/true";

Expand Down