From c677ea1b89c61a05a870b65a9b1a787ad8297d66 Mon Sep 17 00:00:00 2001
From: Aaron Honeycutt <aaronhoneycutt@proton.me>
Date: Fri, 12 May 2023 16:18:39 -0600
Subject: [PATCH] Move aarch64 devices

---
 systems/aarch64/pbp.nix          |  7 +++
 systems/aarch64/pinephone.nix    | 98 ++++++++++++++++++++++++++++++++
 systems/aarch64/rpi4-example.nix | 56 ++++++++++++++++++
 3 files changed, 161 insertions(+)
 create mode 100644 systems/aarch64/pbp.nix
 create mode 100644 systems/aarch64/pinephone.nix
 create mode 100644 systems/aarch64/rpi4-example.nix

diff --git a/systems/aarch64/pbp.nix b/systems/aarch64/pbp.nix
new file mode 100644
index 0000000..d4f4b62
--- /dev/null
+++ b/systems/aarch64/pbp.nix
@@ -0,0 +1,7 @@
+{ config, pkgs, ... }: 
+
+{
+    # Name your host machine
+    networking.hostName = "jaal"; 
+    
+}
diff --git a/systems/aarch64/pinephone.nix b/systems/aarch64/pinephone.nix
new file mode 100644
index 0000000..7017125
--- /dev/null
+++ b/systems/aarch64/pinephone.nix
@@ -0,0 +1,98 @@
+{ config, lib, pkgs, ... }:
+
+{
+  imports = [
+    (import <mobile-nixos/lib/configuration.nix> { device = "pine64-pinephone"; })
+    ./hardware-configuration.nix
+    <mobile-nixos/examples/phosh/phosh.nix>
+  ];
+
+  networking.hostName = "peebee";
+  time.timeZone = "America/Denver";
+
+  #
+  # Opinionated defaults
+  #
+  
+  # Use Network Manager
+  networking.wireless.enable = false;
+  networking.networkmanager.enable = true;
+  
+  # SSH
+  services.openssh = {
+    enable = true;
+    };
+
+  # Use PulseAudio
+  hardware.pulseaudio.enable = true;
+  
+  # Enable Bluetooth
+  hardware.bluetooth.enable = true;
+  
+  # Bluetooth audio
+  hardware.pulseaudio.package = pkgs.pulseaudioFull;
+  
+  # Enable power management options
+  powerManagement.enable = true;
+  
+  # It's recommended to keep enabled on these constrained devices
+  zramSwap.enable = true;
+
+  # Auto-login for phosh
+  services.xserver.desktopManager.phosh = {
+    user = "aaronh";
+  };
+
+  #
+  # User configuration
+  #
+  
+  users.users."aaronh" = {
+    isNormalUser = true;
+    description = "Aaron Honeycutt";
+    hashedPassword = "$6$zOZeSMch129yV5i1$9E0sFdMo4qIBUZgPKgl5AXKlYNku12gv2owPy7FSpC2W4qMofTzoX2KFLmGxERdI8A7n0kyJElcUFQGIS940j1";
+    extraGroups = [
+      "dialout"
+      "feedbackd"
+      "networkmanager"
+      "video"
+      "wheel"
+    ];    
+    
+  # GUI
+  packages = with pkgs; [
+    deja-dup
+    foliate
+    headlines
+    gnome.gnome-clocks
+    gnome.gnome-calculator
+    gnome-feeds
+    gnome-photos
+    gnome-podcasts
+    lollypop
+    marker
+    phosh-mobile-settings
+    portfolio-filemanager
+    spot
+    tootle
+
+  # CLI
+    grim
+
+  ];
+};
+
+  # Remove non-friendly GNOME packages
+  environment.gnome.excludePackages = (with pkgs; [
+  gnome-photos
+  gnome-tour
+  ]);
+
+  # This value determines the NixOS release from which the default
+  # settings for stateful data, like file locations and database versions
+  # on your system were taken. It‘s perfectly fine and recommended to leave
+  # this value at the release version of the first install of this system.
+  # Before changing this value read the documentation for this option
+  # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
+  system.stateVersion = "23.05"; # Did you read the comment?
+}
diff --git a/systems/aarch64/rpi4-example.nix b/systems/aarch64/rpi4-example.nix
new file mode 100644
index 0000000..1903f87
--- /dev/null
+++ b/systems/aarch64/rpi4-example.nix
@@ -0,0 +1,56 @@
+{ config, pkgs, lib, ... }:
+
+let
+  SSID = "Honeycutt-5G";
+  SSIDpassword = "Frappe92";
+  interface = "wlan0";
+  hostname = "NixOS";
+in {
+  imports = ["${fetchTarball "https://github.com/NixOS/nixos-hardware/archive/936e4649098d6a5e0762058cb7687be1b2d90550.tar.gz" }/raspberry-pi/4"];
+
+  fileSystems = {
+    "/" = {
+      device = "/dev/disk/by-label/NIXOS_SD";
+      fsType = "ext4";
+      options = [ "noatime" ];
+    };
+  };
+
+  networking = {
+     hostName = "NixOS"; 
+     networkmanager.enable = true;
+
+    wireless = {
+      enable = true;
+      networks."${SSID}".psk = SSIDpassword;
+      interfaces = [ interface ];
+    };
+  };
+
+  # Set your time zone.
+  time.timeZone = "America/Denver";
+
+  environment.systemPackages = with pkgs; [ vim ];
+
+  services.openssh.enable = true;
+
+  # Define user accounts
+    users.extraUsers.aaronh = {
+            description = "Aaron Honeycutt";
+            home = "/home/aaronh";
+            extraGroups = [ "wheel" "networkmanager" "adm"];
+            isNormalUser = true;
+            hashedPassword = "$6$aAcbLtqiqzySifls$jdKMOQjoWITHD/dWNNZVUH/qNc6aoJ7v4zYofi0U7IJSVTbmOfChS3mzaJbp57AodjdPNKPrnrip8Nlh2Qanx.";
+    };
+
+  # Enable GPU acceleration
+  hardware.raspberry-pi."4".fkms-3d.enable = true;
+
+  services.xserver = {
+    enable = true;
+    displayManager.lightdm.enable = true;
+    desktopManager.xfce.enable = true;
+  };
+
+  hardware.pulseaudio.enable = true;
+}