From 3fcb1e3c4e22177b0e7762b30760b463af63542a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Tue, 12 Sep 2023 20:11:29 +0200 Subject: [PATCH] feat: maoam pinephone --- flake.nix | 8 ++++ hosts/maoam/configuration.nix | 53 ++++++++++++++++++++++++++ hosts/maoam/default.nix | 7 ++++ hosts/maoam/hardware-configuration.nix | 18 +++++++++ hosts/maoam/maoam.nix | 15 ++++++++ profiles/base-user/default.nix | 1 + 6 files changed, 102 insertions(+) create mode 100644 hosts/maoam/configuration.nix create mode 100644 hosts/maoam/default.nix create mode 100644 hosts/maoam/hardware-configuration.nix create mode 100644 hosts/maoam/maoam.nix diff --git a/flake.nix b/flake.nix index f93d75f..c71c581 100644 --- a/flake.nix +++ b/flake.nix @@ -138,6 +138,10 @@ system = "aarch64-linux"; modules = [nixos-hardware.nixosModules.raspberry-pi-4]; }; + + maoam = { + system = "aarch64-linux"; + }; }; importables = rec { profiles = @@ -198,6 +202,10 @@ pie = { sshUser = "yule"; }; + + maoam = { + sshUser = "b12f"; + }; #example = { # hostname = "example.com:22"; # sshUser = "bartender"; diff --git a/hosts/maoam/configuration.nix b/hosts/maoam/configuration.nix new file mode 100644 index 0000000..0baf7a0 --- /dev/null +++ b/hosts/maoam/configuration.nix @@ -0,0 +1,53 @@ +{ config, lib, pkgs, ... }: +let + mobile-nixos = pkgs.fetchFromGithub { + owner = "NixOS"; + repo = "mobile-nixos"; + rev = "d22c60e8d4d21f0197c1cac88c34dcc366b7a16c"; + sha256 = ""; + }; +in { + imports = [ + (import { device = "pine64-pinephone"; }) + ./hardware-configuration.nix + + ]; + + # Use Network Manager + networking.wireless.enable = false; + networking.networkmanager.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 = "b12f"; + }; + + mobile.boot.stage-1.firmware = [ + config.mobile.device.firmware + ]; + + services.openssh.enable = true; + + # 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.11"; # Did you read the comment? +} diff --git a/hosts/maoam/default.nix b/hosts/maoam/default.nix new file mode 100644 index 0000000..1ae6f8e --- /dev/null +++ b/hosts/maoam/default.nix @@ -0,0 +1,7 @@ +{suites, ...}: { + imports = + [ + ./maoam.nix + ] + ++ suites.maoam; +} diff --git a/hosts/maoam/hardware-configuration.nix b/hosts/maoam/hardware-configuration.nix new file mode 100644 index 0000000..61ee65a --- /dev/null +++ b/hosts/maoam/hardware-configuration.nix @@ -0,0 +1,18 @@ +# NOTE: this file was generated by the Mobile NixOS installer. +{ config, lib, pkgs, ... }: +{ + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/51a668b8-fa2e-4d3e-ac3f-73ca002d0004"; + fsType = "ext4"; + }; + }; + + boot.initrd.luks.devices = { + "LUKS-MAOAM-ROOTFS" = { + device = "/dev/disk/by-uuid/5dd0cc1e-abfa-4192-94da-ac43622116fb"; + }; + }; + + nix.settings.max-jobs = lib.mkDefault 2; +} diff --git a/hosts/maoam/maoam.nix b/hosts/maoam/maoam.nix new file mode 100644 index 0000000..e90fa65 --- /dev/null +++ b/hosts/maoam/maoam.nix @@ -0,0 +1,15 @@ +{ + config, + pkgs, + lib, + self, + ... +}: +with lib; let + psCfg = config.pub-solar; + xdg = config.home-manager.users."${psCfg.user.name}".xdg; +in { + imports = [ + ./configuration.nix + ]; +} diff --git a/profiles/base-user/default.nix b/profiles/base-user/default.nix index 05ee46d..578b35b 100644 --- a/profiles/base-user/default.nix +++ b/profiles/base-user/default.nix @@ -26,6 +26,7 @@ in { "networkmanager" "scanner" "video" + "dialout" "wheel" ]; shell = pkgs.bash;