flake: Properly handle mobile-nixos module import

This was necessary to avoid issues with conditional imports.
This commit is contained in:
Donovan Glover 2024-06-14 13:18:42 -04:00
parent 2bb4847198
commit 8ceb1bf511
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
2 changed files with 18 additions and 6 deletions

View File

@ -26,7 +26,7 @@
}; };
}; };
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;
@ -77,10 +77,22 @@
then "aarch64-linux" then "aarch64-linux"
else "x86_64-linux"; else "x86_64-linux";
specialArgs = attrs // { nix-config = self; }; specialArgs = attrs // { nix-config = self; };
modules = [ modules =
./${file} [
./${directory}/${file} ./${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};
}) })

View File

@ -43,7 +43,7 @@ in
config = { config = {
hardware = { hardware = {
opengl.driSupport32Bit = true; opengl.driSupport32Bit = mkIf (!phone) true;
pulseaudio = mkIf phone { pulseaudio = mkIf phone {
enable = true; enable = true;