nix: Merge phone flake with nix-config

This is a part of having multiple nixosSystems for the same nix flake.
This commit is contained in:
Donovan Glover 2024-06-13 18:36:32 -04:00
parent 10d99941bb
commit b972766cc5
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
3 changed files with 14 additions and 76 deletions

View File

@ -19,6 +19,11 @@
url = "github:donovanglover/sakaya";
inputs.nixpkgs.follows = "nixpkgs";
};
mobile-nixos = {
url = "github:NixOS/mobile-nixos";
flake = false;
};
};
outputs = { self, nixpkgs, ... } @ attrs:
@ -47,7 +52,10 @@
name =
if file == "laptop.nix"
then "nixos"
else replaceStrings [ ".nix" ] [ "" ] file;
else
if file == "phone.nix"
then "mobile-nixos"
else replaceStrings [ ".nix" ] [ "" ] file;
value =
if directory == "packages"
then callPackage ./${directory}/${file} { }
@ -64,10 +72,13 @@
then
nixosSystem
{
system = "x86_64-linux";
system =
if file == "phone.nix"
then "aarch64-linux"
else "x86_64-linux";
specialArgs = attrs // { nix-config = self; };
modules = [
./.
./${file}
./${directory}/${file}
];
}

44
phone/flake.lock generated
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,29 +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 = {
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
];
};
};
};
}