treewide: pipe /modules through flake-parts

This commit is contained in:
Max Headroom 2023-01-31 22:59:53 +01:00
parent 1f1c0554a6
commit be919cb2b3
9 changed files with 91 additions and 91 deletions

View file

@ -1,4 +1,4 @@
{ aspect, config, inputs, lib, pkgs, tools, ... }:
{ config, depot, inputs, lib, pkgs, tools, ... }:
let
inherit (tools.meta) domain;
@ -11,7 +11,7 @@ let
proxySocket = "/run/ipfs-cluster/ipfs-api-proxy.sock";
in {
imports = [
aspect.modules.ipfs-cluster
depot.nixosModules.ipfs-cluster
];
age.secrets = {

View file

@ -1,4 +1,4 @@
{ aspect, cluster, config, inputs, lib, hosts, pkgs, tools, ... }:
{ cluster, config, depot, inputs, lib, hosts, pkgs, tools, ... }:
let
inherit (tools.meta) domain;
cfg = config.services.ipfs;
@ -9,7 +9,7 @@ let
in
{
imports = [
aspect.modules.ipfs
depot.nixosModules.ipfs
];
links.ipfsGateway.protocol = "http";

View file

@ -1,4 +1,4 @@
{ aspect, cluster, config, lib, pkgs, ... }:
{ cluster, config, depot, lib, pkgs, ... }:
let
inherit (cluster.config) vars;
@ -14,7 +14,7 @@ in
{
imports = [
aspect.modules.patroni
depot.nixosModules.patroni
];
age.secrets = lib.mapAttrs (_: file: {

View file

@ -14,7 +14,6 @@
inherit (nixpkgs) lib;
aspect = import ./modules inputs;
hosts = import ./hosts;
nixosHosts' = lib.filterAttrs (_: host: host ? nixos) hosts;
@ -28,7 +27,8 @@
meta = import ./tools/meta.nix;
specialArgs = {
inherit inputs hosts aspect;
inherit inputs hosts;
depot = inputs.self;
toolsets = import ./tools;
};
mkNixOS' = lib: name: let host = hosts.${name}; in lib.nixosSystem {
@ -78,8 +78,6 @@
in flake-parts.lib.mkFlake { inherit inputs; } {
inherit systems;
flake = {
nixosModules = aspect.modules;
nixosConfigurations = lib.genAttrs nixosHosts mkNixOS;
deploy.nodes = mkDeployments deployableNixosHosts {};
@ -89,6 +87,7 @@
imports = [
inputs.drv-parts.flakeModule
inputs.dream2nix.flakeModuleBeta
./modules/part.nix
./packages/part.nix
];
};

View file

@ -1,4 +1,4 @@
{ aspect, config, hosts, inputs, tools, ... }:
{ config, depot, hosts, inputs, tools, ... }:
{
imports =
@ -40,12 +40,13 @@
./services/warehouse
./services/websites
./services/wireguard-server
aspect.modules.hyprspace
aspect.modules.nix-builder
]
depot.nixosModules.hyprspace
depot.nixosModules.nix-builder
depot.nixosModules.backboneBase
];
# TODO: fix users
# ++ (import ../../users "server").groups.admin
++ aspect.sets.backbone;
# Use the GRUB 2 boot loader.
boot.loader.grub.enable = true;

View file

@ -1,4 +1,4 @@
{ aspect, inputs, hosts, ... }:
{ inputs, depot, hosts, ... }:
{
imports =
@ -8,13 +8,12 @@
inputs.agenix.nixosModules.age
aspect.modules.hyprspace
aspect.modules.nix-builder
aspect.modules.sss
depot.nixosModules.hyprspace
depot.nixosModules.nix-builder
depot.nixosModules.sss
]
++ aspect.sets.server;
depot.nixosModules.serverBase
];
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;

View file

@ -1,12 +1,12 @@
{ aspect, hosts, ... }:
{ depot, hosts, ... }:
{
imports = with aspect; [
modules.fail2ban
modules.nix-config-server
modules.sss
imports = with depot.nixosModules; [
containerBase
fail2ban
sss
./soda.nix
] ++ sets.base ++ sets.networking;
];
boot.isContainer = true;

View file

@ -1,63 +0,0 @@
inputs:
with builtins;
let
aspects = {
autopatch = import ./autopatch;
consul-service-registry = import ./consul-service-registry;
deploy-rs-receiver = import ./deploy-rs-receiver;
enterprise = import ./enterprise;
fail2ban = import ./fail2ban;
hydra = import ./hydra;
hyprspace = import ./hyprspace;
ipfs = import ./ipfs;
ipfs-cluster = import ./ipfs-cluster;
maintenance = import ./maintenance;
minimal = import ./minimal;
motd = import ./motd;
nix-builder = import ./nix-builder;
nix-config-server = import ./nix-config/server.nix;
nix-register-flakes = import ./nix-register-flakes;
patroni = import ./patroni;
port-magic = import ./port-magic;
shell-config = import ./shell-config;
ssh = import ./ssh;
sss = import ./sss;
system-info = import ./system-info;
system-recovery = import ./system-recovery;
tested = import ./tested;
};
in rec {
modules = aspects;
sets = with modules; rec {
base = [
autopatch
enterprise
maintenance
minimal
];
networking = [
port-magic
ssh
];
server = [
consul-service-registry
deploy-rs-receiver
fail2ban
motd
nix-config-server
system-info
system-recovery
tested
] ++ base ++ networking;
container = [
nix-config-server
] ++ base ++ networking;
backbone = server ++ [
sss
];
};
}

64
modules/part.nix Normal file
View file

@ -0,0 +1,64 @@
{ config, ... }:
let
group = imports: { inherit imports; };
in
{
flake.nixosModules = with config.flake.nixosModules; {
autopatch = ./autopatch;
consul-service-registry = ./consul-service-registry;
deploy-rs-receiver = ./deploy-rs-receiver;
enterprise = ./enterprise;
fail2ban = ./fail2ban;
hydra = ./hydra;
hyprspace = ./hyprspace;
ipfs = ./ipfs;
ipfs-cluster = ./ipfs-cluster;
maintenance = ./maintenance;
minimal = ./minimal;
motd = ./motd;
nix-builder = ./nix-builder;
nix-config-server = ./nix-config/server.nix;
nix-register-flakes = ./nix-register-flakes;
patroni = ./patroni;
port-magic = ./port-magic;
shell-config = ./shell-config;
ssh = ./ssh;
sss = ./sss;
system-info = ./system-info;
system-recovery = ./system-recovery;
tested = ./tested;
machineBase = group [
autopatch
enterprise
maintenance
minimal
port-magic
ssh
];
serverBase = group [
machineBase
consul-service-registry
deploy-rs-receiver
fail2ban
motd
nix-config-server
system-info
system-recovery
tested
];
containerBase = group [
machineBase
nix-config-server
];
backboneBase = group [
serverBase
sss
];
};
}