2023-05-04 19:09:45 +02:00
|
|
|
{
|
|
|
|
inputs = {
|
2024-08-27 19:24:35 +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-08-13 20:28:59 +02:00
|
|
|
url = "github:donovanglover/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-08-03 18:17:31 +02:00
|
|
|
url = "github:donovanglover/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-08-03 20:42:39 +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-01 17:48:10 +02:00
|
|
|
|
2024-08-03 20:42:39 +02:00
|
|
|
inherit (builtins)
|
|
|
|
attrNames
|
|
|
|
listToAttrs
|
|
|
|
map
|
|
|
|
replaceStrings
|
|
|
|
readDir
|
|
|
|
;
|
|
|
|
|
|
|
|
flakeOutputs = [
|
|
|
|
"overlays"
|
|
|
|
"nixosModules"
|
|
|
|
"homeModules"
|
|
|
|
"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";
|
2024-08-03 20:42:39 +02:00
|
|
|
|
|
|
|
specialArgs = attrs // {
|
|
|
|
nix-config = self;
|
|
|
|
};
|
2024-06-15 18:37:15 +02:00
|
|
|
|
|
|
|
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-08-03 20:42:39 +02:00
|
|
|
|
|
|
|
specialArgs = attrs // {
|
|
|
|
nix-config = self;
|
|
|
|
};
|
2024-06-15 18:42:02 +02:00
|
|
|
|
|
|
|
modules = phoneModules ++ [
|
2024-08-27 16:58:05 +02:00
|
|
|
(import "${mobile-nixos}/lib/configuration.nix" {
|
|
|
|
device = "pine64-pinephone";
|
|
|
|
})
|
2024-06-15 18:42:02 +02:00
|
|
|
|
|
|
|
{
|
|
|
|
mobile.beautification = {
|
|
|
|
silentBoot = true;
|
|
|
|
splash = true;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
mobile-nixos-vm = nixosSystem {
|
|
|
|
system = "x86_64-linux";
|
2024-08-03 20:42:39 +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-08-11 02:55:04 +02:00
|
|
|
formatter = {
|
|
|
|
x86_64-linux = x86_64-linux.nixfmt-rfc-style;
|
|
|
|
aarch64-linux = aarch64-linux.nixfmt-rfc-style;
|
|
|
|
};
|
2024-08-03 20:42:39 +02:00
|
|
|
}
|
|
|
|
// (listToAttrs (
|
|
|
|
map (attributeName: {
|
|
|
|
name = attributeName;
|
|
|
|
value =
|
|
|
|
let
|
|
|
|
directory = replaceStrings flakeOutputs flakeDirectories attributeName;
|
|
|
|
|
|
|
|
attributeValue = listToAttrs (
|
|
|
|
map (file: {
|
|
|
|
name = replaceStrings [ ".nix" ] [ "" ] file;
|
|
|
|
value =
|
|
|
|
if directory == "packages" then
|
|
|
|
x86_64-linux.callPackage ./${directory}/${file} { }
|
|
|
|
else if directory == "tests" then
|
|
|
|
import ./${directory}/${file} {
|
|
|
|
inherit self;
|
|
|
|
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} { } else null;
|
|
|
|
}) (attrNames (readDir ./${directory}))
|
|
|
|
);
|
|
|
|
|
|
|
|
attributeSet =
|
|
|
|
if directory == "packages" then
|
|
|
|
{
|
2024-06-16 18:21:59 +02:00
|
|
|
x86_64-linux = attributeValue;
|
|
|
|
aarch64-linux = aarch64Packages;
|
|
|
|
}
|
2024-08-03 20:42:39 +02:00
|
|
|
else if directory == "tests" then
|
|
|
|
{ x86_64-linux = attributeValue; }
|
|
|
|
else
|
|
|
|
attributeValue;
|
|
|
|
in
|
|
|
|
attributeSet;
|
|
|
|
}) flakeOutputs
|
|
|
|
));
|
2023-05-04 19:09:45 +02:00
|
|
|
}
|