[feat] Alejandra formatting

This commit is contained in:
uttarayan21
2024-03-21 21:35:51 +05:30
parent e8434fadf5
commit d5dc5a79d3
33 changed files with 699 additions and 589 deletions

157
flake.nix
View File

@@ -68,84 +68,85 @@
};
};
outputs =
{ nixpkgs
, home-manager
, nix-darwin
, flake-utils
, anyrun
, nur
, neovim-nightly-overlay
, ...
}@inputs:
let
config_devices = [
{
name = "mirai";
system = "x86_64-linux";
user = "fs0c131y";
}
{
name = "ryu";
system = "x86_64-linux";
user = "servius";
isNix = true;
}
{
name = "genzai";
system = "x86_64-linux";
user = "fs0c131y";
}
{
name = "Uttarayans-MacBook-Pro";
system = "aarch64-darwin";
user = "fs0c131y";
}
{
name = "SteamDeck";
system = "x86_64-linux";
user = "deck";
}
];
outputs = {
nixpkgs,
home-manager,
nix-darwin,
flake-utils,
anyrun,
nur,
neovim-nightly-overlay,
...
} @ inputs: let
config_devices = [
{
name = "mirai";
system = "x86_64-linux";
user = "fs0c131y";
}
{
name = "ryu";
system = "x86_64-linux";
user = "servius";
isNix = true;
}
{
name = "genzai";
system = "x86_64-linux";
user = "fs0c131y";
}
{
name = "Uttarayans-MacBook-Pro";
system = "aarch64-darwin";
user = "fs0c131y";
}
{
name = "SteamDeck";
system = "x86_64-linux";
user = "deck";
}
];
mkDevice = { device }: {
isLinux = !isNull (builtins.match ".*-linux" device.system);
isNix =
if (builtins.hasAttr "isNix" device) then device.isNix else false;
isMac = !isNull (builtins.match ".*-darwin" device.system);
system = device.system;
name = device.name;
user = device.user;
};
devices =
builtins.map (device: mkDevice { inherit device; }) config_devices;
nixos_devices = builtins.filter (x: x.isNix) devices;
linux_devices = builtins.filter (x: x.isLinux) devices;
darwin_devices = builtins.filter (x: x.isMac) devices;
overlays = import ./overlays.nix {
inherit inputs;
};
in
{
nixosConfigurations =
let devices = nixos_devices;
in import ./nixos/device.nix {
inherit devices inputs nixpkgs home-manager overlays nur;
};
darwinConfigurations =
let devices = darwin_devices;
in import ./darwin/device.nix {
inherit devices inputs nixpkgs home-manager overlays nix-darwin;
};
homeConfigurations =
let devices = linux_devices;
in import ./linux/device.nix {
inherit devices inputs nixpkgs home-manager overlays;
};
mkDevice = {device}: {
isLinux = !isNull (builtins.match ".*-linux" device.system);
isNix =
if (builtins.hasAttr "isNix" device)
then device.isNix
else false;
isMac = !isNull (builtins.match ".*-darwin" device.system);
system = device.system;
name = device.name;
user = device.user;
};
devices =
builtins.map (device: mkDevice {inherit device;}) config_devices;
nixos_devices = builtins.filter (x: x.isNix) devices;
linux_devices = builtins.filter (x: x.isLinux) devices;
darwin_devices = builtins.filter (x: x.isMac) devices;
overlays = import ./overlays.nix {inherit inputs;};
in {
nixosConfigurations = let
devices = nixos_devices;
in
import ./nixos/device.nix {
inherit devices inputs nixpkgs home-manager overlays nur;
};
darwinConfigurations = let
devices = darwin_devices;
in
import ./darwin/device.nix {
inherit devices inputs nixpkgs home-manager overlays nix-darwin;
};
homeConfigurations = let
devices = linux_devices;
in
import ./linux/device.nix {
inherit devices inputs nixpkgs home-manager overlays;
};
};
}