about summary refs log tree commit diff
path: root/users/tazjin
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2024-06-08T21·18+0300
committertazjin <mail@tazj.in>2024-06-09T11·36+0000
commit73c39fe1befc64a0612ac9af3887afbf5ba34f85 (patch)
tree286be628c15d3e64d61e8477f5023bfc1d21e843 /users/tazjin
parenteba19f822a546035bc8cd568554f4f198ad2b3a7 (diff)
feat(tazjin/nixos): bootstrap arbat (Zhaoxin CPU notebook) r/8229
Prepares the pre-installation config (before actually running the installer on
the notebook and dumping out a hardware config etc.).

Change-Id: Ia74c4bfa298738cbf8c4034c22d9f8b51c7e67e0
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11765
Reviewed-by: tazjin <tazjin@tvl.su>
Autosubmit: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Diffstat (limited to 'users/tazjin')
-rw-r--r--users/tazjin/nixos/arbat/default.nix62
-rw-r--r--users/tazjin/nixos/default.nix1
-rw-r--r--users/tazjin/nixos/modules/laptop.nix1
-rw-r--r--users/tazjin/nixos/zamalek/default.nix5
4 files changed, 64 insertions, 5 deletions
diff --git a/users/tazjin/nixos/arbat/default.nix b/users/tazjin/nixos/arbat/default.nix
new file mode 100644
index 000000000000..ade80e7c90e7
--- /dev/null
+++ b/users/tazjin/nixos/arbat/default.nix
@@ -0,0 +1,62 @@
+# arbat is my Unchartevice 6640MA, with a Zhaoxin CPU.
+{ depot, lib, pkgs, ... }:
+
+config:
+let
+  mod = name: depot.path.origSrc + ("/ops/modules/" + name);
+  usermod = name: depot.path.origSrc + ("/users/tazjin/nixos/modules/" + name);
+
+  zdevice = device: {
+    inherit device;
+    fsType = "zfs";
+  };
+in
+{
+  imports = [
+    (usermod "chromium.nix")
+    (usermod "desktop.nix")
+    (usermod "fonts.nix")
+    # (usermod "hidpi.nix") # TODO(tazjin): not sure yet
+    (usermod "home-config.nix")
+    (usermod "laptop.nix")
+    (usermod "persistence.nix")
+    (usermod "physical.nix")
+    (pkgs.home-manager.src + "/nixos")
+  ];
+
+  tvl.cache.enable = true;
+
+  # TODO(tazjin): hardware settings; boot settings
+
+  boot = {
+    loader.systemd-boot.enable = true;
+    supportedFilesystems = [ "zfs" ];
+    zfs.devNodes = "/dev/";
+  };
+
+  networking = {
+    hostName = "arbat";
+    hostId = "864f050b";
+    networkmanager.enable = true;
+  };
+
+  fileSystems = {
+    "/" = zdevice "zpool/ephemeral/root";
+    "/home" = zdevice "zpool/ephemeral/home";
+    "/persist" = zdevice "zpool/persistent/data" // { neededForBoot = true; };
+    "/nix" = zdevice "zpool/persistent/nix";
+    "/depot" = zdevice "zpool/persistent/depot";
+
+    # "/boot" = {
+    #   device = "/dev/disk/by-uuid/2487-3908";
+    #   fsType = "vfat";
+    # };
+  };
+
+  # TODO(tazjin): decide on this
+  # services.xserver.libinput.touchpad.clickMethod = "clickfinger";
+  # services.xserver.libinput.touchpad.tapping = false;
+
+
+  system.stateVersion = "24.11";
+}
diff --git a/users/tazjin/nixos/default.nix b/users/tazjin/nixos/default.nix
index 8f82c39ea11f..29b6a0e83b10 100644
--- a/users/tazjin/nixos/default.nix
+++ b/users/tazjin/nixos/default.nix
@@ -2,6 +2,7 @@
 
 let systemFor = sys: (depot.ops.nixos.nixosFor sys).system;
 in depot.nix.readTree.drvTargets {
+  arbatSystem = systemFor depot.users.tazjin.nixos.arbat;
   camdenSystem = systemFor depot.users.tazjin.nixos.camden;
   frogSystem = systemFor depot.users.tazjin.nixos.frog;
   tverskoySystem = systemFor depot.users.tazjin.nixos.tverskoy;
diff --git a/users/tazjin/nixos/modules/laptop.nix b/users/tazjin/nixos/modules/laptop.nix
index e0d67dc25989..2a18d8579236 100644
--- a/users/tazjin/nixos/modules/laptop.nix
+++ b/users/tazjin/nixos/modules/laptop.nix
@@ -10,6 +10,7 @@
 
   # Enable power-saving features.
   services.tlp.enable = true;
+  powerManagement.powertop.enable = true;
 
   programs.light.enable = true;
 }
diff --git a/users/tazjin/nixos/zamalek/default.nix b/users/tazjin/nixos/zamalek/default.nix
index a340e8a3e897..29effaa9bdd7 100644
--- a/users/tazjin/nixos/zamalek/default.nix
+++ b/users/tazjin/nixos/zamalek/default.nix
@@ -61,10 +61,6 @@ in
     hostId = "ee399356";
     networkmanager.enable = true;
 
-    extraHosts = ''
-      10.101.240.1 wifi.silja.fi
-    '';
-
     nameservers = [
       "8.8.8.8"
       "8.8.4.4"
@@ -82,7 +78,6 @@ in
   services.xserver.libinput.touchpad.tapping = false;
   services.avahi.enable = true;
   services.tailscale.enable = true;
-  powerManagement.powertop.enable = true;
 
   system.stateVersion = "21.11";
 }