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