nixos-config/modules/base/default.nix

89 lines
2 KiB
Nix
Raw Normal View History

{ pkgs
, config
, lib
, ...
2022-03-01 22:19:03 +01:00
}:
with lib; let
cfg = config.eboskma.base;
qmkUdevRules = builtins.readFile ./qmk.rules;
2022-03-15 08:30:37 +01:00
probersRules = pkgs.callPackage ./probe-rs {
inherit (pkgs.stdenv) mkDerivation;
inherit lib;
};
2022-05-31 11:37:51 +02:00
blink1Rules = pkgs.callPackage ./blink1-udev {
inherit (pkgs.stdenv) mkDerivation;
inherit lib;
};
2022-06-29 08:30:48 +02:00
picotoolRules = pkgs.callPackage ./picotool {
inherit (pkgs.stdenv) mkDerivation;
inherit lib;
};
solo2Rules = pkgs.callPackage ./solo2 {
inherit (pkgs.stdenv) mkDerivation;
inherit lib;
};
in
{
2021-11-17 16:32:18 +01:00
options.eboskma.base = {
kernel = mkOption {
description = "which kernel to run";
type = types.unspecified;
2022-05-04 10:46:29 +02:00
default = pkgs.linuxPackages;
2021-11-17 16:32:18 +01:00
};
plymouth = {
enable = mkEnableOption "plymouth splash screen";
2021-11-17 16:32:18 +01:00
};
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";
};
2021-11-17 16:32:18 +01:00
};
config = {
boot.kernelPackages = cfg.kernel;
2022-05-03 18:17:38 +02:00
boot.plymouth = mkIf cfg.plymouth.enable {
2021-11-17 16:32:18 +01:00
enable = true;
2022-07-25 08:32:30 +02:00
theme = "breeze";
2021-11-17 16:32:18 +01:00
};
2021-11-18 15:02:12 +01:00
hardware.opengl.enable = true;
2021-11-21 19:07:12 +01:00
programs.fish.enable = true;
environment.systemPackages = with pkgs; [
2022-03-01 08:10:57 +01:00
clinfo
2021-12-06 09:58:39 +01:00
dig
dogdns
file
2022-07-19 07:10:16 +02:00
hexyl
2021-12-06 09:58:39 +01:00
ht-rust
2022-02-09 08:13:16 +01:00
jq
lm_sensors
nix-template
2022-01-09 14:13:08 +01:00
nvd
2022-02-09 08:13:16 +01:00
usbutils
2022-03-18 21:14:51 +01:00
zip
];
2021-12-18 16:23:14 +01:00
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 ]);
2021-12-18 16:23:14 +01:00
};
2021-11-17 16:32:18 +01:00
};
}