hosts: move to new structure
Signed-off-by: unexplrd <unexplrd@linerds.us>
This commit is contained in:
13
hosts/eldrid/hardware/default.nix
Normal file
13
hosts/eldrid/hardware/default.nix
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
imports = [
|
||||
./facter.nix
|
||||
./laptop
|
||||
./vaapi/intel-media-driver.nix
|
||||
];
|
||||
services = {
|
||||
logind = {
|
||||
lidSwitch = "ignore";
|
||||
powerKey = "suspend";
|
||||
};
|
||||
};
|
||||
}
|
14
hosts/eldrid/hardware/facter.nix
Normal file
14
hosts/eldrid/hardware/facter.nix
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
config,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
inherit (inputs) mysecrets;
|
||||
inherit (config.networking) hostName;
|
||||
in {
|
||||
imports = with inputs; [
|
||||
nixos-facter-modules.nixosModules.facter
|
||||
];
|
||||
facter.reportPath = "${mysecrets}/facter/${hostName}.json";
|
||||
systemd.network.wait-online.enable = false;
|
||||
}
|
46
hosts/eldrid/hardware/laptop/cb-audio-fix.nix
Normal file
46
hosts/eldrid/hardware/laptop/cb-audio-fix.nix
Normal file
@ -0,0 +1,46 @@
|
||||
{pkgs, ...}: let
|
||||
cb-ucm-conf = pkgs.alsa-ucm-conf.overrideAttrs {
|
||||
wttsrc = pkgs.fetchFromGitHub {
|
||||
owner = "WeirdTreeThing";
|
||||
repo = "chromebook-ucm-conf";
|
||||
rev = "b6ce2a7";
|
||||
hash = "sha256-QRUKHd3RQmg1tnZU8KCW0AmDtfw/daOJ/H3XU5qWTCc=";
|
||||
};
|
||||
postInstall = ''
|
||||
cp -R $wttsrc/common/* $out/share/alsa/ucm2/common
|
||||
cp -R $wttsrc/codecs/* $out/share/alsa/ucm2/codecs
|
||||
cp -R $wttsrc/platforms/* $out/share/alsa/ucm2/platforms
|
||||
cp -R $wttsrc/sof-rt5682 $out/share/alsa/ucm2/conf.d
|
||||
cp -R $wttsrc/sof-cs42l42 $out/share/alsa/ucm2/conf.d
|
||||
'';
|
||||
};
|
||||
in {
|
||||
system.replaceDependencies.replacements = [
|
||||
{
|
||||
original = pkgs.alsa-ucm-conf;
|
||||
replacement = cb-ucm-conf;
|
||||
}
|
||||
];
|
||||
|
||||
services.pipewire.wireplumber.configPackages = [
|
||||
(pkgs.writeTextDir "share/wireplumber/main.lua.d/51-increase-headroom.lua" ''
|
||||
rule = {
|
||||
matches = {
|
||||
{
|
||||
{ "node.name", "matches", "alsa_output.*" },
|
||||
},
|
||||
},
|
||||
apply_properties = {
|
||||
["api.alsa.headroom"] = 4096,
|
||||
},
|
||||
}
|
||||
|
||||
table.insert(alsa_monitor.rules,rule)
|
||||
'')
|
||||
];
|
||||
boot = {
|
||||
extraModprobeConfig = ''
|
||||
options snd-intel-dspcfg dsp_driver=3
|
||||
'';
|
||||
};
|
||||
}
|
94
hosts/eldrid/hardware/laptop/cb-keyboard.nix
Normal file
94
hosts/eldrid/hardware/laptop/cb-keyboard.nix
Normal file
@ -0,0 +1,94 @@
|
||||
{
|
||||
services.keyd = {
|
||||
enable = true;
|
||||
keyboards.internal = {
|
||||
ids = [
|
||||
"k:0001:0001"
|
||||
"k:18d1:5044"
|
||||
"k:18d1:5052"
|
||||
"k:0000:0000"
|
||||
"k:18d1:5050"
|
||||
"k:18d1:504c"
|
||||
"k:18d1:503c"
|
||||
"k:18d1:5030"
|
||||
"k:18d1:503d"
|
||||
"k:18d1:505b"
|
||||
"k:18d1:5057"
|
||||
"k:18d1:502b"
|
||||
"k:18d1:5061"
|
||||
];
|
||||
settings = {
|
||||
main = {
|
||||
f1 = "back";
|
||||
f2 = "forward";
|
||||
f3 = "refresh";
|
||||
f4 = "f11";
|
||||
f5 = "scale";
|
||||
f6 = "brightnessdown";
|
||||
f7 = "brightnessup";
|
||||
f8 = "mute";
|
||||
f9 = "volumedown";
|
||||
f10 = "volumeup";
|
||||
f13 = "printscreen";
|
||||
back = "back";
|
||||
forward = "forward";
|
||||
refresh = "refresh";
|
||||
zoom = "f11";
|
||||
scale = "scale";
|
||||
brightnessdown = "brightnessdown";
|
||||
brightnessup = "brightnessup";
|
||||
mute = "mute";
|
||||
volumedown = "volumedown";
|
||||
volumeup = "volumeup";
|
||||
sleep = "coffee";
|
||||
a = "lettermod(alt, a, 200, 150)";
|
||||
s = "lettermod(meta, s, 200, 150)";
|
||||
d = "lettermod(control, d, 200, 150)";
|
||||
f = "lettermod(shift, f, 200, 150)";
|
||||
j = "lettermod(shift, j, 200, 150)";
|
||||
k = "lettermod(control, k, 200, 150)";
|
||||
l = "lettermod(meta, l, 200, 150)";
|
||||
";" = "lettermod(alt, ;, 200, 150)";
|
||||
};
|
||||
meta = {
|
||||
f1 = "f1";
|
||||
f2 = "f2";
|
||||
f3 = "f3";
|
||||
f4 = "f4";
|
||||
f5 = "f5";
|
||||
f6 = "f6";
|
||||
f7 = "f7";
|
||||
f8 = "f8";
|
||||
f9 = "f9";
|
||||
f10 = "f10";
|
||||
back = "f1";
|
||||
forward = "f2";
|
||||
refresh = "f3";
|
||||
zoom = "f4";
|
||||
scale = "f5";
|
||||
brightnessdown = "f6";
|
||||
brightnessup = "f7";
|
||||
mute = "f8";
|
||||
volumedown = "f9";
|
||||
volumeup = "f10";
|
||||
sleep = "f12";
|
||||
};
|
||||
alt = {
|
||||
backspace = "delete";
|
||||
meta = "capslock";
|
||||
brightnessdown = "kbdillumdown";
|
||||
brightnessup = "kbdillumup";
|
||||
f6 = "kbdillumdown";
|
||||
f7 = "kbdillumup";
|
||||
};
|
||||
control = {
|
||||
f5 = "print";
|
||||
scale = "print";
|
||||
};
|
||||
controlalt = {
|
||||
backspace = "C-A-delete";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
9
hosts/eldrid/hardware/laptop/default.nix
Normal file
9
hosts/eldrid/hardware/laptop/default.nix
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
imports = [
|
||||
./cb-audio-fix.nix
|
||||
./cb-keyboard.nix
|
||||
./home-row-mods.nix
|
||||
./power-saving.nix
|
||||
./touchscreen-fix.nix
|
||||
];
|
||||
}
|
20
hosts/eldrid/hardware/laptop/home-row-mods.nix
Normal file
20
hosts/eldrid/hardware/laptop/home-row-mods.nix
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
services.keyd = {
|
||||
enable = true;
|
||||
keyboards = {
|
||||
default = {
|
||||
ids = ["0001:0001"];
|
||||
settings.main = {
|
||||
a = "lettermod(alt, a, 200, 150)";
|
||||
s = "lettermod(meta, s, 200, 150)";
|
||||
d = "lettermod(control, d, 200, 150)";
|
||||
f = "lettermod(shift, f, 200, 150)";
|
||||
j = "lettermod(shift, j, 200, 150)";
|
||||
k = "lettermod(control, k, 200, 150)";
|
||||
l = "lettermod(meta, l, 200, 150)";
|
||||
";" = "lettermod(alt, ;, 200, 150)";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
7
hosts/eldrid/hardware/laptop/power-saving.nix
Normal file
7
hosts/eldrid/hardware/laptop/power-saving.nix
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
powerManagement.enable = true;
|
||||
powerManagement.powertop.enable = true;
|
||||
services.power-profiles-daemon.enable = true;
|
||||
services.thermald.enable = true;
|
||||
services.upower.enable = true;
|
||||
}
|
3
hosts/eldrid/hardware/laptop/touchscreen-fix.nix
Normal file
3
hosts/eldrid/hardware/laptop/touchscreen-fix.nix
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
services.udev.extraRules = "ACTION==\"add|change\", KERNELS==\"input[0-9]*\", SUBSYSTEMS==\"input\", ATTRS{id/vendor}==\"27c6\", ATTRS{id/product}==\"0e84\", ENV{LIBINPUT_IGNORE_DEVICE}=\"1\"";
|
||||
}
|
7
hosts/eldrid/hardware/vaapi/intel-media-driver.nix
Normal file
7
hosts/eldrid/hardware/vaapi/intel-media-driver.nix
Normal file
@ -0,0 +1,7 @@
|
||||
{pkgs, ...}: {
|
||||
hardware.graphics.extraPackages = with pkgs; [
|
||||
intel-compute-runtime
|
||||
intel-media-driver
|
||||
vpl-gpu-rt
|
||||
];
|
||||
}
|
Reference in New Issue
Block a user