1
1
Fork 1
mirror of https://github.com/oddlama/nix-config.git synced 2025-10-11 07:10:39 +02:00

refactor: remove meta.nix in favor of direct declaration in flake.nix

This commit is contained in:
oddlama 2023-04-30 14:06:25 +02:00
parent 08290e5052
commit 30cfdaf860
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
7 changed files with 26 additions and 43 deletions

View file

@ -86,7 +86,22 @@
content = import ./nix/secrets.nix inputs;
};
hosts = import ./nix/hosts.nix inputs;
hosts = {
nom = {
type = "nixos";
system = "x86_64-linux";
};
ward = {
type = "nixos";
system = "x86_64-linux";
microVmHost = true;
};
zackbiene = {
type = "nixos";
system = "aarch64-linux";
};
};
colmena = import ./nix/colmena.nix inputs;
colmenaNodes = ((colmena.lib.makeHive self.colmena).introspect (x: x)).nodes;
microvmNodes = import ./nix/microvms.nix inputs;

View file

@ -1,8 +0,0 @@
{
type = "nixos";
system = "x86_64-linux";
physicalConnections = {
"10-lan1" = "LAN 1";
"10-wlan1" = "WiFi";
};
}

View file

@ -39,6 +39,10 @@
};
};
#environment.persistence."/persist".directories = [
# { directory = "/var/lib/acme"; user = "acme"; group = "acme"; }
#];
# After importing the rpool, rollback the root system to be empty.
boot.initrd.systemd.services = {
impermanence-root = {

View file

@ -1,9 +0,0 @@
{
type = "nixos";
system = "x86_64-linux";
microVmHost = true;
physicalConnections = {
"10-lan" = "LAN";
"10-wan" = "WAN";
};
}

View file

@ -1,7 +0,0 @@
{
type = "nixos";
system = "aarch64-linux";
physicalConnections = {
"10-lan1" = "LAN 1";
};
}

View file

@ -1,15 +1,15 @@
{
self,
agenix,
agenix-rekey,
colmena,
disko,
home-manager,
#impermanence,
microvm,
nixos-hardware,
nixos-nftables-firewall,
nixpkgs,
microvm,
agenix,
agenix-rekey,
...
} @ inputs: let
inherit (nixpkgs.lib) optionals;
@ -22,23 +22,21 @@ in
inherit (self) extraLib nodes;
inherit inputs;
inherit nodeName;
inherit nodeMeta;
secrets = self.secrets.content;
nodeSecrets = self.secrets.content.nodes.${nodeName};
nixos-hardware = nixos-hardware.nixosModules;
#impermanence = impermanence.nixosModules;
};
imports =
[
(../hosts + "/${nodeName}")
home-manager.nixosModules.default
#impermanence.nixosModules.default
agenix.nixosModules.default
agenix-rekey.nixosModules.default
disko.nixosModules.disko
home-manager.nixosModules.default
#impermanence.nixosModules.default
nixos-nftables-firewall.nixosModules.default
]
++ optionals nodeMeta.microVmHost [
++ optionals (nodeMeta.microVmHost or false) [
microvm.nixosModules.host
]
++ optionals (nodeMeta.type == "microvm") [

View file

@ -1,10 +0,0 @@
{nixpkgs, ...}: let
hostDefaults = {
physicalConnections = {};
microVmHost = false;
};
in
nixpkgs.lib.concatMapAttrs (nodeName: fileType:
if fileType == "directory" && nodeName != "common"
then {${nodeName} = hostDefaults // import (../hosts + "/${nodeName}/meta.nix");}
else {}) (builtins.readDir ../hosts)