Compare commits

..

1 Commits

Author SHA1 Message Date
800d0adeea feat(pumo): add config for phone pumo 2026-05-01 16:27:56 +02:00
16 changed files with 284 additions and 369 deletions

28
flake.lock generated
View File

@@ -398,20 +398,35 @@
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1776813492,
"narHash": "sha256-gydjnWdoZm++hK0B1vpXerwKJQdCeUcxrbBr9iEUTTA=",
"ref": "develop",
"rev": "9a6b94276b68263ad5b2ffebb64354b3bb4cc92a",
"revCount": 38,
"lastModified": 1775400071,
"narHash": "sha256-uFoqOUB1wbqqDKRdHNEYdgyRQECYWhJBq4Oxjm3Dx9M=",
"ref": "refs/heads/develop",
"rev": "3da214ae4c14f57dc5f6ecd480330936f00e1a4f",
"revCount": 35,
"type": "git",
"url": "https://labs.phundrak.com/phundrak/jj-cz"
},
"original": {
"ref": "develop",
"type": "git",
"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": [
@@ -594,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",

View File

@@ -26,10 +26,15 @@
};
jj-cz = {
url = "git+https://labs.phundrak.com/phundrak/jj-cz?ref=develop";
url = "git+https://labs.phundrak.com/phundrak/jj-cz";
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;

91
hosts/pumo/default.nix Normal file
View File

@@ -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";
}

View File

@@ -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"

View File

@@ -30,6 +30,7 @@ in {
example = "fr-bepo";
description = "Keymap to use in the TTY console";
};
mobile = mkEnableOption "Enable if using Mobile NixOS";
};
config = {

View File

@@ -9,10 +9,7 @@ with lib; let
in {
options.mySystem.desktop.waydroid.enable = mkEnableOption "Enables Waydroid";
config = mkIf cfg.enable {
virtualisation.waydroid = {
enable = cfg.enable;
package = pkgs.waydroid-nftables;
};
virtualisation.waydroid.enable = cfg.enable;
environment.systemPackages = [pkgs.waydroid-helper];
};
}

View File

@@ -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;
};

View File

@@ -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;

View File

@@ -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 {
config.services.flatpak = mkIf cfg.enable {
inherit (cfg) enable;
};
environment.systemPackages = mkIf cfg.builder.enable [
pkgs.flatpak-buildR
];
};
}

View File

@@ -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;
};

View File

@@ -27,10 +27,9 @@ in {
explorer = ["${pkgs.nemo-with-extensions}/bin/nemo"];
};
idle = {
inhibitWhenAudio = true;
timeouts = [
{
timeout = 3600;
timeout = 300;
idleAction = "lock";
}
];

View File

@@ -6,42 +6,8 @@
}:
with lib; let
cfg = config.home.shell.tmux;
keyType = types.submodule {
options = {
key = mkOption {
type = types.str;
example = "C-b";
};
action = mkOption {
type = types.str;
example = "resize-pane -Z";
};
};
};
in {
options.home.shell.tmux = with types; {
enable = mkEnableOption "Enable tmux";
bind = mkOption {
type = attrsOf (listOf keyType);
default = {};
example = {
"prefix" = [
{
key = "C-r";
action = "resize-pane -R";
}
];
};
};
unbind = mkOption {
type = listOf (either str (attrsOf (listOf str)));
default = [];
};
extraConfig = mkOption {
type = types.lines;
default = "";
};
};
options.home.shell.tmux.enable = mkEnableOption "Enable tmux";
config.programs.tmux = mkIf cfg.enable {
inherit (cfg) enable;
baseIndex = 1;
@@ -59,23 +25,71 @@ in {
sensible
yank
];
extraConfig = let
generateBinds = concatLines (
mapAttrsToList (table: keys: concatMapStrings (key: "bind -T ${table} ${key.key} ${key.action}\n") keys) cfg.bind
);
generateUnbind =
concatMapStrings (
entry:
if builtins.isString entry
then "unbind ${entry}\n"
else concatStrings (mapAttrsToList (table: keys: concatMapStrings (key: "unbind -T ${table} ${key}\n") keys) entry)
)
cfg.unbind;
in ''
${cfg.extraConfig}
extraConfig = ''
set-option -sa terminal-overrides ",xterm*:Tc"
${generateUnbind}
${generateBinds}
unbind C-b
bind-key -T prefix « select-window -p
bind-key -T prefix » select-window -n
bind-key -T prefix Tab switch-client -T windows
bind-key -T prefix w switch-client -T pane
bind-key -T prefix y switch-client -T copy-mode
bind-key -T pane / split-window -h -c "#{pane-current_path}"
bind-key -T pane - split-window -v -c "#{pane-current_path}"
bind-key -T pane c select-pane -L
bind-key -T pane t select-pane -D
bind-key -T pane s select-pane -U
bind-key -T pane r select-pane -R
bind-key -T pane f resize-pane -Z
bind-key -T pane . switch-client -T pane-resize
bind-key -T pane-resize c resize-pane -L 5\; switch-client -T pane-resize
bind-key -T pane-resize t resize-pane -D 5\; switch-client -T pane-resize
bind-key -T pane-resize s resize-pane -U 5\; switch-client -T pane-resize
bind-key -T pane-resize r resize-pane -R 5\; switch-client -T pane-resize
bind-key -T pane-resize C resize-pane -L\; switch-client -T pane-resize
bind-key -T pane-resize T resize-pane -D\; switch-client -T pane-resize
bind-key -T pane-resize S resize-pane -U\; switch-client -T pane-resize
bind-key -T pane-resize R resize-pane -R\; switch-client -T pane-resize
bind-key -T windows c new-window
bind-key -T windows n next-window
bind-key -T windows p previous-window
bind-key -T windows \" select-window -t :=1
bind-key -T windows « select-window -t :=2
bind-key -T windows » select-window -t :=3
bind-key -T windows ( select-window -t :=4
bind-key -T windows ) select-window -t :=5
bind-key -T windows @ select-window -t :=6
bind-key -T windows + select-window -t :=7
bind-key -T windows - select-window -t :=8
bind-key -T windows / select-window -t :=9
bind-key -T windows * select-window -t :=10
unbind -T copy-mode-vi H
unbind -T copy-mode-vi J
unbind -T copy-mode-vi K
unbind -T copy-mode-vi L
unbind -T copy-mode-vi h
unbind -T copy-mode-vi j
unbind -T copy-mode-vi k
unbind -T copy-mode-vi l
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
bind-key -T copy-mode-vi C send-keys -X top-line
bind-key -T copy-mode-vi J send-keys -X jump-to-backward
bind-key -T copy-mode-vi S send-keys -X scroll-up
bind-key -T copy-mode-vi R send-keys -X bottom-line
bind-key -T copy-mode-vi T send-keys -X scroll-down
bind-key -T copy-mode-vi c send-keys -X cursor-left
bind-key -T copy-mode-vi t send-keys -X cursor-down
bind-key -T copy-mode-vi s send-keys -X cursor-up
bind-key -T copy-mode-vi r send-keys -X cursor-right
'';
};
}

View File

@@ -1,77 +0,0 @@
{
config.home.desktop.firefox = {
enable = true;
useZen = true;
tridactyl = {
enable = true;
preConfig = "sanitise tridactyllocal tridactylsync";
config = {
editorcmd = "emacsclient -c";
keyboardlayoutbase = "bepo";
keyboardlayoutforce = "true";
hintchars = "auiectsr";
smothscroll = "true";
};
extraConfig = ''
unbind h
unbind j
unbind k
unbind l
unbind c
unbind t
unbind s
unbind r
unbind H
unbind J
unbind K
unbind L
unbind C
unbind T
unbind S
unbind R
" === Bépo layout scrolling (ctsr = hjkl) ===
bind c scrollpx -300 0
bind t scrollline 5
bind s scrollline -5
bind r scrollpx 300 0
" Half/full page scroll (replacing C-f/C-b/C-d/C-u)
bind <C-t> scrollpage 0.5
bind <C-s> scrollpage -0.5
" === History navigation (C/R = H/L) ===
bind C back
bind R forward
" === Tab navigation ===
bind T tabnext
bind S tabprev
" === Displaced commands ===
" reload was on r move to h (bépo's 'replace' position)
bind h reload
bind H reloadhard
" tabopen was on t move to j (bépo's 'find char to' position)
bind j fillcmdline tabopen
unbind ^http(s?)://youtube\.com f
unbind ^http(s?)://youtube\.com t
unbind ^http(s?)://youtube\.com l
unbind ^http(s?)://youtube\.com j
unbind ^http(s?)://twitch\.tv f
bind n findnext
bind N findnext -f
bind p findnext --reverse
bind P findnext -f --reverse
bind < urlincrement -1
bind > urlincrement 1
bind ypv js tri.native.run(`mpv --ytdl-format="[height >=? 480]" --ontop --fs "''${document.location.href}"`)
bind ypm hint -JF e => tri.native.run(`mpv --ytdl-format="[height >=? 480]" --ontop --fs "''${e.href}"`)
'';
};
};
}

View File

@@ -8,8 +8,6 @@
./light-home.nix
./packages.nix
./email.nix
./firefox.nix
./tmux.nix
./wlr-which-key
../modules
];
@@ -67,6 +65,76 @@
};
desktop = {
caelestia.enable = true;
firefox = {
enable = true;
useZen = true;
tridactyl = {
enable = true;
preConfig = "sanitise tridactyllocal tridactylsync";
config = {
editorcmd = "emacsclient -c";
keyboardlayoutbase = "bepo";
keyboardlayoutforce = "true";
hintchars = "auiectsr";
smothscroll = "true";
};
extraConfig = ''
unbind h
unbind j
unbind k
unbind l
unbind c
unbind t
unbind s
unbind r
unbind H
unbind J
unbind K
unbind L
unbind C
unbind T
unbind S
unbind R
" === Bépo layout scrolling (ctsr = hjkl) ===
bind c scrollpx -300 0
bind t scrollline 5
bind s scrollline -5
bind r scrollpx 300 0
" Half/full page scroll (replacing C-f/C-b/C-d/C-u)
bind <C-t> scrollpage 0.5
bind <C-s> scrollpage -0.5
" === History navigation (C/R = H/L) ===
bind C back
bind R forward
" === Tab navigation ===
bind T tabnext
bind S tabprev
" === Displaced commands ===
" reload was on r move to h (bépo's 'replace' position)
bind h reload
bind H reloadhard
" tabopen was on t move to j (bépo's 'find char to' position)
bind j fillcmdline tabopen
unbind ^http(s?)://youtube\.com f
unbind ^http(s?)://youtube\.com t
unbind ^http(s?)://youtube\.com l
unbind ^http(s?)://youtube\.com j
unbind ^http(s?)://twitch\.tv f
bind < urlincrement -1
bind > urlincrement 1
bind ypv js tri.native.run(`mpv --ytdl-format="[height >=? 480]" --ontop --fs "''${document.location.href}"`)
bind ypm hint -JF e => tri.native.run(`mpv --ytdl-format="[height >=? 480]" --ontop --fs "''${e.href}"`)
'';
};
};
spotify = {
enable = true;
spicetify.enable = true;

View File

@@ -40,8 +40,8 @@ in {
# Misc
# gplates
kicad-small
qgis
kicad
handy
libnotify
nextcloud-client

View File

@@ -1,210 +0,0 @@
{
home.shell.tmux = {
enable = true;
extraConfig = "set-option -sa terminal-overrides \",xterm*:Tc\"";
unbind = [
"C-b"
{"copy-mode-vi" = ["H" "J" "K" "L" "h" "j" "k" "l"];}
];
bind = {
prefix = [
{
key = "«";
action = "select-window -p";
}
{
key = "»";
action = "select-window -n";
}
{
key = "Tab";
action = "switch-client -T windows";
}
{
key = "w";
action = "switch-client -T pane";
}
{
key = "y";
action = "switch-client -T copy-mode";
}
];
pane = [
{
key = "/";
action = "split-window -h -c \"#{pane-current_path}\"";
}
{
key = "-";
action = "split-window -v -c \"#{pane-current_path}\"";
}
{
key = "c";
action = "select-pane -L";
}
{
key = "t";
action = "select-pane -D";
}
{
key = "s";
action = "select-pane -U";
}
{
key = "r";
action = "select-pane -R";
}
{
key = "f";
action = "resize-pane -Z";
}
{
key = ".";
action = "switch-client -T pane-resize";
}
];
"pane-resize" = [
{
key = "c";
action = "resize-pane -L 5\\; switch-client -T pane-resize";
}
{
key = "t";
action = "resize-pane -D 5\\; switch-client -T pane-resize";
}
{
key = "s";
action = "resize-pane -U 5\\; switch-client -T pane-resize";
}
{
key = "r";
action = "resize-pane -R 5\\; switch-client -T pane-resize";
}
{
key = "C";
action = "resize-pane -L\\; switch-client -T pane-resize";
}
{
key = "T";
action = "resize-pane -D\\; switch-client -T pane-resize";
}
{
key = "S";
action = "resize-pane -U\\; switch-client -T pane-resize";
}
{
key = "R";
action = "resize-pane -R\\; switch-client -T pane-resize";
}
];
windows = [
{
key = "c";
action = "new-window";
}
{
key = "n";
action = "next-window";
}
{
key = "p";
action = "previous-window";
}
{
key = "r";
action = "command-prompt \"rename-window '%%'\"";
}
{
key = "\\\"";
action = "select-window -t :=1";
}
{
key = "«";
action = "select-window -t :=2";
}
{
key = "»";
action = "select-window -t :=3";
}
{
key = "(";
action = "select-window -t :=4";
}
{
key = ")";
action = "select-window -t :=5";
}
{
key = "@";
action = "select-window -t :=6";
}
{
key = "+";
action = "select-window -t :=7";
}
{
key = "-";
action = "select-window -t :=8";
}
{
key = "/";
action = "select-window -t :=9";
}
{
key = "*";
action = "select-window -t :=10";
}
];
"copy-mode-vi" = [
{
key = "v";
action = "send-keys -X begin-selection";
}
{
key = "C-v";
action = "send-keys -X rectangle-toggle";
}
{
key = "y";
action = "send-keys -X copy-selection-and-cancel";
}
{
key = "C";
action = "send-keys -X top-line";
}
{
key = "J";
action = "send-keys -X jump-to-backward";
}
{
key = "S";
action = "send-keys -X scroll-up";
}
{
key = "R";
action = "send-keys -X bottom-line";
}
{
key = "T";
action = "send-keys -X scroll-down";
}
{
key = "c";
action = "send-keys -X cursor-left";
}
{
key = "t";
action = "send-keys -X cursor-down";
}
{
key = "s";
action = "send-keys -X cursor-up";
}
{
key = "r";
action = "send-keys -X cursor-right";
}
];
};
};
}