summaryrefslogtreecommitdiffstats
path: root/systems/qi/base.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-26 13:18:31 +0000
committertv <tv@krebsco.de>2026-11-26 13:18:31 +0000
commit40e0d1268b0457d71f6aa946fe5ed6a5bf22c789 (patch)
tree795494daaef87b8a36120fc53dc53363dfe589e8 /systems/qi/base.nix
parent7b15342234d0f6f6b01645c294eb1eb3b543787c (diff)
qi: init
Diffstat (limited to 'systems/qi/base.nix')
-rw-r--r--systems/qi/base.nix77
1 files changed, 77 insertions, 0 deletions
diff --git a/systems/qi/base.nix b/systems/qi/base.nix
new file mode 100644
index 00000000..e124a9d4
--- /dev/null
+++ b/systems/qi/base.nix
@@ -0,0 +1,77 @@
+{ config, inputs, lib, modulesPath, pkgs, ... }: {
+ imports = [
+ # Minimize the build to produce a smaller closure
+ (modulesPath + "/profiles/minimal.nix")
+ (import (inputs.mobile-nixos + "/lib/configuration.nix") { device = "oneplus-enchilada"; })
+
+ ./firmware.nix
+ ];
+
+ krebs.build.host = config.krebs.hosts.qi;
+
+ networking.networkmanager.enable = false;
+ networking.wireless = {
+ userControlled.enable = true;
+ # userControlled.group defaults to wheel
+ enable = true;
+ };
+
+ zramSwap.enable = true;
+
+ environment.systemPackages = [
+ pkgs.git
+ pkgs.rsync
+ pkgs.btrfs-progs
+ ];
+
+ nixpkgs.config.allowUnfree = false;
+ services.openssh.enable = true;
+
+ users.mutableUsers = false;
+ users.users = {
+ default = {
+ isNormalUser = true;
+ extraGroups = [
+ "wheel"
+ ];
+ };
+ };
+
+ nix = {
+ settings = {
+ trusted-users = [ "@wheel" "root" ];
+ auto-optimise-store = true;
+ experimental-features = [ "nix-command" "flakes" ];
+ builders-use-substitutes = true;
+ flake-registry = builtins.toFile "empty-flake-registry.json" ''{"flakes":[],"version":2}'';
+ trust-tarballs-from-git-forges = true;
+ };
+ package = pkgs.nixVersions.latest;
+ nixPath = [ "/var/src" ];
+ };
+
+ # at least required for rebuild switch (not for creating the image)
+ # otherwise nixos-rebuild switch will fail with:
+ # Failed to install bootloader
+ # warning: error(s) occurred while switching to the new configuration
+ boot.loader.grub.enable = false;
+ system.build.installBootLoader = pkgs.writers.writeDash "install-bootloader" ''
+ echo DERP >&2
+ '';
+
+ services.journald.extraConfig = ''
+ Storage=volatile
+ '';
+
+ boot.growPartition = false;
+
+ boot.initrd.luks.devices.main = {
+ device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888889";
+ allowDiscards = true;
+ bypassWorkqueues = true;
+ };
+ fileSystems."/" = {
+ device = "/dev/mapper/main";
+ fsType = "btrfs";
+ };
+}