flake: add helpers

This commit is contained in:
Aly Raffauf 2024-07-07 23:06:17 -04:00
parent 0840f43ffd
commit 97f265bd4d

View file

@ -33,19 +33,31 @@
];
};
outputs = inputs @ {self, ...}: {
formatter = inputs.nixpkgs.lib.genAttrs [
outputs = inputs @ {self, ...}: let
forDefaultSystems = inputs.nixpkgs.lib.genAttrs [
"aarch64-linux"
"x86_64-linux"
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
] (system: inputs.nixpkgs.legacyPackages.${system}.alejandra);
];
packages =
inputs.nixpkgs.lib.genAttrs [
forLinuxSystems = inputs.nixpkgs.lib.genAttrs [
"aarch64-linux"
"x86_64-linux"
] (system: {
];
forAllHosts = inputs.nixpkgs.lib.genAttrs [
"fallarbor"
"lavaridge"
"mandarin"
"mauville"
"petalburg"
"rustboro"
];
in {
formatter = forDefaultSystems (system: inputs.nixpkgs.legacyPackages.${system}.alejandra);
packages = forLinuxSystems (system: {
default = inputs.nixpkgs.legacyPackages."${system}".writeShellScriptBin "clean-install" ''
# Check if an argument is provided
if [ $# -eq 0 ]; then
@ -85,15 +97,7 @@
users = import ./userModules inputs;
};
nixosConfigurations =
inputs.nixpkgs.lib.genAttrs [
"fallarbor"
"lavaridge"
"mandarin"
"mauville"
"petalburg"
"rustboro"
] (
nixosConfigurations = forAllHosts (
host:
inputs.nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs self;};