setup repo structure (& test system config)

This commit is contained in:
lilly 2025-01-25 22:24:37 +01:00
commit 67c2250833
Signed by: lilly
SSH key fingerprint: SHA256:y9T5GFw2A20WVklhetIxG1+kcg/Ce0shnQmbu1LQ37g
12 changed files with 573 additions and 0 deletions

41
systems/default.nix Normal file
View file

@ -0,0 +1,41 @@
{ flake }:
let
nixpkgs = flake.inputs.nixpkgs;
# utility function to create a new nixos configuration
# call like `mkSystem "x86_64-linux" "<hostname>.eh22.intern"`
mkSystem =
systemType: name:
nixpkgs.lib.nixosSystem {
system = systemType;
specialArgs = flake.inputs;
modules = [
flake.inputs.home-manager.nixosModules.home-manager
flake.inputs.sops-nix.nixosModules.default
flake.inputs.lix.nixosModules.lixFromNixpkgs
../modules/base_system.nix
../modules/user_account.nix
#../modules/mail_relay.nix
./${name}.nix
(
let
fqdnParts = nixpkgs.lib.strings.splitString "." name;
in
{
networking.hostName = builtins.head fqdnParts;
networking.domain =
if ((builtins.length fqdnParts) > 1) then
(builtins.concatStringsSep "." (builtins.tail fqdnParts))
else
null;
}
)
];
};
in
{
# exposed hosts at myroot
"test.eh22.intern" = mkSystem "x86_64-linux" "test.eh22.intern";
}