From 53dfdb1cc0869c4de3366f18725704bd9609401b Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Thu, 30 Apr 2026 13:51:05 +0200 Subject: [PATCH] feat(pumo): add config for phone pumo --- flake.lock | 23 ++++++++-- flake.nix | 14 ++++++ hosts/pumo/default.nix | 90 ++++++++++++++++++++++++++++++++++++++ system/boot/boot.nix | 2 +- system/desktop/xserver.nix | 1 + system/hardware/sound.nix | 7 +-- system/misc.nix | 1 + 7 files changed, 131 insertions(+), 7 deletions(-) create mode 100644 hosts/pumo/default.nix diff --git a/flake.lock b/flake.lock index 5beb792..fc9c6e1 100644 --- a/flake.lock +++ b/flake.lock @@ -58,11 +58,11 @@ "quickshell": "quickshell" }, "locked": { - "lastModified": 1780839367, - "narHash": "sha256-KAENT4Od2wwWtJzWFtR/qKzqoR673r91KLcyv4pPcNQ=", + "lastModified": 1780845600, + "narHash": "sha256-cPAXoIsoPd9d8Mqh1JEZcHFgndAiIe2/z0ZAlgjjKMw=", "owner": "caelestia-dots", "repo": "shell", - "rev": "3bc2bd2a5c5c886f75363211d838b749ab95137e", + "rev": "8f49fdb4057c65fb7e591cdc5195d28086e56eb7", "type": "github" }, "original": { @@ -261,6 +261,22 @@ "type": "github" } }, + "mobile-nixos": { + "flake": false, + "locked": { + "lastModified": 1772289954, + "narHash": "sha256-iDdtwk/dFb6AsXMtcOpZixxXl6C1HNUPe6cglxxHO7M=", + "owner": "mobile-nixos", + "repo": "mobile-nixos", + "rev": "1a9e0af79dc7b5e29ed772f1a8a76fcbd9d45fdf", + "type": "github" + }, + "original": { + "owner": "mobile-nixos", + "repo": "mobile-nixos", + "type": "github" + } + }, "nix-index-database": { "inputs": { "nixpkgs": [ @@ -389,6 +405,7 @@ "flake-utils": "flake-utils_2", "home-manager": "home-manager", "jj-cz": "jj-cz", + "mobile-nixos": "mobile-nixos", "nix-index-database": "nix-index-database", "nixpkgs": "nixpkgs", "nixpkgsStable": "nixpkgsStable", diff --git a/flake.nix b/flake.nix index 0545d51..28c326b 100644 --- a/flake.nix +++ b/flake.nix @@ -31,6 +31,11 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + mobile-nixos = { + url = "github:mobile-nixos/mobile-nixos"; + flake = false; # It is not as a flake + }; + pumo-system-info = { url = "git+https://labs.phundrak.com/phundrak/pumo-system-info"; inputs.nixpkgs.follows = "nixpkgs"; @@ -90,6 +95,7 @@ flake-utils, home-manager, rockchip, + mobile-nixos, srvos, ... } @ inputs: @@ -190,6 +196,14 @@ ]; }; pinetab2 = pinetabConfig "x86_64-linux" ./hosts/pinetab2/gnome.nix; + pumo = nixpkgs.lib.nixosSystem { + system = "aarch64-linux"; + inherit specialArgs; + modules = withSystemModules [ + (import "${mobile-nixos}/lib/configuration.nix" {device = "oneplus-enchilada";}) + ./hosts/pumo + ]; + }; tilo = nixpkgs.lib.nixosSystem { inherit specialArgs; modules = withSystemModules ./hosts/tilo/configuration.nix; diff --git a/hosts/pumo/default.nix b/hosts/pumo/default.nix new file mode 100644 index 0000000..426aff8 --- /dev/null +++ b/hosts/pumo/default.nix @@ -0,0 +1,90 @@ +# Minimal configuration for OnePlus 6 (enchilada) NixOS Mobile +# Focus on essentials: SSH, wireless, and basic tools +{ + pkgs, + inputs, + ... +}: { + imports = [ + inputs.sops-nix.nixosModules.sops + ../../system + ]; + + nixpkgs.config.permittedInsecurePackages = ["olm-3.2.16"]; + + mySystem = { + desktop = { + hyprland.enable = true; + niri.enable = true; + waydroid.enable = true; + xserver = { + enable = true; + de = "gnome"; + }; + }; + dev.docker = { + enable = true; + podman.enable = true; + autoprune.enable = true; + }; + hardware = { + bluetooth.enable = true; + sound = { + enable = true; + usePulseaudio = true; + }; + }; + i18n.input.enable = true; + misc = { + keymap = "fr-bepo"; + mobile = true; + }; + networking = { + hostname = "pumo"; + id = "93595b88"; + }; + packages = { + appimage.enable = true; + flatpak.enable = true; + nix.nix-ld.enable = true; + }; + services = { + languagetool.enable = true; + printing.enable = true; + ssh.enable = true; + }; + users = { + root.disablePassword = true; + phundrak = { + enable = true; + trusted = true; + extraGroups = ["feedbackd"]; + }; + }; + }; + + programs = { + dconf.enable = true; + calls.enable = true; + zsh.enable = true; + }; + + hardware.sensor.iio.enable = true; + + # Minimal essential packages + environment.systemPackages = with pkgs; [ + chatty # IM and SMS + epiphany + nixd + git + vim + emacs + wget + curl + jujutsu + firefox + kitty + ]; + + system.stateVersion = "25.11"; +} diff --git a/system/boot/boot.nix b/system/boot/boot.nix index 98d575d..df7237a 100644 --- a/system/boot/boot.nix +++ b/system/boot/boot.nix @@ -54,7 +54,7 @@ in { }; }; - config.boot = { + config.boot = mkIf (! config.mySystem.misc.mobile) { initrd.kernelModules = lib.lists.singleton ( if config.mySystem.hardware.amdgpu.enable then "amdgpu" diff --git a/system/desktop/xserver.nix b/system/desktop/xserver.nix index f6ae789..e19e37e 100644 --- a/system/desktop/xserver.nix +++ b/system/desktop/xserver.nix @@ -30,6 +30,7 @@ in { games.enable = false; gnome-remote-desktop.enable = true; gnome-online-accounts.enable = true; + gnome-keyring.enable = true; sushi.enable = true; }; diff --git a/system/hardware/sound.nix b/system/hardware/sound.nix index 62c6f14..05362e0 100644 --- a/system/hardware/sound.nix +++ b/system/hardware/sound.nix @@ -8,8 +8,9 @@ with lib; let cfg = config.mySystem.hardware.sound; in { options.mySystem.hardware.sound = { - enable = mkEnableOption "Whether to enable sounds with Pipewire"; + enable = mkEnableOption "Whether to enable sounds"; noisetorch = mkEnableOption "Whether to activate noisetorch support"; + usePulseaudio = mkEnableOption "Activate sound support with Pulseaudio"; scarlett.enable = mkEnableOption "Activate support for Scarlett sound card"; alsa = mkOption { type = types.bool; @@ -34,7 +35,7 @@ in { config = { environment.systemPackages = mkIf cfg.scarlett.enable [pkgs.alsa-scarlett-gui]; services = { - pipewire = mkIf cfg.enable { + pipewire = mkIf (cfg.enable && ! cfg.usePulseaudio) { enable = true; alsa = mkIf cfg.alsa { enable = mkDefault true; @@ -42,7 +43,7 @@ in { }; jack.enable = mkDefault cfg.jack; }; - pulseaudio.enable = false; + pulseaudio.enable = cfg.usePulseaudio; }; programs.noisetorch = mkIf cfg.enable { enable = cfg.noisetorch; diff --git a/system/misc.nix b/system/misc.nix index ab050d1..c645c73 100644 --- a/system/misc.nix +++ b/system/misc.nix @@ -17,6 +17,7 @@ in { example = "fr-bepo"; description = "Keymap to use in the TTY console"; }; + mobile = mkEnableOption "Enable if using Mobile NixOS"; }; config = {