2023-05-04 19:09:45 +02:00
|
|
|
{
|
|
|
|
inputs = {
|
2024-06-25 03:03:17 +02:00
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
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-06-15 18:37:15 +02:00
|
|
|
flakeOutputs = [ "overlays" "nixosModules" "homeManagerModules" "packages" "checks" ];
|
|
|
|
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-06-15 19:18:15 +02:00
|
|
|
modules = phoneModules ++ [
|
|
|
|
{
|
|
|
|
boot.loader.systemd-boot.enable = true;
|
|
|
|
}
|
|
|
|
];
|
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-04-05 17:26:22 +02:00
|
|
|
attributeValue = (listToAttrs
|
|
|
|
(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};
|
|
|
|
})
|
|
|
|
(attrNames (readDir ./${directory}))));
|
|
|
|
|
|
|
|
aarch64Packages = (listToAttrs
|
|
|
|
(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
|
|
|
})
|
|
|
|
(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
|
|
|
|
(attributeSet);
|
|
|
|
})
|
2024-04-01 21:29:40 +02:00
|
|
|
(flakeOutputs)));
|
2023-05-04 19:09:45 +02:00
|
|
|
}
|