feat: Add machine configurations

This commit is contained in:
Jalil David Salamé Messina 2024-01-15 12:57:59 +01:00
parent 80587b5f82
commit 2d11a56619
Signed by: jalil
GPG key ID: F016B9E770737A0B
7 changed files with 278 additions and 2 deletions

View file

@ -21,8 +21,10 @@
inputs.flake-schemas.url = "https://flakehub.com/f/DeterminateSystems/flake-schemas/*.tar.gz";
inputs.nixos-hardware.url = "https://flakehub.com/f/NixOS/nixos-hardware/0.1.*.tar.gz";
# Flake outputs that other flakes can use
outputs = { flake-schemas, nixpkgs, stylix, home-manager, home-config, ... }:
outputs = { flake-schemas, nixpkgs, stylix, home-manager, home-config, nixos-hardware, ... }:
let
inherit (nixpkgs) lib;
# Helpers for producing system-specific outputs
@ -55,10 +57,17 @@
# Pin nixpkgs
nix.registry.nixpkgs.flake = nixpkgs;
};
machines = [ "capricorn" "gemini" "vm" ];
mkMachine = hostname: {
imports = [ nixosModule (import ./machine + "${hostname}" nixos-hardware) ];
home-manager.sharedModules = [{ jhome.hostName = hostname; }];
};
machineModules = lib.genAttrs machines mkMachine;
in
{
default = nixosModule;
inherit nixosModule;
};
} // machineModules;
};
}