nixos-config/modules/common/default.nix

51 lines
1 KiB
Nix

{
lib,
config,
pkgs,
modulesPath,
...
}:
with lib;
{
imports = [
./boot.nix
./linux.nix
./nix.nix
./network.nix
./hardware.nix
./users.nix
(modulesPath + "/installer/scan/not-detected.nix")
];
options.isProfessional = mkOption {
type = types.bool;
default = false;
example = true;
description = ''
Whether or not this machine is used for professionnal purposes.
'';
};
options.enableDocker = mkOption {
type = types.bool;
default = false;
example = true;
description = ''
Whether or not to enable the docker stack.
'';
};
config = {
virtualisation.docker.enable = config.enableDocker;
# Only enable fish shell if there is at least one user using it.
programs.fish.enable = builtins.any (user: user.shell == pkgs.fish) (
builtins.attrValues config.machineUsers
);
# We always want to disable the X server as only workstation use windows manager
# and they always use wayland.
services.xserver.enable = false;
};
}