2024-01-22 22:50:51 +01:00
|
|
|
{
|
2024-02-08 20:53:22 +01:00
|
|
|
repoFlake,
|
|
|
|
nodeFlake,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
nodeName,
|
|
|
|
system,
|
2024-08-04 09:31:50 +02:00
|
|
|
packages',
|
2024-02-08 20:53:22 +01:00
|
|
|
...
|
2024-11-15 10:17:56 +01:00
|
|
|
}:
|
|
|
|
{
|
|
|
|
nixpkgs.overlays = [ nodeFlake.overlays.default ];
|
2024-06-13 16:42:55 +02:00
|
|
|
|
2024-01-24 00:24:04 +00:00
|
|
|
nixos-x13s = {
|
|
|
|
enable = true;
|
|
|
|
# TODO: use hardware address
|
|
|
|
bluetoothMac = "65:9e:7a:8b:86:28";
|
2024-03-07 22:01:03 +01:00
|
|
|
kernel = "jhovold";
|
2024-01-24 00:24:04 +00:00
|
|
|
};
|
|
|
|
|
2024-02-07 11:15:16 +01:00
|
|
|
services.illum.enable = true;
|
|
|
|
|
2024-10-13 20:18:35 +02:00
|
|
|
# printint and autodiscovery of printers
|
|
|
|
services.printing.enable = true;
|
2024-11-15 10:17:56 +01:00
|
|
|
services.printing.drivers = [ pkgs.hplip ];
|
2024-10-13 20:18:35 +02:00
|
|
|
services.avahi = {
|
|
|
|
enable = true;
|
|
|
|
nssmdns4 = true;
|
|
|
|
openFirewall = true;
|
|
|
|
};
|
2024-10-14 17:44:31 +02:00
|
|
|
hardware.sane.enable = true; # enables support for SANE scanners
|
2024-10-13 20:18:35 +02:00
|
|
|
|
2024-07-26 14:09:34 +02:00
|
|
|
systemd.services.bluetooth-x13s-mac = lib.mkForce {
|
2024-01-24 00:24:04 +00:00
|
|
|
enable = true;
|
|
|
|
path = [
|
|
|
|
pkgs.systemd
|
|
|
|
pkgs.util-linux
|
|
|
|
pkgs.bluez5-experimental
|
|
|
|
pkgs.expect
|
|
|
|
];
|
|
|
|
script = ''
|
|
|
|
# TODO: this may not be required
|
|
|
|
while ! (journalctl -b0 | grep 'Bluetooth: hci0: QCA setup on UART is completed'); do
|
|
|
|
echo Waiting for bluetooth firmware to complete
|
|
|
|
echo sleep 1
|
|
|
|
done
|
|
|
|
|
|
|
|
(
|
|
|
|
# best effort
|
|
|
|
set +e
|
|
|
|
rfkill block bluetooth
|
|
|
|
echo $?
|
|
|
|
btmgmt public-addr ${config.nixos-x13s.bluetoothMac}
|
|
|
|
echo $?
|
|
|
|
rfkill unblock bluetooth
|
|
|
|
echo $?
|
|
|
|
)
|
|
|
|
'';
|
2024-11-15 10:17:56 +01:00
|
|
|
requiredBy = [ "bluetooth.service" ];
|
|
|
|
before = [ "bluetooth.service" ];
|
2024-01-24 00:24:04 +00:00
|
|
|
serviceConfig = {
|
|
|
|
Type = "oneshot";
|
|
|
|
RemainAfterExit = true;
|
|
|
|
|
|
|
|
# we need a tty, otherwise btmgmt will hang
|
|
|
|
StandardInput = "tty";
|
|
|
|
TTYPath = "/dev/tty2";
|
|
|
|
TTYReset = "yes";
|
|
|
|
TTYVHangup = "yes";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-01-22 22:50:51 +01:00
|
|
|
imports = [
|
2024-01-24 00:24:04 +00:00
|
|
|
nodeFlake.inputs.nixos-x13s.nixosModules.default
|
|
|
|
|
2024-01-22 23:05:23 +01:00
|
|
|
repoFlake.inputs.sops-nix.nixosModules.sops
|
2024-01-22 22:50:51 +01:00
|
|
|
nodeFlake.inputs.disko.nixosModules.disko
|
|
|
|
./disko.nix
|
|
|
|
|
2024-10-08 23:46:08 +02:00
|
|
|
../../profiles/common/user.nix
|
|
|
|
|
2024-01-24 00:24:04 +00:00
|
|
|
../../snippets/nix-settings.nix
|
2024-03-07 22:01:03 +01:00
|
|
|
../../snippets/nix-settings-holo-chain.nix
|
2024-05-25 11:35:26 +02:00
|
|
|
../../snippets/mycelium.nix
|
2024-11-24 16:09:58 +01:00
|
|
|
|
|
|
|
# ../../snippets/obs-studio.nix
|
2024-01-22 22:50:51 +01:00
|
|
|
|
|
|
|
{
|
|
|
|
services.openssh.enable = true;
|
|
|
|
services.openssh.settings.PermitRootLogin = "yes";
|
|
|
|
services.openssh.openFirewall = true;
|
|
|
|
|
2024-01-24 00:24:04 +00:00
|
|
|
sops.defaultSopsFile = ../../../../secrets/${nodeName}/secrets.yaml;
|
|
|
|
sops.defaultSopsFormat = "yaml";
|
2024-01-22 22:50:51 +01:00
|
|
|
|
2024-01-22 22:45:42 +00:00
|
|
|
users.commonUsers = {
|
|
|
|
enable = true;
|
|
|
|
enableNonRoot = true;
|
|
|
|
};
|
2024-05-02 09:45:30 +02:00
|
|
|
|
2024-11-15 10:17:56 +01:00
|
|
|
sops.secrets.builder-private-key = { };
|
2024-05-02 09:45:30 +02:00
|
|
|
nix.distributedBuilds = true;
|
|
|
|
nix.buildMachines = [
|
2024-10-13 20:18:56 +02:00
|
|
|
# test these with: sudo nix store ping --store 'ssh-ng://nix-remote-builder@<fqdn>?ssh-key=/run/secrets/builder-private-key'
|
2024-05-02 09:45:30 +02:00
|
|
|
{
|
2024-10-13 20:18:56 +02:00
|
|
|
hostName = "buildbot-nix-0.infra.holochain.org";
|
2024-05-02 09:45:30 +02:00
|
|
|
sshUser = "nix-remote-builder";
|
|
|
|
sshKey = config.sops.secrets.builder-private-key.path;
|
|
|
|
protocol = "ssh-ng";
|
2024-11-15 10:17:56 +01:00
|
|
|
systems = [ "x86_64-linux" ];
|
2024-05-02 09:45:30 +02:00
|
|
|
supportedFeatures = [
|
|
|
|
"big-parallel"
|
|
|
|
"kvm"
|
2024-11-02 22:48:20 +01:00
|
|
|
"nixos-test"
|
2024-05-02 09:45:30 +02:00
|
|
|
];
|
2024-10-13 20:18:56 +02:00
|
|
|
maxJobs = 16;
|
2024-07-26 14:31:25 +02:00
|
|
|
}
|
|
|
|
|
2024-11-02 22:48:20 +01:00
|
|
|
{
|
|
|
|
hostName = "aarch64-linux-builder-0.infra.holochain.org";
|
|
|
|
sshUser = "nix-remote-builder";
|
|
|
|
sshKey = config.sops.secrets.builder-private-key.path;
|
|
|
|
protocol = "ssh-ng";
|
2024-11-15 10:17:56 +01:00
|
|
|
systems = [ "aarch64-linux" ];
|
2024-11-02 22:48:20 +01:00
|
|
|
supportedFeatures = [
|
|
|
|
"big-parallel"
|
|
|
|
"kvm"
|
|
|
|
"nixos-test"
|
|
|
|
];
|
2024-11-23 14:43:21 +01:00
|
|
|
maxJobs = 8;
|
2024-11-02 22:48:20 +01:00
|
|
|
}
|
|
|
|
|
2024-07-26 14:31:25 +02:00
|
|
|
{
|
|
|
|
hostName = "x64-linux-dev-01.dev.infra.holochain.org";
|
|
|
|
sshUser = "nix-remote-builder";
|
|
|
|
sshKey = config.sops.secrets.builder-private-key.path;
|
|
|
|
protocol = "ssh-ng";
|
|
|
|
systems = [
|
2024-11-02 22:48:20 +01:00
|
|
|
# "x86_64-linux"
|
|
|
|
"aarch64-linux"
|
2024-07-26 14:31:25 +02:00
|
|
|
];
|
|
|
|
supportedFeatures = [
|
|
|
|
"big-parallel"
|
|
|
|
"kvm"
|
2024-11-02 22:48:20 +01:00
|
|
|
"nixos-test"
|
2024-07-26 14:31:25 +02:00
|
|
|
];
|
2024-10-13 20:18:56 +02:00
|
|
|
maxJobs = 0;
|
2024-05-02 09:45:30 +02:00
|
|
|
}
|
|
|
|
];
|
2024-01-22 22:50:51 +01:00
|
|
|
}
|
|
|
|
|
2024-03-07 22:01:03 +01:00
|
|
|
# TODO: create syncthing os snippet
|
2024-11-15 10:17:56 +01:00
|
|
|
(
|
|
|
|
let
|
|
|
|
tcp = [ 22000 ];
|
|
|
|
udp = [
|
|
|
|
22000
|
|
|
|
21027
|
|
|
|
];
|
|
|
|
in
|
|
|
|
{
|
|
|
|
# TODO: upstream feature for inverse rule to work: `! --in-interface zt+`
|
|
|
|
networking.firewall.interfaces."en+".allowedTCPPorts = tcp;
|
|
|
|
networking.firewall.interfaces."en+".allowedUDPPorts = udp;
|
|
|
|
networking.firewall.interfaces."wl+".allowedTCPPorts = tcp;
|
|
|
|
networking.firewall.interfaces."wl+".allowedUDPPorts = udp;
|
|
|
|
|
|
|
|
networking.firewall.allowedTCPPorts = [
|
|
|
|
# iperf3
|
|
|
|
5201
|
|
|
|
];
|
|
|
|
}
|
|
|
|
)
|
2024-03-07 22:01:03 +01:00
|
|
|
|
2024-01-24 00:24:04 +00:00
|
|
|
../../snippets/home-manager-with-zsh.nix
|
2024-01-22 23:05:23 +01:00
|
|
|
../../snippets/sway-desktop.nix
|
2024-01-24 00:24:04 +00:00
|
|
|
../../snippets/bluetooth.nix
|
2024-01-22 23:47:48 +00:00
|
|
|
../../snippets/timezone.nix
|
2024-01-25 00:32:37 +01:00
|
|
|
../../snippets/radicale.nix
|
2024-03-01 11:21:37 +01:00
|
|
|
|
|
|
|
../../snippets/holo-zerotier.nix
|
2024-06-13 16:42:55 +02:00
|
|
|
|
2024-12-05 21:50:11 +01:00
|
|
|
# ../../snippets/k3s-w-nix-snapshotter.nix
|
2024-01-22 22:50:51 +01:00
|
|
|
];
|
|
|
|
|
2024-01-22 22:45:42 +00:00
|
|
|
networking.hostName = nodeName;
|
|
|
|
networking.firewall.enable = true;
|
|
|
|
networking.networkmanager.enable = true;
|
2024-01-22 22:50:51 +01:00
|
|
|
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
|
|
|
|
environment.systemPackages = [
|
|
|
|
pkgs.sshfs
|
|
|
|
pkgs.util-linux
|
|
|
|
pkgs.coreutils
|
|
|
|
pkgs.vim
|
|
|
|
|
|
|
|
pkgs.git
|
|
|
|
pkgs.git-crypt
|
|
|
|
];
|
|
|
|
|
2024-01-22 23:05:23 +01:00
|
|
|
system.stateVersion = "23.11";
|
2024-11-15 10:17:56 +01:00
|
|
|
home-manager.users.root = _: { home.stateVersion = "23.11"; };
|
2024-01-22 23:05:23 +01:00
|
|
|
home-manager.users.steveej = _: {
|
|
|
|
home.stateVersion = "23.11";
|
2024-01-22 22:50:51 +01:00
|
|
|
|
2024-11-15 10:17:56 +01:00
|
|
|
imports = [ ../../../home-manager/configuration/graphical-fullblown.nix ];
|
2024-01-22 22:50:51 +01:00
|
|
|
|
2024-11-15 10:17:56 +01:00
|
|
|
nixpkgs.overlays = [ nodeFlake.overlays.default ];
|
2024-11-02 22:48:20 +01:00
|
|
|
|
2024-11-15 10:17:56 +01:00
|
|
|
home.sessionVariables = { };
|
2024-01-22 22:50:51 +01:00
|
|
|
|
2024-11-15 10:17:56 +01:00
|
|
|
home.packages = with pkgs; [ ];
|
2024-01-24 00:24:04 +00:00
|
|
|
|
2024-11-02 22:48:20 +01:00
|
|
|
# TODO(upstream): currently unsupported on x13s
|
2024-10-13 20:16:50 +02:00
|
|
|
services.gammastep.enable = true;
|
2024-01-24 00:24:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
boot = {
|
|
|
|
loader.systemd-boot.enable = true;
|
2024-08-22 14:34:01 +02:00
|
|
|
loader.systemd-boot.configurationLimit = 5;
|
|
|
|
|
2024-01-24 00:24:04 +00:00
|
|
|
loader.efi.canTouchEfiVariables = lib.mkForce false;
|
|
|
|
loader.efi.efiSysMountPoint = "/boot";
|
2024-12-05 21:50:11 +01:00
|
|
|
blacklistedKernelModules = [
|
|
|
|
"wwan"
|
|
|
|
"qcom_soundwire"
|
|
|
|
"snd_soc_qcom_sdw"
|
|
|
|
"snd_soc_sc8280xp"
|
|
|
|
];
|
2024-01-22 23:05:23 +01:00
|
|
|
};
|
2024-01-25 00:32:37 +01:00
|
|
|
|
2024-07-26 14:09:34 +02:00
|
|
|
hardware.firmware = lib.mkBefore [
|
2024-08-04 09:31:50 +02:00
|
|
|
packages'.x13s-ath11k-firmware
|
2024-07-26 14:09:34 +02:00
|
|
|
];
|
|
|
|
|
2024-01-25 00:32:37 +01:00
|
|
|
# see https://linrunner.de/tlp/
|
2024-02-07 11:15:16 +01:00
|
|
|
# TODO: find an equivalent to tlp that supports this machine
|
2024-01-25 00:32:37 +01:00
|
|
|
services.tlp = {
|
2024-02-07 11:15:16 +01:00
|
|
|
enable = false;
|
2024-01-25 00:32:37 +01:00
|
|
|
settings = {
|
|
|
|
START_CHARGE_THRESH_BAT0 = "80";
|
|
|
|
STOP_CHARGE_THRESH_BAT0 = "85";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# android on linux
|
2024-08-08 14:37:38 +02:00
|
|
|
virtualisation.waydroid.enable = true;
|
2024-02-07 11:08:46 +01:00
|
|
|
hardware.ledger.enable = true;
|
2024-03-01 11:21:37 +01:00
|
|
|
|
2024-06-13 16:42:55 +02:00
|
|
|
virtualisation.containers.enable = true;
|
|
|
|
virtualisation.podman.enable = true;
|
|
|
|
|
2024-03-01 11:21:37 +01:00
|
|
|
steveej.holo-zerotier = {
|
|
|
|
enable = true;
|
|
|
|
autostart = false;
|
|
|
|
};
|
2024-07-26 14:09:34 +02:00
|
|
|
|
2024-11-15 10:17:56 +01:00
|
|
|
services.udev.packages = [ pkgs.android-udev-rules ];
|
2024-07-26 14:09:34 +02:00
|
|
|
programs.adb.enable = true;
|
|
|
|
|
|
|
|
nix.settings.sandbox = lib.mkForce "relaxed";
|
2024-11-02 22:48:20 +01:00
|
|
|
|
|
|
|
systemd.user.services.wireplumber.environment.LIBCAMERA_IPA_PROXY_PATH = "${pkgs.libcamera}/libexec/libcamera";
|
2024-01-22 22:50:51 +01:00
|
|
|
}
|