Reorganize host confs by system type
This commit is contained in:
parent
3e17f6abb5
commit
b82457b8f5
14 changed files with 44 additions and 71 deletions
97
flake.nix
97
flake.nix
|
@ -30,69 +30,42 @@
|
|||
}:
|
||||
{
|
||||
nixosConfigurations =
|
||||
(
|
||||
let
|
||||
x86_64-hosts =
|
||||
with builtins;
|
||||
(map (file: nixpkgs.lib.removeSuffix ".nix" file) (
|
||||
filter (file: file != "aarch64-linux" && file != "installer") (attrNames (readDir ./hosts))
|
||||
));
|
||||
in
|
||||
builtins.listToAttrs (
|
||||
map (
|
||||
host:
|
||||
nixpkgs.lib.nameValuePair host (
|
||||
nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {
|
||||
nixpkgs-flake = nixpkgs;
|
||||
inherit nixvim;
|
||||
inherit disko;
|
||||
};
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
{ networking.hostName = host; }
|
||||
./default.nix
|
||||
./hosts/${host}.nix
|
||||
let
|
||||
hosts =
|
||||
with builtins;
|
||||
nixpkgs.lib.lists.flatten (
|
||||
map (
|
||||
system:
|
||||
map (host: {
|
||||
system = system;
|
||||
name = nixpkgs.lib.strings.removeSuffix ".nix" host;
|
||||
}) (attrNames (readDir ./hosts/${system}))
|
||||
) (attrNames (readDir ./hosts))
|
||||
);
|
||||
in
|
||||
builtins.listToAttrs (
|
||||
map (
|
||||
host:
|
||||
nixpkgs.lib.nameValuePair host.name (
|
||||
nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {
|
||||
nixpkgs-flake = nixpkgs;
|
||||
inherit nixvim;
|
||||
inherit disko;
|
||||
};
|
||||
system = host.system;
|
||||
modules = [
|
||||
{ networking.hostName = host.name; }
|
||||
./default.nix
|
||||
./hosts/${host.system}/${host.name}.nix
|
||||
|
||||
disko.nixosModules.disko
|
||||
impermanence.nixosModules.impermanence
|
||||
sops-nix.nixosModules.sops
|
||||
];
|
||||
}
|
||||
)
|
||||
) x86_64-hosts
|
||||
)
|
||||
)
|
||||
// (
|
||||
let
|
||||
aarch64-linux-hosts =
|
||||
with builtins;
|
||||
(map (file: nixpkgs.lib.removeSuffix ".nix" file) (attrNames (readDir ./hosts/aarch64-linux)));
|
||||
in
|
||||
builtins.listToAttrs (
|
||||
map (
|
||||
host:
|
||||
nixpkgs.lib.nameValuePair host (
|
||||
nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {
|
||||
nixpkgs-flake = nixpkgs;
|
||||
inherit nixvim;
|
||||
inherit disko;
|
||||
};
|
||||
system = "aarch64-linux";
|
||||
modules = [
|
||||
{ networking.hostName = host; }
|
||||
./default.nix
|
||||
./hosts/aarch64-linux/${host}.nix
|
||||
|
||||
disko.nixosModules.disko
|
||||
impermanence.nixosModules.impermanence
|
||||
sops-nix.nixosModules.sops
|
||||
];
|
||||
}
|
||||
)
|
||||
) aarch64-linux-hosts
|
||||
)
|
||||
disko.nixosModules.disko
|
||||
impermanence.nixosModules.impermanence
|
||||
sops-nix.nixosModules.sops
|
||||
];
|
||||
}
|
||||
)
|
||||
) hosts
|
||||
);
|
||||
hydraJobs.hosts = builtins.mapAttrs (
|
||||
_: host: host.config.system.build.toplevel
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ ... }:
|
||||
{
|
||||
imports = [ ../disko/zfs-impermanence.nix ];
|
||||
imports = [ ../../disko/zfs-impermanence.nix ];
|
||||
|
||||
custom = {
|
||||
platform = {
|
|
@ -1,6 +1,6 @@
|
|||
{ ... }:
|
||||
{
|
||||
imports = [ ../disko/zfs-impermanence.nix ];
|
||||
imports = [ ../../disko/zfs-impermanence.nix ];
|
||||
|
||||
custom = {
|
||||
platform = {
|
|
@ -1,6 +1,6 @@
|
|||
{ ... }:
|
||||
{
|
||||
imports = [ ../disko/zfs-impermanence.nix ];
|
||||
imports = [ ../../disko/zfs-impermanence.nix ];
|
||||
|
||||
custom = {
|
||||
platform = {
|
|
@ -1,6 +1,6 @@
|
|||
{ ... }:
|
||||
{
|
||||
imports = [ ../disko/zfs-impermanence.nix ];
|
||||
imports = [ ../../disko/zfs-impermanence.nix ];
|
||||
|
||||
custom = {
|
||||
platform = {
|
|
@ -1,6 +1,6 @@
|
|||
{ ... }:
|
||||
{
|
||||
imports = [ ../disko/zfs-impermanence.nix ];
|
||||
imports = [ ../../disko/zfs-impermanence.nix ];
|
||||
|
||||
custom = {
|
||||
platform = {
|
|
@ -1,6 +1,6 @@
|
|||
{ ... }:
|
||||
{
|
||||
imports = [ ../disko/zfs-impermanence.nix ];
|
||||
imports = [ ../../disko/zfs-impermanence.nix ];
|
||||
|
||||
custom = {
|
||||
platform = {
|
|
@ -1,6 +1,6 @@
|
|||
{ ... }:
|
||||
{
|
||||
imports = [ ../disko/hetzner-zfs-impermanence.nix ];
|
||||
imports = [ ../../disko/hetzner-zfs-impermanence.nix ];
|
||||
|
||||
custom = {
|
||||
platform = {
|
|
@ -1,6 +1,6 @@
|
|||
{ ... }:
|
||||
{
|
||||
imports = [ ../disko/zfs-impermanence.nix ];
|
||||
imports = [ ../../disko/zfs-impermanence.nix ];
|
||||
|
||||
custom = {
|
||||
platform = {
|
|
@ -1,6 +1,6 @@
|
|||
{ ... }:
|
||||
{
|
||||
imports = [ ../disko/zfs-impermanence-backup.nix ];
|
||||
imports = [ ../../disko/zfs-impermanence-backup.nix ];
|
||||
|
||||
custom = {
|
||||
platform = {
|
Loading…
Add table
Add a link
Reference in a new issue