flake: Merge phone flake with nix-config

This makes sense to avoid having to cd into the phone directory before
being able to do anything.

Note that this time we aren't trying to combine the phone config with
the existing nix modules to keep things simple.
This commit is contained in:
Donovan Glover 2024-06-15 12:42:02 -04:00
parent 0384654ee4
commit ad506d827e
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
4 changed files with 53 additions and 92 deletions

View File

@ -183,6 +183,22 @@
"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,
@ -202,6 +218,7 @@
"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"

View File

@ -19,9 +19,14 @@
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, ... } @ attrs: outputs = { self, nixpkgs, mobile-nixos, ... } @ 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;
@ -32,6 +37,12 @@
in in
{ {
nixosConfigurations = nixosConfigurations =
let
phoneModules = [
./phone/configuration.nix
./phone/hardware-configuration.nix
];
in
{ {
nixos = nixosSystem { nixos = nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
@ -42,6 +53,30 @@
./hardware/laptop.nix ./hardware/laptop.nix
]; ];
}; };
mobile-nixos = nixosSystem {
system = "aarch64-linux";
specialArgs = attrs;
modules = phoneModules ++ [
(import "${mobile-nixos}/lib/configuration.nix" {
device = "pine64-pinephone";
})
{
mobile.beautification = {
silentBoot = true;
splash = true;
};
}
];
};
mobile-nixos-vm = nixosSystem {
system = "x86_64-linux";
specialArgs = attrs;
modules = phoneModules;
};
}; };
formatter.x86_64-linux = nixpkgs-fmt; formatter.x86_64-linux = nixpkgs-fmt;

View File

@ -1,44 +0,0 @@
{
"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
}

View File

@ -1,47 +0,0 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
mobile-nixos = {
url = "github:NixOS/mobile-nixos";
flake = false;
};
};
outputs = { self, nixpkgs, mobile-nixos } @ attrs:
{
nixosConfigurations =
let
modules = [
./configuration.nix
./hardware-configuration.nix
];
in
{
mobile-nixos = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
specialArgs = attrs;
modules = modules ++ [
(import "${mobile-nixos}/lib/configuration.nix" {
device = "pine64-pinephone";
})
{
mobile.beautification = {
silentBoot = nixpkgs.lib.mkDefault true;
splash = nixpkgs.lib.mkDefault true;
};
}
];
};
mobile-nixos-vm = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = attrs;
inherit modules;
};
};
};
}