pinephone-img target which boots phosh with nmcli support

This commit is contained in:
colin 2022-06-15 01:52:38 -07:00
parent a4fd43c1ae
commit 79ca636ac7
7 changed files with 134 additions and 5 deletions

View File

@ -1,5 +1,24 @@
{
"nodes": {
"home-manager": {
"inputs": {
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1654113405,
"narHash": "sha256-VpK+0QaWG2JRgB00lw77N9TjkE3ec0iMYIX1TzGpxa4=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "ac2287df5a2d6f0a44bbcbd11701dbbf6ec43675",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-22.05",
"repo": "home-manager",
"type": "github"
}
},
"mobile-nixos": {
"flake": false,
"locked": {
@ -18,6 +37,20 @@
}
},
"nixpkgs": {
"locked": {
"lastModified": 1655239344,
"narHash": "sha256-5Va2Qmy50AspTfyHvoWrwCpTuqArOg9LnvRPe8YW5no=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9ef09e06806e79e32e30d17aee6879d69c011037",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1653060744,
"narHash": "sha256-kfRusllRumpt33J1hPV+CeCCylCXEU7e0gn2/cIM7cY=",
@ -34,8 +67,9 @@
},
"root": {
"inputs": {
"home-manager": "home-manager",
"mobile-nixos": "mobile-nixos",
"nixpkgs": "nixpkgs"
"nixpkgs": "nixpkgs_2"
}
}
},

View File

@ -7,18 +7,18 @@
url = "github:nixos/mobile-nixos/efbe2c3c5409c868309ae0770852638e623690b5";
flake = false;
};
home-manager.url = "github:nix-community/home-manager/release-22.05";
};
outputs = { self, nixpkgs, mobile-nixos }: {
outputs = { self, nixpkgs, mobile-nixos, home-manager }: {
pinephone-img = (nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
specialArgs = { inherit home-manager; };
modules = [
(import "${mobile-nixos}/lib/configuration.nix" {
device = "pine64-pinephone";
})
({ ... }: {
nixpkgs.config.allowUnfree = true;
})
./modules/default.nix
];
}).config.mobile.outputs.u-boot.disk-image;
};

12
modules/default.nix Normal file
View File

@ -0,0 +1,12 @@
{ ... }:
{
imports = [
./hardware.nix
./home-manager.nix
./phosh.nix
./users.nix
];
system.stateVersion = "22.05";
nixpkgs.config.allowUnfree = true;
}

8
modules/hardware.nix Normal file
View File

@ -0,0 +1,8 @@
{ ... }:
{
## enable the hardware rotation sensor
hardware.sensor.iio.enable = true;
hardware.opengl.enable = true;
hardware.opengl.driSupport = true;
}

37
modules/home-manager.nix Normal file
View File

@ -0,0 +1,37 @@
{ pkgs, home-manager, ... }:
{
imports = [
home-manager.nixosModule
];
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.colin = {
home.stateVersion = "21.11";
home.username = "colin";
home.homeDirectory = "/home/colin";
programs = {
home-manager.enable = true;
firefox.enable = true;
git.enable = true;
};
# a few useful packages to start with
home.packages = with pkgs; [
# useful CLI/admin tools to have during setup
fatresize
gptfdisk
networkmanager
sudo
vim
wget
# it's good to have a variety of terminals (x11, Qt, GTK) to handle more failures
xterm
plasma5Packages.konsole
gnome.gnome-terminal
];
};
}

13
modules/phosh.nix Normal file
View File

@ -0,0 +1,13 @@
{ ... }:
{
services.xserver.desktopManager.phosh = {
enable = true;
user = "colin";
group = "users";
};
environment.variables = {
# Qt apps won't always start unless this env var is set
QT_QPA_PLATFORM = "wayland";
};
}

25
modules/users.nix Normal file
View File

@ -0,0 +1,25 @@
{ ... }:
{
users.mutableUsers = false;
users.users.colin = {
isNormalUser = true;
home = "/home/colin";
uid = 1000;
# make this numeric so that you can enter it in the phosh lockscreen.
# DON'T leave this empty: not all greeters support passwordless users.
initialPassword = "147147";
extraGroups = [ "wheel" ];
};
security.sudo = {
enable = true;
wheelNeedsPassword = false;
};
services.openssh = {
enable = true;
permitRootLogin = "no";
passwordAuthentication = true;
};
}