diff --git a/flake.lock b/flake.lock index 85fd93c..ab7ed6d 100644 --- a/flake.lock +++ b/flake.lock @@ -411,6 +411,22 @@ "url": "https://labs.phundrak.com/phundrak/jj-cz" } }, + "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": { "inputs": { "flake-compat": [ @@ -593,6 +609,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", "opencode": "opencode", diff --git a/flake.nix b/flake.nix index 56e3e81..cc9df5b 100644 --- a/flake.nix +++ b/flake.nix @@ -30,6 +30,11 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + mobile-nixos = { + url = "github:mobile-nixos/mobile-nixos"; + flake = false; # It is not as a flake + }; + opencode = { url = "github:anomalyco/opencode/v1.3.15"; inputs.nixpkgs.follows = "nixpkgs"; @@ -86,6 +91,7 @@ nixpkgs, flake-utils, home-manager, + mobile-nixos, srvos, ... } @ inputs: @@ -177,6 +183,14 @@ ./hosts/naromk3/configuration.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..bbb8bdd --- /dev/null +++ b/hosts/pumo/default.nix @@ -0,0 +1,91 @@ +# 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/default.nix b/system/default.nix index 69ddaa5..922b1ee 100644 --- a/system/default.nix +++ b/system/default.nix @@ -30,6 +30,7 @@ in { example = "fr-bepo"; description = "Keymap to use in the TTY console"; }; + mobile = mkEnableOption "Enable if using Mobile NixOS"; }; config = { 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 d8e2805..ac2948e 100644 --- a/system/hardware/sound.nix +++ b/system/hardware/sound.nix @@ -8,7 +8,8 @@ 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"; + usePulseaudio = mkEnableOption "Activate sound support with pulseaudio"; scarlett.enable = mkEnableOption "Activate support for Scarlett sound card"; alsa = mkOption { type = types.bool; @@ -32,13 +33,14 @@ in { config = { environment.systemPackages = mkIf cfg.scarlett.enable [pkgs.alsa-scarlett-gui]; - services.pipewire = mkIf cfg.enable { - enable = true; - alsa = mkIf cfg.alsa { + services = { + pipewire.enable = mkForce (cfg.enable && ! cfg.usePulseaudio); + pipewire.alsa = { enable = mkDefault true; support32Bit = mkDefault true; }; - jack.enable = mkDefault cfg.jack; + pipewire.jack.enable = cfg.jack; + pulseaudio.enable = cfg.usePulseaudio; }; programs.noisetorch = mkIf cfg.enable { inherit (cfg) enable; diff --git a/system/packages/flatpak.nix b/system/packages/flatpak.nix index b510141..3eebf96 100644 --- a/system/packages/flatpak.nix +++ b/system/packages/flatpak.nix @@ -1,5 +1,4 @@ { - pkgs, lib, config, ... @@ -11,12 +10,7 @@ in { enable = mkEnableOption "Enable Flatpak support"; builder.enable = mkEnableOption "Enable Flatpak builder"; }; - config = { - services.flatpak = mkIf cfg.enable { - inherit (cfg) enable; - }; - environment.systemPackages = mkIf cfg.builder.enable [ - pkgs.flatpak-buildR - ]; + config.services.flatpak = mkIf cfg.enable { + inherit (cfg) enable; }; } diff --git a/system/users/phundrak.nix b/system/users/phundrak.nix index 7d3ee38..23f9b5a 100644 --- a/system/users/phundrak.nix +++ b/system/users/phundrak.nix @@ -10,13 +10,18 @@ in { options.mySystem.users.phundrak = { enable = mkEnableOption "Enables user phundrak"; trusted = mkEnableOption "Mark the user as trusted by Nix"; + extraGroups = mkOption { + type = types.listOf types.str; + default = []; + example = ["feedbackd"]; + }; }; config = { users.users.phundrak = mkIf cfg.enable { isNormalUser = true; description = "Lucien Cartier-Tilet"; - extraGroups = ["networkmanager" "wheel" "docker" "dialout" "podman" "plugdev" "games" "audio" "input"]; + extraGroups = ["networkmanager" "wheel" "docker" "dialout" "podman" "plugdev" "games" "audio" "input"] ++ cfg.extraGroups; shell = pkgs.zsh; openssh.authorizedKeys.keyFiles = lib.filesystem.listFilesRecursive ../../users/phundrak/keys; }; diff --git a/users/phundrak/packages.nix b/users/phundrak/packages.nix index 3384d79..1960f10 100644 --- a/users/phundrak/packages.nix +++ b/users/phundrak/packages.nix @@ -41,6 +41,7 @@ in { # Misc # gplates qgis + kicad handy libnotify nextcloud-client