mirror of
https://github.com/donovanglover/nix-config.git
synced 2025-06-19 17:28:49 +02:00
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:
parent
8ceb1bf511
commit
a629f92827
17
flake.lock
generated
17
flake.lock
generated
@ -183,22 +183,6 @@
|
|||||||
"type": "github"
|
"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": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1718297587,
|
"lastModified": 1718297587,
|
||||||
@ -218,7 +202,6 @@
|
|||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"mobile-nixos": "mobile-nixos",
|
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"sakaya": "sakaya",
|
"sakaya": "sakaya",
|
||||||
"stylix": "stylix"
|
"stylix": "stylix"
|
||||||
|
37
flake.nix
37
flake.nix
@ -19,14 +19,9 @@
|
|||||||
url = "github:donovanglover/sakaya";
|
url = "github:donovanglover/sakaya";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
mobile-nixos = {
|
|
||||||
url = "github:NixOS/mobile-nixos";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, mobile-nixos, ... } @ attrs:
|
outputs = { self, nixpkgs, ... } @ attrs:
|
||||||
let
|
let
|
||||||
inherit (nixpkgs.lib) nixosSystem;
|
inherit (nixpkgs.lib) nixosSystem;
|
||||||
inherit (nixpkgs.legacyPackages.x86_64-linux) nixpkgs-fmt callPackage;
|
inherit (nixpkgs.legacyPackages.x86_64-linux) nixpkgs-fmt callPackage;
|
||||||
@ -52,10 +47,7 @@
|
|||||||
name =
|
name =
|
||||||
if file == "laptop.nix"
|
if file == "laptop.nix"
|
||||||
then "nixos"
|
then "nixos"
|
||||||
else
|
else replaceStrings [ ".nix" ] [ "" ] file;
|
||||||
if file == "phone.nix"
|
|
||||||
then "mobile-nixos"
|
|
||||||
else replaceStrings [ ".nix" ] [ "" ] file;
|
|
||||||
value =
|
value =
|
||||||
if directory == "packages"
|
if directory == "packages"
|
||||||
then callPackage ./${directory}/${file} { }
|
then callPackage ./${directory}/${file} { }
|
||||||
@ -72,27 +64,12 @@
|
|||||||
then
|
then
|
||||||
nixosSystem
|
nixosSystem
|
||||||
{
|
{
|
||||||
system =
|
system = "x86_64-linux";
|
||||||
if file == "phone.nix"
|
|
||||||
then "aarch64-linux"
|
|
||||||
else "x86_64-linux";
|
|
||||||
specialArgs = attrs // { nix-config = self; };
|
specialArgs = attrs // { nix-config = self; };
|
||||||
modules =
|
modules = [
|
||||||
[
|
./.
|
||||||
./${file}
|
./${directory}/${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;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
else import ./${directory}/${file};
|
else import ./${directory}/${file};
|
||||||
})
|
})
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
let
|
let
|
||||||
inherit (lib) mkEnableOption mkIf mkMerge mkOption;
|
inherit (lib) mkEnableOption mkIf mkMerge mkOption;
|
||||||
inherit (lib.types) str float int;
|
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 (cfg) bloat gnome plasma container theme opacity fontSize graphical;
|
||||||
inherit (nix-config.packages.${pkgs.system}) aleo-fonts;
|
inherit (nix-config.packages.${pkgs.system}) aleo-fonts;
|
||||||
inherit (pkgs) phinger-cursors noto-fonts-cjk-sans maple-mono noto-fonts-emoji;
|
inherit (pkgs) phinger-cursors noto-fonts-cjk-sans maple-mono noto-fonts-emoji;
|
||||||
@ -15,7 +15,6 @@ in
|
|||||||
imports = attrValues {
|
imports = attrValues {
|
||||||
inherit (nix-config.inputs.home-manager.nixosModules) home-manager;
|
inherit (nix-config.inputs.home-manager.nixosModules) home-manager;
|
||||||
inherit (nix-config.inputs.stylix.nixosModules) stylix;
|
inherit (nix-config.inputs.stylix.nixosModules) stylix;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
options.modules.desktop = {
|
options.modules.desktop = {
|
||||||
@ -42,22 +41,11 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
hardware = {
|
hardware.opengl.driSupport32Bit = true;
|
||||||
opengl.driSupport32Bit = mkIf (!phone) true;
|
|
||||||
|
|
||||||
pulseaudio = mkIf phone {
|
|
||||||
enable = true;
|
|
||||||
package = pkgs.pulseaudioFull;
|
|
||||||
};
|
|
||||||
|
|
||||||
bluetooth.enable = mkIf phone true;
|
|
||||||
sensor.iio.enable = mkIf phone true;
|
|
||||||
};
|
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
hyprland.enable = mkIf (!container && !phone) true;
|
hyprland.enable = mkIf (!container) true;
|
||||||
cdemu.enable = true;
|
cdemu.enable = true;
|
||||||
calls.enable = mkIf phone true;
|
|
||||||
|
|
||||||
thunar = {
|
thunar = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -68,7 +56,7 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
i18n.inputMethod = mkIf (!phone) {
|
i18n.inputMethod = {
|
||||||
enabled = "fcitx5";
|
enabled = "fcitx5";
|
||||||
|
|
||||||
fcitx5 = {
|
fcitx5 = {
|
||||||
@ -86,15 +74,9 @@ in
|
|||||||
xserver = mkIf (!container || graphical) {
|
xserver = mkIf (!container || graphical) {
|
||||||
enable = true;
|
enable = true;
|
||||||
excludePackages = [ pkgs.xterm ];
|
excludePackages = [ pkgs.xterm ];
|
||||||
|
|
||||||
desktopManager.phosh = mkIf phone {
|
|
||||||
enable = true;
|
|
||||||
user = username;
|
|
||||||
group = "users";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pipewire = mkIf (!phone) {
|
pipewire = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
alsa = {
|
alsa = {
|
||||||
@ -105,7 +87,7 @@ in
|
|||||||
pulse.enable = true;
|
pulse.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
greetd = mkIf (!container && !phone) {
|
greetd = mkIf (!container) {
|
||||||
enable = true;
|
enable = true;
|
||||||
restart = false;
|
restart = false;
|
||||||
|
|
||||||
@ -151,13 +133,6 @@ in
|
|||||||
;
|
;
|
||||||
}))
|
}))
|
||||||
|
|
||||||
(mkIf phone (attrValues {
|
|
||||||
inherit (pkgs)
|
|
||||||
chatty
|
|
||||||
megapixels
|
|
||||||
;
|
|
||||||
}))
|
|
||||||
|
|
||||||
(attrValues {
|
(attrValues {
|
||||||
inherit (pkgs) anki kanjidraw pulseaudio glib;
|
inherit (pkgs) anki kanjidraw pulseaudio glib;
|
||||||
inherit (nix-config.inputs.sakaya.packages.${pkgs.system}) sakaya;
|
inherit (nix-config.inputs.sakaya.packages.${pkgs.system}) sakaya;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
let
|
let
|
||||||
inherit (lib) mkOption mkEnableOption mkIf singleton;
|
inherit (lib) mkOption mkEnableOption mkIf singleton;
|
||||||
inherit (lib.types) nullOr str listOf;
|
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;
|
inherit (builtins) attrValues;
|
||||||
|
|
||||||
cfg = config.modules.system;
|
cfg = config.modules.system;
|
||||||
@ -46,8 +46,6 @@ in
|
|||||||
|
|
||||||
iHaveLotsOfRam = mkEnableOption "tmpfs on /tmp";
|
iHaveLotsOfRam = mkEnableOption "tmpfs on /tmp";
|
||||||
|
|
||||||
phone = mkEnableOption "PinePhone support";
|
|
||||||
|
|
||||||
hostName = mkOption {
|
hostName = mkOption {
|
||||||
type = str;
|
type = str;
|
||||||
default = "nixos";
|
default = "nixos";
|
||||||
@ -125,19 +123,7 @@ in
|
|||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
uid = 1000;
|
uid = 1000;
|
||||||
password = mkIf (hashedPassword == null && !noRoot) username;
|
password = mkIf (hashedPassword == null && !noRoot) username;
|
||||||
extraGroups =
|
extraGroups = if noRoot then [ ] else [ "wheel" "networkmanager" ];
|
||||||
if noRoot
|
|
||||||
then [ ]
|
|
||||||
else
|
|
||||||
if phone
|
|
||||||
then [
|
|
||||||
"dialout"
|
|
||||||
"feedbackd"
|
|
||||||
"networkmanager"
|
|
||||||
"video"
|
|
||||||
"wheel"
|
|
||||||
]
|
|
||||||
else [ "wheel" "networkmanager" ];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
19
phone.nix
19
phone.nix
@ -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
75
phone/configuration.nix
Normal 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
44
phone/flake.lock
generated
Normal 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
29
phone/flake.nix
Normal 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
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
@ -1,4 +1,5 @@
|
|||||||
{ lib, ... }:
|
# NOTE: this file was generated by the Mobile NixOS installer.
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
fileSystems = {
|
fileSystems = {
|
39
phone/phosh.nix
Normal file
39
phone/phosh.nix
Normal 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.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user