forked from emily/nixfiles
fixed lain ig
This commit is contained in:
parent
240c4d8730
commit
eeda91a6ac
8 changed files with 162 additions and 53 deletions
1
builders
Normal file
1
builders
Normal file
|
@ -0,0 +1 @@
|
||||||
|
ssh://nixremote@seras.kyouma.net x86_64-linux,aarch64-linux - 40 2 nixos-test,benchmark,big-parallel,kvm
|
|
@ -57,8 +57,15 @@ with lib; {
|
||||||
nix.gc.automatic = true;
|
nix.gc.automatic = true;
|
||||||
nix.gc.options = "--delete-older-than 7d";
|
nix.gc.options = "--delete-older-than 7d";
|
||||||
nix.optimise.automatic = true;
|
nix.optimise.automatic = true;
|
||||||
|
nix.registry.nixpkgs.to = {
|
||||||
|
type = "path";
|
||||||
|
path = pkgs.path;
|
||||||
|
};
|
||||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||||
nix.settings.trusted-users = [ "root" "@wheel" ];
|
nix.settings.trusted-users = [ "root" "@wheel" ];
|
||||||
|
nix.extraOptions = ''
|
||||||
|
builders-use-substitutes = true
|
||||||
|
'';
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
|
|
|
@ -1,52 +1,27 @@
|
||||||
{ config, inputs, lib, pkgs, ... }: {
|
{ config, inputs, lib, pkgs, ... }: {
|
||||||
imports = [
|
imports = [
|
||||||
inputs.nixos-hardware.nixosModules.raspberry-pi-4
|
|
||||||
../../common
|
../../common
|
||||||
|
../../profiles/remote-builder.nix
|
||||||
|
../../profiles/rpi.nix
|
||||||
../../profiles/headless.nix
|
../../profiles/headless.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
|
||||||
console.enable = false;
|
|
||||||
|
|
||||||
deployment = {
|
deployment = {
|
||||||
targetHost = "192.168.178.166";
|
targetHost = "192.168.178.171";
|
||||||
targetUser = "nixos";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
networking = {
|
||||||
kodiPackages.jellyfin
|
hostName = "lain";
|
||||||
kodiPackages.keymap
|
dhcpcd.enable = lib.mkForce true;
|
||||||
libcec
|
networkmanager.enable = true;
|
||||||
libraspberrypi
|
useDHCP = lib.mkForce true;
|
||||||
raspberrypi-eeprom
|
|
||||||
];
|
|
||||||
fileSystems = {
|
|
||||||
"/" = {
|
|
||||||
device = "/dev/disk/by-label/NIXOS_SD";
|
|
||||||
fsType = "ext4";
|
|
||||||
options = [ "noatime" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
hardware = {
|
|
||||||
bluetooth.enable = true;
|
|
||||||
deviceTree.enable = true;
|
|
||||||
raspberry-pi."4" = {
|
|
||||||
audio.enable = false;
|
|
||||||
apply-overlays-dtmerge.enable = true;
|
|
||||||
fkms-3d.enable = true;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
systemd.network.enable = lib.mkForce false;
|
||||||
kyouma.machine-type.physical = true;
|
|
||||||
|
|
||||||
nixpkgs.overlays = [
|
nixpkgs.overlays = [
|
||||||
(self: super: { libcec = super.libcec.override { withLibraspberrypi = true; }; })
|
(self: super: { kodi-wayland = super.kodi-wayland.overrideAttrs { doInstallCheck = false; }; })
|
||||||
];
|
];
|
||||||
|
|
||||||
networking.hostName = "lain";
|
|
||||||
networking.networkmanager.enable = true;
|
|
||||||
systemd.network.enable = lib.mkForce false;
|
|
||||||
|
|
||||||
systemd.sockets."cec-client" = {
|
systemd.sockets."cec-client" = {
|
||||||
after = [ "dev-vchiq.device" ];
|
after = [ "dev-vchiq.device" ];
|
||||||
bindsTo = [ "dev-vchiq.device" ];
|
bindsTo = [ "dev-vchiq.device" ];
|
||||||
|
@ -70,30 +45,22 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.avahi = {
|
|
||||||
enable = true;
|
|
||||||
ipv6 = true;
|
|
||||||
nssmdns4 = true;
|
|
||||||
publish.enable = true;
|
|
||||||
publish.userServices = true;
|
|
||||||
};
|
|
||||||
services.cage = {
|
services.cage = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
environment = {
|
||||||
|
WLR_NO_HARDWARE_CURSORS = "1";
|
||||||
|
};
|
||||||
program = "${pkgs.kodi-wayland}/bin/kodi-standalone";
|
program = "${pkgs.kodi-wayland}/bin/kodi-standalone";
|
||||||
user = "kodi";
|
user = "kodi";
|
||||||
};
|
};
|
||||||
services.fstrim.enable = true;
|
|
||||||
services.pipewire = {
|
|
||||||
enable = true;
|
|
||||||
alsa.enable = true;
|
|
||||||
pulse.enable = true;
|
|
||||||
};
|
|
||||||
services.udev.extraRules = ''
|
services.udev.extraRules = ''
|
||||||
# allow access to raspi cec device for video group (and optionally register it as a systemd device, used below)
|
# allow access to raspi cec device for video group (and optionally register it as a systemd device, used below)
|
||||||
KERNEL=="vchiq", GROUP="video", MODE="0660", TAG+="systemd", ENV{SYSTEMD_ALIAS}="/dev/vchiq"
|
KERNEL=="vchiq", GROUP="video", MODE="0660", TAG+="systemd", ENV{SYSTEMD_ALIAS}="/dev/vchiq"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
users.mutableUsers = lib.mkForce true;
|
users = {
|
||||||
users.users.kodi.extraGroups = [ "video" ];
|
mutableUsers = lib.mkForce true;
|
||||||
users.extraUsers.kodi.isNormalUser = true;
|
users.kodi.extraGroups = [ "video" ];
|
||||||
|
extraUsers.kodi.isNormalUser = true;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,11 +3,12 @@
|
||||||
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-x1-extreme-gen4
|
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-x1-extreme-gen4
|
||||||
../../common
|
../../common
|
||||||
../../profiles/graphical
|
../../profiles/graphical
|
||||||
|
../../profiles/remote-build.nix
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./disko.nix
|
./disko.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
|
#boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
|
||||||
boot.extraModprobeConfig = ''
|
boot.extraModprobeConfig = ''
|
||||||
options i915 enable_guc=3
|
options i915 enable_guc=3
|
||||||
'';
|
'';
|
||||||
|
|
35
config/hosts/seras/configuration.nix
Normal file
35
config/hosts/seras/configuration.nix
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
{ config, inputs, lib, pkgs, ... }: {
|
||||||
|
imports = [
|
||||||
|
../../common
|
||||||
|
../../profiles/headless.nix
|
||||||
|
../../profiles/kartoffel.nix
|
||||||
|
../../profiles/lxc.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.binfmt.emulatedSystems = ["aarch64-linux"];
|
||||||
|
|
||||||
|
deployment.targetUser = "emily";
|
||||||
|
|
||||||
|
networking = {
|
||||||
|
hostName = "seras";
|
||||||
|
nftables.enable = lib.mkForce false;
|
||||||
|
};
|
||||||
|
nix.settings.trusted-users = [ "nixremote" ];
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
|
||||||
|
systemd.network.networks."98-eth-default" = {
|
||||||
|
address = [
|
||||||
|
"2a0f:be01:0:100::169/128"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
users.users.nixremote = {
|
||||||
|
isNormalUser = true;
|
||||||
|
shell = pkgs.fish;
|
||||||
|
ignoreShellProgramCheck = true;
|
||||||
|
openssh.authorizedKeys.keys = [
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA/+iN407+HsfHbbC3tfdA8Yf4TZ08qXQMb4tb/SDAs+ emily@card"
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICT0dGyLUjxFnvqUmex+5xUGQ7D4yGHKo267JgApcq0k root@ryuuko"
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIDTwCSWYODyvTJxwB6Rahuy0j6s/YYwtQta8bjzG/We root@ryuuko-arch"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
11
config/profiles/remote-build.nix
Normal file
11
config/profiles/remote-build.nix
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{config, lib, pkgs, ... }: {
|
||||||
|
nix.buildMachines = [{
|
||||||
|
hostName = "seras.kyouma.net";
|
||||||
|
sshUser = "nixremote";
|
||||||
|
maxJobs = 40;
|
||||||
|
speedFactor = 5;
|
||||||
|
systems = [ "aarch64-linux" "x86_64-linux" ];
|
||||||
|
supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ];
|
||||||
|
}];
|
||||||
|
nix.distributedBuilds = true;
|
||||||
|
}
|
81
config/profiles/rpi.nix
Normal file
81
config/profiles/rpi.nix
Normal file
|
@ -0,0 +1,81 @@
|
||||||
|
{ config, inputs, lib, pkgs, ... }: {
|
||||||
|
imports = [
|
||||||
|
inputs.nixos-hardware.nixosModules.raspberry-pi-4
|
||||||
|
];
|
||||||
|
kyouma.machine-type.physical = true;
|
||||||
|
|
||||||
|
boot = {
|
||||||
|
extraModprobeConfig = ''
|
||||||
|
options snd_bcm2835 enable_headphones=1
|
||||||
|
'';
|
||||||
|
kernelParams = [ "snd_bcm2835.enable_hdmi=1" ];
|
||||||
|
loader.raspberryPi.firmwareConfig = ''
|
||||||
|
dtparam=audio=on
|
||||||
|
dtparam=krnbt=on
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
console.enable = false;
|
||||||
|
|
||||||
|
documentation.man.generateCaches = false;
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
bluez
|
||||||
|
bluez-tools
|
||||||
|
libcec
|
||||||
|
libraspberrypi
|
||||||
|
raspberrypi-eeprom
|
||||||
|
];
|
||||||
|
fileSystems = {
|
||||||
|
"/" = {
|
||||||
|
device = "/dev/disk/by-label/NIXOS_SD";
|
||||||
|
fsType = "ext4";
|
||||||
|
options = [ "noatime" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
hardware = {
|
||||||
|
bluetooth.enable = true;
|
||||||
|
pulseaudio.enable = true;
|
||||||
|
deviceTree = {
|
||||||
|
enable = true;
|
||||||
|
overlays = [
|
||||||
|
{
|
||||||
|
name = "bluetooth-overlay";
|
||||||
|
dtsText = ''
|
||||||
|
/dts-v1/;
|
||||||
|
/plugin/;
|
||||||
|
|
||||||
|
/ {
|
||||||
|
compatible = "brcm,bcm2711";
|
||||||
|
|
||||||
|
fragment@0 {
|
||||||
|
target = <&uart0_pins>;
|
||||||
|
__overlay__ {
|
||||||
|
brcm,pins = <30 31 32 33>;
|
||||||
|
brcm,pull = <2 0 0 2>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
raspberry-pi."4" = {
|
||||||
|
apply-overlays-dtmerge.enable = true;
|
||||||
|
fkms-3d.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
nixpkgs.overlays = [
|
||||||
|
(self: super: { libcec = super.libcec.override { withLibraspberrypi = true; }; })
|
||||||
|
];
|
||||||
|
|
||||||
|
sound.enable = true;
|
||||||
|
services.avahi = {
|
||||||
|
enable = true;
|
||||||
|
ipv6 = true;
|
||||||
|
nssmdns4 = true;
|
||||||
|
publish.enable = true;
|
||||||
|
publish.userServices = true;
|
||||||
|
};
|
||||||
|
services.fstrim.enable = true;
|
||||||
|
}
|
|
@ -21,15 +21,21 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
nixConfig = {
|
||||||
|
builders-use-substitutes = true;
|
||||||
|
builders = "ssh://nixremote@seras.kyouma.net x86_64-linux,aarch64-linux - 40 2 nixos-test,benchmark,big-parallel,kvm";
|
||||||
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, flake-utils, ... }@inputs: {
|
outputs = { self, nixpkgs, flake-utils, ... }@inputs: {
|
||||||
colmena = let
|
colmena = let
|
||||||
hosts = [ "web-dus" "crime" "ryuuko" "lain" ];
|
hosts = [ "web-dus" "crime" "ryuuko" "lain" "seras" ];
|
||||||
hostCfg = hostname: {
|
hostCfg = hostname: {
|
||||||
imports = [ (./config/hosts/${hostname}/configuration.nix) ];
|
imports = [ (./config/hosts/${hostname}/configuration.nix) ];
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
meta = {
|
meta = {
|
||||||
allowApplyAll = false;
|
allowApplyAll = false;
|
||||||
|
machinesFile = ./builders;
|
||||||
nixpkgs = nixpkgs.legacyPackages.x86_64-linux;
|
nixpkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||||
nodeNixpkgs = {
|
nodeNixpkgs = {
|
||||||
lain = nixpkgs.legacyPackages.aarch64-linux;
|
lain = nixpkgs.legacyPackages.aarch64-linux;
|
||||||
|
|
Loading…
Reference in a new issue