chore: reformat codebase

This commit is contained in:
Gabriel Arazas 2024-01-06 19:10:54 +08:00
parent 7f3f83c757
commit 1957df91ea
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
3 changed files with 168 additions and 161 deletions

View File

@ -79,6 +79,21 @@
outputs = inputs@{ self, nixpkgs, ... }:
let
# A set of image-related utilities for the flake outputs.
inherit (import ./lib/extras/images.nix { inherit lib inputs; }) mkHost mkHome mkImage listImagesWithSystems;
# We're considering this as the variant since we'll export the custom
# library as `lib` in the output attribute.
lib = nixpkgs.lib.extend (import ./lib/extras/extend-lib.nix);
# Just add systems here and it should add systems to the outputs.
defaultSystem = "x86_64-linux";
systems = [
"x86_64-linux"
"aarch64-linux"
];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
# A set of images with their metadata that is usually built for usual
# purposes. The format used here is whatever formats nixos-generators
# support.
@ -88,29 +103,13 @@
# A set of users with their metadata to be deployed with home-manager.
users = import ./setups/home-manager.nix { inherit lib inputs; };
# A set of image-related utilities for the flake outputs.
inherit (import ./lib/extras/images.nix { inherit lib inputs; }) mkHost mkHome mkImage listImagesWithSystems;
# The order here is important(?).
overlays = lib.attrValues self.overlays;
defaultSystem = "x86_64-linux";
# Just add systems here and it should add systems to the outputs.
systems = [
"x86_64-linux"
"aarch64-linux"
];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
extraArgs = {
inherit (inputs) nix-colors;
};
# We're considering this as the variant since we'll export the custom
# library as `lib` in the output attribute.
lib = nixpkgs.lib.extend (import ./lib/extras/extend-lib.nix);
# The shared configuration for the entire list of hosts for this cluster.
# Take note to only set as minimal configuration as possible since we're
# also using this with the stable version of nixpkgs.
@ -365,7 +364,8 @@
};
in
{
apps = forAllSystems (system: let
apps = forAllSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{

View File

@ -206,7 +206,8 @@ let
};
};
config = let
config =
let
scriptName = "${session.name}-${name}-script";
script = "${config.scriptPackage}/bin/${scriptName}";
in
@ -508,7 +509,8 @@ let
inherit (utils.systemdUtils.lib)
pathToUnit serviceToUnit targetToUnit timerToUnit socketToUnit;
componentsUnits =
lib.foldlAttrs (acc: name: component:
lib.foldlAttrs
(acc: name: component:
acc // {
"${component.id}.service" = serviceToUnit component.id component.serviceUnit;
"${component.id}.target" = targetToUnit component.id component.targetUnit;
@ -519,7 +521,8 @@ let
} // lib.optionalAttrs (component.pathUnit != null) {
"${component.id}.path" = pathToUnit component.id component.pathUnit;
})
{} config.components;
{ }
config.components;
in
componentsUnits // {
"gnome-session@${name}.target" = targetToUnit "gnome-session@${name}" config.targetUnit;
@ -585,10 +588,13 @@ let
'';
};
installDesktopSessions = builtins.map (display:
displayScripts.${display}) config.display;
installDesktopSessions = builtins.map
(display:
displayScripts.${display})
config.display;
installSystemdUserUnits = lib.mapAttrsToList (n: v:
installSystemdUserUnits = lib.mapAttrsToList
(n: v:
if (v ? overrideStrategy && v.overrideStrategy == "asDropin") then ''
(
unit="${v.unit}/${n}"
@ -597,7 +603,8 @@ let
)
'' else ''
install -Dm0644 "${v.unit}/${n}" -t "$out/share/systemd/user"
'') config.systemdUserUnits;
'')
config.systemdUserUnits;
installDesktops = lib.mapAttrsToList
(_: p: ''