ma x.r: split hardware config
This commit is contained in:
parent
5184fcda25
commit
54cd4c84e5
@ -4,7 +4,30 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
{
|
{
|
||||||
imports =
|
imports =
|
||||||
[ # base
|
[
|
||||||
|
# hardware-dependent
|
||||||
|
# device
|
||||||
|
|
||||||
|
|
||||||
|
./x13
|
||||||
|
# ./x230
|
||||||
|
|
||||||
|
# Common Hardware Components
|
||||||
|
|
||||||
|
# <stockholm/makefu/2configs/hw/mceusb.nix>
|
||||||
|
# <stockholm/makefu/2configs/hw/rtl8812au.nix>
|
||||||
|
<stockholm/makefu/2configs/hw/network-manager.nix>
|
||||||
|
# <stockholm/makefu/2configs/hw/stk1160.nix>
|
||||||
|
# <stockholm/makefu/2configs/hw/irtoy.nix>
|
||||||
|
# <stockholm/makefu/2configs/hw/malduino_elite.nix>
|
||||||
|
<stockholm/makefu/2configs/hw/switch.nix>
|
||||||
|
# <stockholm/makefu/2configs/hw/rad1o.nix>
|
||||||
|
<stockholm/makefu/2configs/hw/cc2531.nix>
|
||||||
|
<stockholm/makefu/2configs/hw/droidcam.nix>
|
||||||
|
<stockholm/makefu/2configs/hw/smartcard.nix>
|
||||||
|
<stockholm/makefu/2configs/hw/upower.nix>
|
||||||
|
|
||||||
|
# base
|
||||||
<stockholm/makefu>
|
<stockholm/makefu>
|
||||||
<stockholm/makefu/2configs/nur.nix>
|
<stockholm/makefu/2configs/nur.nix>
|
||||||
<stockholm/makefu/2configs/home-manager>
|
<stockholm/makefu/2configs/home-manager>
|
||||||
@ -107,7 +130,7 @@
|
|||||||
# Virtualization
|
# Virtualization
|
||||||
# <stockholm/makefu/2configs/virtualisation/libvirt.nix>
|
# <stockholm/makefu/2configs/virtualisation/libvirt.nix>
|
||||||
<stockholm/makefu/2configs/virtualisation/docker.nix>
|
<stockholm/makefu/2configs/virtualisation/docker.nix>
|
||||||
<stockholm/makefu/2configs/virtualisation/virtualbox.nix>
|
# <stockholm/makefu/2configs/virtualisation/virtualbox.nix>
|
||||||
#{
|
#{
|
||||||
# networking.firewall.allowedTCPPorts = [ 8080 ];
|
# networking.firewall.allowedTCPPorts = [ 8080 ];
|
||||||
# networking.nat = {
|
# networking.nat = {
|
||||||
@ -128,24 +151,7 @@
|
|||||||
<stockholm/makefu/2configs/binary-cache/gum.nix>
|
<stockholm/makefu/2configs/binary-cache/gum.nix>
|
||||||
<stockholm/makefu/2configs/binary-cache/lass.nix>
|
<stockholm/makefu/2configs/binary-cache/lass.nix>
|
||||||
|
|
||||||
# Hardware
|
|
||||||
<stockholm/makefu/2configs/hw/tp-x230.nix> # + bluetooth
|
|
||||||
# <stockholm/makefu/2configs/hw/mceusb.nix>
|
|
||||||
<stockholm/makefu/2configs/hw/tpm.nix>
|
|
||||||
# <stockholm/makefu/2configs/hw/rtl8812au.nix>
|
|
||||||
<stockholm/makefu/2configs/hw/network-manager.nix>
|
|
||||||
# <stockholm/makefu/2configs/hw/stk1160.nix>
|
|
||||||
# <stockholm/makefu/2configs/hw/irtoy.nix>
|
|
||||||
# <stockholm/makefu/2configs/hw/malduino_elite.nix>
|
|
||||||
<stockholm/makefu/2configs/hw/switch.nix>
|
|
||||||
# <stockholm/makefu/2configs/hw/rad1o.nix>
|
|
||||||
<stockholm/makefu/2configs/hw/cc2531.nix>
|
|
||||||
<stockholm/makefu/2configs/hw/droidcam.nix>
|
|
||||||
<stockholm/makefu/2configs/hw/smartcard.nix>
|
|
||||||
<stockholm/makefu/2configs/hw/upower.nix>
|
|
||||||
|
|
||||||
# Filesystem
|
|
||||||
<stockholm/makefu/2configs/fs/sda-crypto-root-home.nix>
|
|
||||||
|
|
||||||
# Security
|
# Security
|
||||||
# <stockholm/makefu/2configs/sshd-totp.nix>
|
# <stockholm/makefu/2configs/sshd-totp.nix>
|
||||||
@ -182,7 +188,6 @@
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
makefu.server.primary-itf = "wlp3s0";
|
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
nixpkgs.config.oraclejdk.accept_license = true;
|
nixpkgs.config.oraclejdk.accept_license = true;
|
||||||
@ -198,12 +203,6 @@
|
|||||||
|
|
||||||
krebs.tinc.retiolum.connectTo = [ "omo" "prism" "nextgum" "wbob" ];
|
krebs.tinc.retiolum.connectTo = [ "omo" "prism" "nextgum" "wbob" ];
|
||||||
|
|
||||||
# hard dependency because otherwise the device will not be unlocked
|
|
||||||
boot.initrd.luks.devices.luksroot =
|
|
||||||
{
|
|
||||||
device = "/dev/sda2";
|
|
||||||
allowDiscards = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.systemPackages = [ pkgs.passwdqc-utils ];
|
environment.systemPackages = [ pkgs.passwdqc-utils ];
|
||||||
|
|
||||||
|
52
makefu/1systems/x/x13/default.nix
Normal file
52
makefu/1systems/x/x13/default.nix
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
{ pkgs, lib, ... }:
|
||||||
|
# new zfs deployment
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./zfs.nix
|
||||||
|
./input.nix
|
||||||
|
<stockholm/makefu/2configs/hw/bluetooth.nix>
|
||||||
|
<nixos-hardware/lenovo/thinkpad/l14/amd> # close enough
|
||||||
|
# <stockholm/makefu/2configs/hw/tpm.nix>
|
||||||
|
<stockholm/makefu/2configs/hw/ssd.nix>
|
||||||
|
];
|
||||||
|
boot.zfs.requestEncryptionCredentials = true;
|
||||||
|
networking.hostId = "f8b8e0a2";
|
||||||
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|
||||||
|
# services.xserver.enable = lib.mkForce false;
|
||||||
|
|
||||||
|
services.xserver.videoDrivers = [
|
||||||
|
"amdgpu"
|
||||||
|
];
|
||||||
|
hardware.opengl.extraPackages = [ pkgs.amdvlk ];
|
||||||
|
# is required for amd graphics support ( xorg wont boot otherwise )
|
||||||
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||||
|
environment.variables.VK_ICD_FILENAMES =
|
||||||
|
"/run/opengl-driver/share/vulkan/icd.d/amd_icd64.json";
|
||||||
|
|
||||||
|
|
||||||
|
programs.light.enable = true;
|
||||||
|
services.actkbd = {
|
||||||
|
enable = true;
|
||||||
|
bindings = [
|
||||||
|
{ keys = [ 225 ]; events = [ "key" ]; command = "${pkgs.light}/bin/light -A 10"; }
|
||||||
|
{ keys = [ 224 ]; events = [ "key" ]; command = "${pkgs.light}/bin/light -U 10"; }
|
||||||
|
{ keys = [ 227 ]; events = [ "key" ]; command = builtins.toString (
|
||||||
|
pkgs.writers.writeDash "toggle_lcdshadow" ''
|
||||||
|
proc=/proc/acpi/ibm/lcdshadow
|
||||||
|
status=$(${pkgs.gawk}/bin/awk '/status:/{print $2}' "$proc")
|
||||||
|
if [ "$status" -eq 0 ];then
|
||||||
|
echo 1 > "$proc"
|
||||||
|
else
|
||||||
|
echo 0 > "$proc"
|
||||||
|
fi
|
||||||
|
'');
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
users.groups.video = {};
|
||||||
|
users.users.makefu.extraGroups = [ "video" ];
|
||||||
|
}
|
||||||
|
|
13
makefu/1systems/x/x13/input.nix
Normal file
13
makefu/1systems/x/x13/input.nix
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
# current issues:
|
||||||
|
# 1. for pressing insert hold shift+fn+Fin
|
||||||
|
|
||||||
|
# scroll by holding middle mouse
|
||||||
|
services.xserver.displayManager.sessionCommands =''
|
||||||
|
xinput set-int-prop "ETPS/2 Elantech TrackPoint" "Evdev Wheel Emulation" 8 1
|
||||||
|
xinput set-int-prop "ETPS/2 Elantech TrackPoint" "Evdev Wheel Emulation Button" 8 2
|
||||||
|
xinput set-prop "ETPS/2 Elantech TrackPoint" "Evdev Wheel Emulation Axes" 6 7 4 5
|
||||||
|
# configure timeout of pressing and holding middle button
|
||||||
|
# xinput set-int-prop "ETPS/2 Elantech TrackPoint" "Evdev Wheel Emulation Timeout" 8 200
|
||||||
|
'';
|
||||||
|
}
|
8
makefu/1systems/x/x13/toggle_brightness
Normal file
8
makefu/1systems/x/x13/toggle_brightness
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
proc=/proc/acpi/ibm/lcdshadow
|
||||||
|
status=$(awk '/status:/{print $2}' "$proc")
|
||||||
|
if [ "$status" -eq 0 ];then
|
||||||
|
echo 1 > "$proc"
|
||||||
|
else
|
||||||
|
echo 0 > "$proc"
|
||||||
|
fi
|
32
makefu/1systems/x/x13/zfs.nix
Normal file
32
makefu/1systems/x/x13/zfs.nix
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
|
# and may be overwritten by future invocations. Please make changes
|
||||||
|
# to /etc/nixos/configuration.nix instead.
|
||||||
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules = [ "nvme" "ehci_pci" "xhci_pci" "rtsx_pci_sdmmc" ];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ "kvm-amd" ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
fileSystems."/" =
|
||||||
|
{ device = "zroot/root/nixos";
|
||||||
|
fsType = "zfs";
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/boot" =
|
||||||
|
{ device = "/dev/disk/by-uuid/20BF-2755";
|
||||||
|
fsType = "vfat";
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/home" =
|
||||||
|
{ device = "zroot/root/home";
|
||||||
|
fsType = "zfs";
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices = [ ];
|
||||||
|
}
|
19
makefu/1systems/x/x230/default.nix
Normal file
19
makefu/1systems/x/x230/default.nix
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
imports = [
|
||||||
|
<stockholm/makefu/2configs/hw/tp-x230.nix> # + bluetooth
|
||||||
|
<stockholm/makefu/2configs/fs/sda-crypto-root-home.nix>
|
||||||
|
|
||||||
|
<stockholm/makefu/2configs/hw/tpm.nix>
|
||||||
|
<stockholm/makefu/2configs/hw/ssd.nix>
|
||||||
|
|
||||||
|
# hard dependency because otherwise the device will not be unlocked
|
||||||
|
{
|
||||||
|
boot.initrd.luks.devices.luksroot =
|
||||||
|
{
|
||||||
|
device = "/dev/sda2";
|
||||||
|
allowDiscards = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{ makefu.server.primary-itf = "wlp3s0"; }
|
||||||
|
];
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user