Skip to content
This repository has been archived by the owner on Jan 1, 2025. It is now read-only.

Commit

Permalink
feat: add pinephone and vf2 support
Browse files Browse the repository at this point in the history
  • Loading branch information
RossComputerGuy committed Apr 30, 2024
1 parent 0a6e8b4 commit e114bb4
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 19 deletions.
30 changes: 24 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 33 additions & 9 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nixos-hardware.url = "github:NixOS/nixos-hardware";
nixos-mobile = {
url = "github:RossComputerGuy/mobile-nixos/fix/impure";
flake = false;
};
flake-utils.url = "github:numtide/flake-utils";
};

outputs = {
self,
nixpkgs,
nixos-hardware,
nixos-mobile,
flake-utils,
...
}@inputs:
Expand Down Expand Up @@ -53,27 +58,46 @@
};
})) // {
nixosConfigurations = let
mkQemu = system:
mkSystem = modules: system:
let
pkgs = self.legacyPackages.${system};
inherit (nixpkgs) lib;
in lib.nixosSystem {
inherit system lib pkgs;

modules = [
"${nixpkgs}/nixos/modules/virtualisation/qemu-vm.nix"
modules = modules ++ [
./nix/module.nix
{
config = {
system.name = "qemu-${pkgs.targetPlatform.qemuArch}";
boot.kernelParams = lib.mkAfter [ "console=ttyS0" ];
};
}
];
};

mkMobileSystem = device: system:
let
pkgs = self.legacyPackages.${system};
inherit (nixpkgs) lib;
in import "${nixos-mobile}" {
inherit system pkgs device;
configuration = import ./nix/module.nix;
};

mkQemu = system: mkSystem [
"${nixpkgs}/nixos/modules/virtualisation/qemu-vm.nix"
{
config = {
system.name = "qemu-${self.legacyPackages.${system}.targetPlatform.qemuArch}";
boot.kernelParams = nixpkgs.lib.mkAfter [ "console=ttyS0" ];
};
}
] system;
in {
qemu-aarch64 = mkQemu "aarch64-linux";
qemu-x86_64 = mkQemu "x86_64-linux";

starfive-visionfive-2 = mkSystem [
nixos-hardware.nixosModules.starfive-visionfive-2
{ config.system.name = "starfive-visionfive-2"; }
] "riscv64-linux";

pine64-pinephone = mkMobileSystem "pine64-pinephone" "aarch64-linux";
};
};
}
11 changes: 7 additions & 4 deletions nix/module.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
{ config, lib, pkgs, ... }:
{
config = {
services.cage = {
enable = true;
program = lib.getExe pkgs.expidus.genesis-shell;
services = {
cage = {
enable = true;
program = lib.getExe pkgs.expidus.genesis-shell;
};
accounts-daemon.enable = true;
};

users.users.${config.services.cage.user} = {
initialPassword = config.services.cage.user;
initialPassword = "123456";
isNormalUser = true;
};

Expand Down

0 comments on commit e114bb4

Please sign in to comment.