{ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; home-manager = { url = "github:nix-community/home-manager/release-24.05"; inputs.nixpkgs.follows = "nixpkgs"; }; flake-compat.url = "github:edolstra/flake-compat"; oisd = { url = "github:sjhgvr/oisd"; flake = false; }; }; outputs = inputs @ { self, nixpkgs, nixpkgs-unstable, home-manager, ... }: let systems = { x86 = "x86_64-linux"; arm = "aarch64-linux"; }; machines = with systems; [ { name = "corsac"; system = x86; } { name = "lapin"; system = arm; } { name = "renard"; system = x86; } ]; packageSetsForSystem = system: let pkgsInputs = { inherit system; config = import ./config.nix; }; in rec { pkgs = import nixpkgs pkgsInputs; unstablePkgs = import nixpkgs-unstable pkgsInputs; auxiliaryPkgs = import ./pkgs { inherit system pkgs unstablePkgs; }; }; inherit (nixpkgs) lib; in { nixosConfigurations = lib.mergeAttrsList (map (machine: { ${machine.name} = nixpkgs.lib.nixosSystem { inherit (machine) system; specialArgs = inputs // (packageSetsForSystem machine.system) // { me = machine.name; security = import ./security.nix; util = import ./util.nix { inherit lib; }; }; modules = [ ./machines/${machine.name} home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.users.mel = import ./machines/${machine.name}/home.nix; } ]; }; }) machines); # compatibility wrapper for nixos-option legacyPackages = lib.genAttrs (lib.attrValues systems) (system: with packageSetsForSystem system; pkgs.recurseIntoAttrs pkgs); }; }