meta: Revert combining mobile-nixos flake

This was causing a lot of issues unfortunately presumably due to things
not working with the aarch64 PinePhone system. Random errors like
"expected string 'D'" were common and I'd rather use a separate flake to
make things easier to debug and keep evaluation times to a minimum.
This commit is contained in:
Donovan Glover 2024-06-15 10:46:45 -04:00
parent 8ceb1bf511
commit a629f92827
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
11 changed files with 204 additions and 114 deletions

17
flake.lock generated
View File

@ -183,22 +183,6 @@
"type": "github"
}
},
"mobile-nixos": {
"flake": false,
"locked": {
"lastModified": 1715627339,
"narHash": "sha256-HJ6V7hc64iBqXlZ8kH4sXmUzPH+0Hn6wYURmZmL5LFk=",
"owner": "NixOS",
"repo": "mobile-nixos",
"rev": "655c8830d5fe2eae79c8fc0bab8033b34c8456eb",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "mobile-nixos",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1718297587,
@ -218,7 +202,6 @@
"root": {
"inputs": {
"home-manager": "home-manager",
"mobile-nixos": "mobile-nixos",
"nixpkgs": "nixpkgs",
"sakaya": "sakaya",
"stylix": "stylix"

View File

@ -19,14 +19,9 @@
url = "github:donovanglover/sakaya";
inputs.nixpkgs.follows = "nixpkgs";
};
mobile-nixos = {
url = "github:NixOS/mobile-nixos";
flake = false;
};
};
outputs = { self, nixpkgs, mobile-nixos, ... } @ attrs:
outputs = { self, nixpkgs, ... } @ attrs:
let
inherit (nixpkgs.lib) nixosSystem;
inherit (nixpkgs.legacyPackages.x86_64-linux) nixpkgs-fmt callPackage;
@ -52,10 +47,7 @@
name =
if file == "laptop.nix"
then "nixos"
else
if file == "phone.nix"
then "mobile-nixos"
else replaceStrings [ ".nix" ] [ "" ] file;
else replaceStrings [ ".nix" ] [ "" ] file;
value =
if directory == "packages"
then callPackage ./${directory}/${file} { }
@ -72,27 +64,12 @@
then
nixosSystem
{
system =
if file == "phone.nix"
then "aarch64-linux"
else "x86_64-linux";
system = "x86_64-linux";
specialArgs = attrs // { nix-config = self; };
modules =
[
./${file}
./${directory}/${file}
] ++ nixpkgs.lib.optionals (file == "phone.nix") [
(import "${mobile-nixos}/lib/configuration.nix" {
device = "pine64-pinephone";
})
{
mobile.beautification = {
silentBoot = nixpkgs.lib.mkDefault true;
splash = nixpkgs.lib.mkDefault true;
};
}
];
modules = [
./.
./${directory}/${file}
];
}
else import ./${directory}/${file};
})

View File

@ -3,7 +3,7 @@
let
inherit (lib) mkEnableOption mkIf mkMerge mkOption;
inherit (lib.types) str float int;
inherit (config.modules.system) username phone;
inherit (config.modules.system) username;
inherit (cfg) bloat gnome plasma container theme opacity fontSize graphical;
inherit (nix-config.packages.${pkgs.system}) aleo-fonts;
inherit (pkgs) phinger-cursors noto-fonts-cjk-sans maple-mono noto-fonts-emoji;
@ -15,7 +15,6 @@ in
imports = attrValues {
inherit (nix-config.inputs.home-manager.nixosModules) home-manager;
inherit (nix-config.inputs.stylix.nixosModules) stylix;
};
options.modules.desktop = {
@ -42,22 +41,11 @@ in
};
config = {
hardware = {
opengl.driSupport32Bit = mkIf (!phone) true;
pulseaudio = mkIf phone {
enable = true;
package = pkgs.pulseaudioFull;
};
bluetooth.enable = mkIf phone true;
sensor.iio.enable = mkIf phone true;
};
hardware.opengl.driSupport32Bit = true;
programs = {
hyprland.enable = mkIf (!container && !phone) true;
hyprland.enable = mkIf (!container) true;
cdemu.enable = true;
calls.enable = mkIf phone true;
thunar = {
enable = true;
@ -68,7 +56,7 @@ in
};
};
i18n.inputMethod = mkIf (!phone) {
i18n.inputMethod = {
enabled = "fcitx5";
fcitx5 = {
@ -86,15 +74,9 @@ in
xserver = mkIf (!container || graphical) {
enable = true;
excludePackages = [ pkgs.xterm ];
desktopManager.phosh = mkIf phone {
enable = true;
user = username;
group = "users";
};
};
pipewire = mkIf (!phone) {
pipewire = {
enable = true;
alsa = {
@ -105,7 +87,7 @@ in
pulse.enable = true;
};
greetd = mkIf (!container && !phone) {
greetd = mkIf (!container) {
enable = true;
restart = false;
@ -151,13 +133,6 @@ in
;
}))
(mkIf phone (attrValues {
inherit (pkgs)
chatty
megapixels
;
}))
(attrValues {
inherit (pkgs) anki kanjidraw pulseaudio glib;
inherit (nix-config.inputs.sakaya.packages.${pkgs.system}) sakaya;

View File

@ -3,7 +3,7 @@
let
inherit (lib) mkOption mkEnableOption mkIf singleton;
inherit (lib.types) nullOr str listOf;
inherit (cfg) username iHaveLotsOfRam hashedPassword mullvad allowSRB2Port allowDevPort noRoot postgres phone;
inherit (cfg) username iHaveLotsOfRam hashedPassword mullvad allowSRB2Port allowDevPort noRoot postgres;
inherit (builtins) attrValues;
cfg = config.modules.system;
@ -46,8 +46,6 @@ in
iHaveLotsOfRam = mkEnableOption "tmpfs on /tmp";
phone = mkEnableOption "PinePhone support";
hostName = mkOption {
type = str;
default = "nixos";
@ -125,19 +123,7 @@ in
isNormalUser = true;
uid = 1000;
password = mkIf (hashedPassword == null && !noRoot) username;
extraGroups =
if noRoot
then [ ]
else
if phone
then [
"dialout"
"feedbackd"
"networkmanager"
"video"
"wheel"
]
else [ "wheel" "networkmanager" ];
extraGroups = if noRoot then [ ] else [ "wheel" "networkmanager" ];
};
};

View File

@ -1,19 +0,0 @@
{ self, pkgs, ... }:
let
inherit (builtins) attrValues;
in
{
imports = attrValues self.nixosModules;
nixpkgs.overlays = attrValues self.overlays;
home-manager.sharedModules = attrValues self.homeManagerModules;
environment.systemPackages = attrValues self.packages.${pkgs.system};
modules = {
system = {
phone = true;
hostName = "mobile-nixos";
stateVersion = "23.11";
};
};
}

75
phone/configuration.nix Normal file
View File

@ -0,0 +1,75 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
neovim
fish
yazi
bat
w3m
librewolf
git
htop
gnupg
mpv
ncmpcpp
pqiv
qutebrowser
starship
eza
fd
fzf
ripgrep
yt-dlp
neofetch
genact
zellij
p7zip
unar
];
programs.fish.enable = true;
programs.neovim.enable = true;
users.defaultUserShell = pkgs.fish;
environment.shells = [ pkgs.fish ];
networking = {
hostName = "mobile-nixos";
wireless.enable = false;
networkmanager.enable = true;
};
hardware = {
pulseaudio = {
enable = true;
package = pkgs.pulseaudioFull;
};
bluetooth.enable = true;
};
powerManagement.enable = true;
zramSwap.enable = true;
nix.settings.experimental-features = [ "nix-command" "flakes" "repl-flake" ];
services.xserver.desktopManager.phosh = {
user = "user";
};
users.users."user" = {
isNormalUser = true;
description = "User";
password = "user";
extraGroups = [
"dialout"
"feedbackd"
"networkmanager"
"video"
"wheel"
];
};
system.stateVersion = "23.11";
}

44
phone/flake.lock generated Normal file
View File

@ -0,0 +1,44 @@
{
"nodes": {
"mobile-nixos": {
"flake": false,
"locked": {
"lastModified": 1715627339,
"narHash": "sha256-HJ6V7hc64iBqXlZ8kH4sXmUzPH+0Hn6wYURmZmL5LFk=",
"owner": "NixOS",
"repo": "mobile-nixos",
"rev": "655c8830d5fe2eae79c8fc0bab8033b34c8456eb",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "mobile-nixos",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1718160348,
"narHash": "sha256-9YrUjdztqi4Gz8n3mBuqvCkMo4ojrA6nASwyIKWMpus=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "57d6973abba7ea108bac64ae7629e7431e0199b6",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"mobile-nixos": "mobile-nixos",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

29
phone/flake.nix Normal file
View File

@ -0,0 +1,29 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
mobile-nixos = {
url = "github:NixOS/mobile-nixos";
flake = false;
};
};
outputs = { self, nixpkgs, mobile-nixos } @ attrs:
{
nixosConfigurations = {
mobile-nixos = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
specialArgs = attrs;
modules = [
(import "${mobile-nixos}/lib/configuration.nix" {
device = "pine64-pinephone";
})
./configuration.nix
./hardware-configuration.nix
./phosh.nix
];
};
};
};
}

View File

@ -1,4 +1,5 @@
{ lib, ... }:
# NOTE: this file was generated by the Mobile NixOS installer.
{ config, lib, pkgs, ... }:
{
fileSystems = {

39
phone/phosh.nix Normal file
View File

@ -0,0 +1,39 @@
#
# This file represents safe opinionated defaults for a basic Phosh system.
#
# NOTE: this file and any it imports **have** to be safe to import from
# an end-user's config.
#
{ config, lib, pkgs, options, ... }:
{
mobile.beautification = {
silentBoot = lib.mkDefault true;
splash = lib.mkDefault true;
};
services.xserver.desktopManager.phosh = {
enable = true;
group = "users";
};
programs.calls.enable = true;
environment.systemPackages = with pkgs; [
chatty # IM and SMS
epiphany # Web browser
gnome-console # Terminal
megapixels # Camera
];
hardware.sensor.iio.enable = true;
assertions = [
{ assertion = options.services.xserver.desktopManager.phosh.user.isDefined;
message = ''
`services.xserver.desktopManager.phosh.user` not set.
When importing the phosh configuration in your system, you need to set `services.xserver.desktopManager.phosh.user` to the username of the session user.
'';
}
];
}