2023-05-04 19:09:45 +02:00
|
|
|
{
|
|
|
|
inputs = {
|
2024-08-01 19:45:44 +02:00
|
|
|
nixpkgs.url = "github:donovanglover/nixpkgs/unstable-phosh-0.40.0";
|
2023-06-06 01:26:46 +02:00
|
|
|
|
2023-05-17 05:07:14 +02:00
|
|
|
home-manager = {
|
2024-06-13 11:16:45 +02:00
|
|
|
url = "github:nix-community/home-manager";
|
2023-05-17 05:07:14 +02:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2023-06-06 01:26:46 +02:00
|
|
|
|
2023-05-17 05:07:14 +02:00
|
|
|
stylix = {
|
2024-07-05 20:09:52 +02:00
|
|
|
url = "github:danth/stylix";
|
2023-05-17 05:35:52 +02:00
|
|
|
inputs = {
|
|
|
|
nixpkgs.follows = "nixpkgs";
|
|
|
|
home-manager.follows = "home-manager";
|
|
|
|
};
|
2023-05-17 05:07:14 +02:00
|
|
|
};
|
2023-08-08 20:08:41 +02:00
|
|
|
|
|
|
|
sakaya = {
|
|
|
|
url = "github:donovanglover/sakaya";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2024-06-15 18:42:02 +02:00
|
|
|
|
|
|
|
mobile-nixos = {
|
2024-06-28 00:45:36 +02:00
|
|
|
url = "github:donovanglover/mobile-nixos";
|
2024-06-15 18:42:02 +02:00
|
|
|
flake = false;
|
|
|
|
};
|
2023-06-21 08:41:38 +02:00
|
|
|
};
|
2023-06-06 01:26:46 +02:00
|
|
|
|
2024-06-15 18:42:02 +02:00
|
|
|
outputs = { self, nixpkgs, mobile-nixos, ... } @ attrs:
|
2024-04-05 17:26:22 +02:00
|
|
|
let
|
|
|
|
inherit (nixpkgs.lib) nixosSystem;
|
2024-06-16 18:21:19 +02:00
|
|
|
inherit (nixpkgs.legacyPackages) x86_64-linux aarch64-linux;
|
2024-04-06 01:20:27 +02:00
|
|
|
inherit (builtins) attrNames listToAttrs map replaceStrings readDir;
|
2024-04-01 17:48:10 +02:00
|
|
|
|
2024-07-19 01:41:23 +02:00
|
|
|
flakeOutputs = [ "overlays" "nixosModules" "homeModules" "packages" "checks" ];
|
2024-06-15 18:37:15 +02:00
|
|
|
flakeDirectories = [ "overlays" "modules" "home" "packages" "tests" ];
|
2024-04-05 17:26:22 +02:00
|
|
|
in
|
|
|
|
{
|
2024-06-15 18:37:15 +02:00
|
|
|
nixosConfigurations =
|
2024-06-15 18:42:02 +02:00
|
|
|
let
|
|
|
|
phoneModules = [
|
2024-06-21 03:34:26 +02:00
|
|
|
./hosts/phone/configuration.nix
|
|
|
|
./hosts/phone/hardware-configuration.nix
|
2024-06-15 18:42:02 +02:00
|
|
|
];
|
|
|
|
in
|
2024-06-15 18:37:15 +02:00
|
|
|
{
|
|
|
|
nixos = nixosSystem {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
specialArgs = attrs // { nix-config = self; };
|
|
|
|
|
|
|
|
modules = [
|
2024-06-21 03:34:26 +02:00
|
|
|
./hosts/laptop/configuration.nix
|
|
|
|
./hosts/laptop/hardware-configuration.nix
|
2024-06-15 18:37:15 +02:00
|
|
|
];
|
|
|
|
};
|
2024-06-15 18:42:02 +02:00
|
|
|
|
|
|
|
mobile-nixos = nixosSystem {
|
|
|
|
system = "aarch64-linux";
|
2024-06-19 05:58:29 +02:00
|
|
|
specialArgs = attrs // { nix-config = self; };
|
2024-06-15 18:42:02 +02:00
|
|
|
|
|
|
|
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";
|
2024-06-19 05:58:29 +02:00
|
|
|
specialArgs = attrs // { nix-config = self; };
|
2024-07-18 23:49:55 +02:00
|
|
|
modules = phoneModules;
|
2024-06-15 18:42:02 +02:00
|
|
|
};
|
2024-06-15 18:37:15 +02:00
|
|
|
};
|
|
|
|
|
2024-06-16 18:21:19 +02:00
|
|
|
formatter.x86_64-linux = x86_64-linux.nixpkgs-fmt;
|
|
|
|
formatter.aarch64-linux = aarch64-linux.nixpkgs-fmt;
|
2024-04-05 17:26:22 +02:00
|
|
|
} //
|
2024-04-04 23:55:46 +02:00
|
|
|
(listToAttrs
|
|
|
|
(map
|
2024-04-01 17:05:08 +02:00
|
|
|
(attributeName: {
|
|
|
|
name = attributeName;
|
2024-04-05 17:26:22 +02:00
|
|
|
value =
|
|
|
|
let
|
|
|
|
directory = replaceStrings flakeOutputs flakeDirectories attributeName;
|
2024-04-06 04:51:24 +02:00
|
|
|
|
2024-08-03 07:51:58 +02:00
|
|
|
attributeValue = listToAttrs
|
2024-04-05 17:26:22 +02:00
|
|
|
(map
|
|
|
|
(file: {
|
2024-06-15 18:37:15 +02:00
|
|
|
name = replaceStrings [ ".nix" ] [ "" ] file;
|
2024-04-06 04:51:24 +02:00
|
|
|
value =
|
2024-04-08 16:33:06 +02:00
|
|
|
if directory == "packages"
|
2024-06-16 18:21:59 +02:00
|
|
|
then x86_64-linux.callPackage ./${directory}/${file} { }
|
2024-04-08 16:33:06 +02:00
|
|
|
else
|
|
|
|
if directory == "tests"
|
2024-04-17 19:54:28 +02:00
|
|
|
then
|
|
|
|
import ./${directory}/${file}
|
|
|
|
{
|
|
|
|
inherit self;
|
2024-06-16 18:21:59 +02:00
|
|
|
pkgs = x86_64-linux;
|
|
|
|
}
|
|
|
|
else import ./${directory}/${file};
|
|
|
|
})
|
2024-08-03 07:51:58 +02:00
|
|
|
(attrNames (readDir ./${directory})));
|
2024-06-16 18:21:59 +02:00
|
|
|
|
2024-08-03 07:51:58 +02:00
|
|
|
aarch64Packages = listToAttrs
|
2024-06-16 18:21:59 +02:00
|
|
|
(map
|
|
|
|
(file: {
|
|
|
|
name = replaceStrings [ ".nix" ] [ "" ] file;
|
|
|
|
value =
|
|
|
|
if directory == "packages"
|
|
|
|
then aarch64-linux.callPackage ./${directory}/${file} { }
|
2024-06-20 23:27:37 +02:00
|
|
|
else null;
|
2024-04-05 17:26:22 +02:00
|
|
|
})
|
2024-08-03 07:51:58 +02:00
|
|
|
(attrNames (readDir ./${directory})));
|
2024-04-06 04:51:24 +02:00
|
|
|
|
|
|
|
attributeSet =
|
2024-06-20 22:15:15 +02:00
|
|
|
if directory == "packages"
|
2024-06-16 18:21:59 +02:00
|
|
|
then {
|
|
|
|
x86_64-linux = attributeValue;
|
|
|
|
aarch64-linux = aarch64Packages;
|
|
|
|
}
|
2024-06-20 22:15:15 +02:00
|
|
|
else
|
|
|
|
if directory == "tests"
|
|
|
|
then {
|
|
|
|
x86_64-linux = attributeValue;
|
|
|
|
}
|
|
|
|
else attributeValue;
|
2024-04-05 17:26:22 +02:00
|
|
|
in
|
2024-08-03 07:51:58 +02:00
|
|
|
attributeSet;
|
2024-04-05 17:26:22 +02:00
|
|
|
})
|
2024-08-03 07:51:58 +02:00
|
|
|
flakeOutputs));
|
2023-05-04 19:09:45 +02:00
|
|
|
}
|