feat(hosts): add PineTab2 config

This commit is contained in:
2026-03-26 22:30:44 +01:00
parent 673b32c33b
commit 808e2ce408
24 changed files with 359 additions and 141 deletions

View File

@@ -1,68 +1,15 @@
{
lib,
config,
...
}:
with lib; let
cfg = config.mySystem.misc;
in {
imports = [
./boot
./desktop
./dev
./hardware
./i18n
./misc.nix
./network
./packages
./security
./services
./users
];
options.mySystem.misc = {
timezone = mkOption {
type = types.str;
default = "Europe/Paris";
};
keymap = mkOption {
type = types.str;
default = "fr";
example = "fr-bepo";
description = "Keymap to use in the TTY console";
};
};
config = {
boot.tmp.cleanOnBoot = true;
console.keyMap = cfg.keymap;
time.timeZone = cfg.timezone;
environment.pathsToLink = [
"/share/bash-completion"
"/share/zsh"
];
services = {
orca.enable = false;
envfs.enable = true;
};
nix.settings = {
substituters = [
"http://marpa:5000?priority=5"
"https://phundrak.cachix.org?priority=10"
"https://nix-community.cachix.org?priority=20"
"https://cache.nixos.org?priority=40"
];
trusted-public-keys = [
"marpa-local:XoO+dFN4PeauF52pYuy3Vh4Sdtl2qIdxu5aUasWKv6Q="
"phundrak.cachix.org-1:osJAkYO0ioTOPqaQCIXMfIRz1/+YYlVFkup3R2KSexk="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
];
http-connections = 128;
experimental-features = [
"nix-command"
"flakes"
];
};
};
}

View File

@@ -3,8 +3,9 @@
./amdgpu.nix
./bluetooth.nix
./fingerprint.nix
./sound.nix
./input
./pinetab2.nix
./sound.nix
];
hardware.enableAllFirmware = lib.mkDefault true;

View File

@@ -0,0 +1,18 @@
{
lib,
config,
...
}:
with lib; let
cfg = config.mySystem.hardware.pinetab2;
in {
options.mySystem.hardware.pinetab2.enable = mkEnableOption "Activate support for the PineTab2";
config = {
boot.kernelParams = ["console=tty0" "console=ttyS2,1500000n8" "rootwait" "root=LABEL=NIXOS_SD" "rw"];
hardware.sensor.iio.enable = true;
services.avahi = {
enable = true;
openFirewall = true;
};
};
}

View File

@@ -32,13 +32,16 @@ in {
config = {
environment.systemPackages = mkIf cfg.scarlett.enable [pkgs.alsa-scarlett-gui];
services.pipewire = mkIf cfg.enable {
enable = true;
alsa = mkIf cfg.alsa {
enable = mkDefault true;
support32Bit = mkDefault true;
services = {
pipewire = mkIf cfg.enable {
enable = true;
alsa = mkIf cfg.alsa {
enable = mkDefault true;
support32Bit = mkDefault true;
};
jack.enable = mkDefault cfg.jack;
};
jack.enable = mkDefault cfg.jack;
pulseaudio.enable = false;
};
programs.noisetorch = mkIf cfg.enable {
inherit (cfg) enable;

55
system/misc.nix Normal file
View File

@@ -0,0 +1,55 @@
{
lib,
config,
...
}:
with lib; let
cfg = config.mySystem.misc;
in {
options.mySystem.misc = {
timezone = mkOption {
type = types.str;
default = "Europe/Paris";
};
keymap = mkOption {
type = types.str;
default = "fr";
example = "fr-bepo";
description = "Keymap to use in the TTY console";
};
};
config = {
boot.tmp.cleanOnBoot = true;
console.keyMap = cfg.keymap;
time.timeZone = cfg.timezone;
environment.pathsToLink = [
"/share/bash-completion"
"/share/zsh"
];
services = {
orca.enable = false;
envfs.enable = true;
};
nix.settings = {
substituters = [
"http://marpa:5000?priority=5"
"https://phundrak.cachix.org?priority=10"
"https://nix-community.cachix.org?priority=20"
"https://cache.nixos.org?priority=40"
];
trusted-public-keys = [
"marpa-local:XoO+dFN4PeauF52pYuy3Vh4Sdtl2qIdxu5aUasWKv6Q="
"phundrak.cachix.org-1:osJAkYO0ioTOPqaQCIXMfIRz1/+YYlVFkup3R2KSexk="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
];
http-connections = 128;
experimental-features = [
"nix-command"
"flakes"
];
};
};
}

View File

@@ -51,12 +51,20 @@ in {
default = null;
};
};
wifi.disablePowersave = mkEnableOption ''
Disables powersave for Wifi.
Used mainly for the PineTab2, as leaving WiFi powersave with the bes2600 can cause stability issues.
'';
};
config.networking = {
hostName = cfg.hostname; # Define your hostname.
hostId = cfg.id;
networkmanager.enable = true;
networkmanager = {
enable = true;
wifi.powersave = ! cfg.wifi.disablePowersave;
};
inherit (cfg) hostFiles domain;
firewall = {
enable = true;

View File

@@ -27,7 +27,7 @@ in {
trusted-users = mkOption {
type = types.listOf types.str;
example = ["alice" "bob"];
default = [];
default = ["@wheel" "root"];
};
};

View File

@@ -2,4 +2,5 @@
imports = [
./sops.nix
];
security.rtkit.enable = true;
}