[NixOS] Run alejandra on flake.nix

This commit is contained in:
2025-11-25 19:45:56 -08:00
parent 493bd42966
commit 8799310710

View File

@@ -30,6 +30,9 @@
railbird-secrets = {
url = "git+ssh://gitea@dev.railbird.ai:1123/railbird/secrets-flake.git";
};
# railbird-secrets = {
# url = "git+ssh://gitea@dev.railbird.ai:1123/railbird/secrets-flake.git";
# };
xmonad = {
url = "github:xmonad/xmonad";
@@ -110,10 +113,20 @@
};
outputs = inputs @ {
self, nixpkgs, nixos-hardware, home-manager, taffybar, xmonad, nixtheplanet,
xmonad-contrib, notifications-tray-icon, nix, agenix, imalison-taffybar, ...
}:
let
self,
nixpkgs,
nixos-hardware,
home-manager,
taffybar,
xmonad,
nixtheplanet,
xmonad-contrib,
notifications-tray-icon,
nix,
agenix,
imalison-taffybar,
...
}: let
machinesFilepath = ./machines;
machineFilenames = builtins.attrNames (builtins.readDir machinesFilepath);
machineNameFromFilename = filename: builtins.head (builtins.split "\\." filename);
@@ -122,7 +135,9 @@
name = machineNameFromFilename filename;
value = {
modules = [
(machinesFilepath + ("/" + filename)) agenix.nixosModules.default nixtheplanet.nixosModules.macos-ventura
(machinesFilepath + ("/" + filename))
agenix.nixosModules.default
nixtheplanet.nixosModules.macos-ventura
];
};
};
@@ -136,14 +151,13 @@
system = "aarch64-linux";
};
};
mkConfig =
{ system ? "x86_64-linux"
, baseModules ? []
, modules ? []
, specialArgs ? {}
, ...
}:
let
mkConfig = {
system ? "x86_64-linux",
baseModules ? [],
modules ? [],
specialArgs ? {},
...
}: let
# Bootstrap nixpkgs for this specific system
bootstrapPkgs = import nixpkgs {
inherit system;
@@ -154,8 +168,7 @@
patchedSource = bootstrapPkgs.applyPatches {
name = "nixpkgs-patched";
src = nixpkgs;
patches =
map bootstrapPkgs.fetchpatch [
patches = map bootstrapPkgs.fetchpatch [
# Rumno service PR
{
url = "https://github.com/NixOS/nixpkgs/pull/433540.patch";
@@ -164,16 +177,12 @@
# git-sync-rs package
{
url = "https://patch-diff.githubusercontent.com/raw/NixOS/nixpkgs/pull/434160.patch";
hash = "sha256-Tiz2ydzlWbxx7jW32afN0RBvmXnsbt7lUvj/RUkpNbc=";
hash = "sha256-zjzjmC1XJmwfHr/YXFyYsqUFR5MHSoxWWyxIR35YNbM=";
}
{
url = "https://patch-diff.githubusercontent.com/raw/NixOS/nixpkgs/pull/436061.patch";
hash = "sha256-HZquaNBB+w5Hm5kdzvaGg7QAOgAf/EPBO7o7pKkIrMY=";
}
# {
# url = "https://patch-diff.githubusercontent.com/raw/NixOS/nixpkgs/pull/462960.patch";
# hash = "sha256-QZbucsuBtMfN5tYUnWT3CJTEv7hh3rqvY1tEW9VXdUs=";
# }
# claude-code: 1.0.126 -> 1.0.128
# {
# url = "https://patch-diff.githubusercontent.com/raw/NixOS/nixpkgs/pull/446609.patch";
@@ -185,6 +194,9 @@
# hash = "sha256-f7G2Ukr0N3S+au4F6KmFHxQWr6rXrlguqh+KK0Ffbfw=";
# }
];
prePatch = ''
mkdir -p pkgs/by-name/an/antigravity
'';
};
# Get eval-config from patched source
evalConfig = import "${patchedSource}/nixos/lib/eval-config.nix";
@@ -192,24 +204,27 @@
evalConfig {
inherit system;
modules = baseModules ++ modules;
specialArgs = rec {
specialArgs =
rec {
inherit inputs machineNames;
makeEnable = (import ./make-enable.nix) nixpkgs.lib;
keys = (import ./keys.nix);
keys = import ./keys.nix;
usersInfo = (import ./users.nix) {
pkgs = {zsh = "zsh";};
inherit keys inputs system;
};
realUsers = (builtins.attrNames
realUsers = (
builtins.attrNames
(nixpkgs.lib.filterAttrs
(_: value: (builtins.elem "isNormalUser" (builtins.attrNames value)) && value.isNormalUser) usersInfo.users.users)
(_: value: (builtins.elem "isNormalUser" (builtins.attrNames value)) && value.isNormalUser)
usersInfo.users.users)
);
mapAllKeysToValue = keys: value: builtins.listToAttrs (map (name: {inherit name value;}) keys);
forEachUser = mapAllKeysToValue realUsers;
} // specialArgs;
}
// specialArgs;
};
in
{
in {
nixConfig = {
substituters = [
"https://cache.nixos.org/"
@@ -226,12 +241,16 @@
"flox-cache-public-1:7F4OyH7ZCnFhcze3fJdfyXYLQw/aV7GEed86nQ7IsOs="
];
};
nixosConfigurations = builtins.mapAttrs (machineName: params:
let machineParams =
nixosConfigurations =
builtins.mapAttrs (
machineName: params: let
machineParams =
if builtins.hasAttr machineName customParams
then (builtins.getAttr machineName customParams)
else {};
in mkConfig (params // machineParams)
) defaultConfigurationParams;
in
mkConfig (params // machineParams)
)
defaultConfigurationParams;
};
}