nixos-config/modules/base/default.nix

88 lines
2 KiB
Nix

{ pkgs
, config
, lib
, ...
}:
with lib; let
cfg = config.eboskma.base;
qmkUdevRules = builtins.readFile ./qmk.rules;
probersRules = pkgs.callPackage ./probe-rs {
inherit (pkgs.stdenv) mkDerivation;
inherit lib;
};
blink1Rules = pkgs.callPackage ./blink1-udev {
inherit (pkgs.stdenv) mkDerivation;
inherit lib;
};
picotoolRules = pkgs.callPackage ./picotool {
inherit (pkgs.stdenv) mkDerivation;
inherit lib;
};
solo2Rules = pkgs.callPackage ./solo2 {
inherit (pkgs.stdenv) mkDerivation;
inherit lib;
};
in
{
options.eboskma.base = {
kernel = mkOption {
description = "which kernel to run";
type = types.unspecified;
default = pkgs.linuxPackages;
};
plymouth = {
enable = mkEnableOption "plymouth splash screen";
};
work = mkOption {
description = "whether this is a work machine.";
type = types.bool;
default = false;
};
udev-rules = {
qmk = mkEnableOption "qmk udev rules"; # No-op for now
probe-rs = mkEnableOption "probe.rs udev rules";
blink1 = mkEnableOption "blink(1) udev rules";
picotool = mkEnableOption "picotool udev rules";
solo2 = mkEnableOption "solo2 udev rules";
};
};
config = {
boot.kernelPackages = cfg.kernel;
boot.plymouth = mkIf cfg.plymouth.enable {
enable = true;
theme = "breeze";
};
hardware.opengl.enable = true;
programs.fish.enable = true;
environment.systemPackages = with pkgs; [
clinfo
dig
dogdns
file
hexyl
ht-rust
jq
lm_sensors
nix-template
nvd
usbutils
zip
];
services.udev = {
extraRules = qmkUdevRules;
packages = [] ++ (optional cfg.udev-rules.probe-rs [ probersRules ])
++ (optional cfg.udev-rules.blink1 [ blink1Rules ])
++ (optional cfg.udev-rules.picotool [ picotoolRules ])
++ (optional cfg.udev-rules.solo2 [ solo2Rules ]);
};
};
}