flake.nix 637 B

123456789101112131415161718192021
  1. {
  2. description = "system config";
  3. inputs.nixpkgs.url = github:nixos/nixpkgs/nixos-unstable;
  4. outputs = { nixpkgs, nix, self, ... }@inputs: {
  5. nixosConfigurations = with nixpkgs.lib;
  6. let
  7. flakeInputs = inputs;
  8. hosts = map (fname: builtins.head (builtins.match "(.*)\\.nix" fname))
  9. (builtins.attrNames (builtins.readDir ./nixos/devices));
  10. mkHost = deviceName:
  11. nixosSystem {
  12. system = "x86_64-linux";
  13. modules = [ (import ./nixos/config.nix) ];
  14. specialArgs = { inherit flakeInputs deviceName; };
  15. };
  16. in genAttrs hosts mkHost;
  17. };
  18. }