refactoring repository structure

This commit is contained in:
Tassilo - 2022-02-24 22:28:59 +01:00
parent 655787822b
commit e805743afb
Signed by: revol-xut
GPG Key ID: 4F56FF7759627D07
15 changed files with 57 additions and 112 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
result
*.qcow2

View File

@ -16,6 +16,7 @@ The Nix Mail setup to rule them all.
## Testing Locally
Using Qemu as supervisor.
``
$ nix build
``

View File

@ -1,17 +1,15 @@
{ pkgs, lib, ... }:
{
boot.isContainer = true;
boot.loader.initScript.enable = true;
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
networking = {
interfaces.eth0.ipv4.addresses = [{ address = "172.20.73.42"; prefixLength = 26; }];
defaultGateway = "172.20.73.1";
nameservers = [ "172.20.73.8" "9.9.9.9" ];
hostName = lib.mkDefault "mailtngbert";
useDHCP = false;
interfaces.eth0.useDHCP = false;
firewall.allowedTCPPorts = [ 22 ];
};
{ config, pkgs, lib, ... }:
{
imports =
[
./modules/base.nix
./modules/network.nix
];
nix = {
useSandbox = false;
@ -19,6 +17,8 @@
package = pkgs.nixFlakes;
};
services.openssh.enable = true;
environment.systemPackages = with pkgs; [ neovim git ];
time.timeZone = "Europe/Berlin";
system.stateVersion = "20.11";
}

View File

@ -1,5 +1,5 @@
{
descripton = "Testing Nix Email-Setup for C3D2";
description = "Testing Nix Email-Setup for C3D2";
inputs = {
nixpkgs.url = github:NixOS/nixpkgs/nixos-21.11;
@ -14,7 +14,7 @@
specialArgs = { inherit inputs; };
modules = [
simple-nixos-mailserver.nixosModule
./mailbert/configuration.nix
./configuration.nix
(_: { _module.args.buildVM = true; })
"${nixpkgs}/nixos/modules/virtualisation/qemu-vm.nix"
@ -27,7 +27,8 @@
specialArgs = { inherit inputs; };
modules = [
simple-nixos-mailserver.nixosModule
./mailbert/configuration.nix
./configuration.nix
./modules/proxmox.nix
];
};
};

Binary file not shown.

View File

@ -1,58 +0,0 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, lib, ... }:
{
imports =
[ # Include the results of the hardware scan.
../modules/base.nix
../modules/mail.nix
];
boot.isContainer = true;
boot.loader.initScript.enable = true;
networking = {
interfaces.eth0.ipv4.addresses = [{ address = "172.20.73.42"; prefixLength = 26; }];
defaultGateway = "172.20.73.1";
nameservers = [ "172.20.73.8" "9.9.9.9" ];
hostName = lib.mkDefault "mailtngbert";
useDHCP = false;
interfaces.eth0.useDHCP = false;
firewall.allowedTCPPorts = [ 22 ];
};
nix = {
useSandbox = false;
extraOptions = "experimental-features = nix-command flakes";
package = pkgs.nixFlakes;
};
# Set your time zone.
time.timeZone = "Europe/Berlin";
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "20.11"; # Did you read the comment?
}

View File

@ -1,28 +0,0 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/6d8f4b96-4ccb-4a94-a9b1-bab4a28fc940";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/58C2-5A6A";
fsType = "vfat";
};
swapDevices = [ ];
}

View File

@ -3,14 +3,6 @@
{
_module.args.buildVM = false;
# use Nix 2.4 for flakes support
# nix = {
# package = pkgs.nix_2_4;
# extraOptions = ''
# experimental-features = nix-command flakes
# '';
# };
users.users.root = {
openssh.authorizedKeys.keyFiles = [
./keys/revol-xut

20
modules/network.nix Normal file
View File

@ -0,0 +1,20 @@
{pkgs, lib, ...} : {
networking = {
interfaces.eth0.ipv4.addresses = [
{
address = "172.20.73.42";
prefixLength = 26;
}
];
defaultGateway = "172.20.73.1";
nameservers = [
"172.20.73.8"
"9.9.9.9"
];
hostName = lib.mkDefault "mailtngbert";
useDHCP = false;
interfaces.eth0.useDHCP = false;
firewall.allowedTCPPorts = [ 22 ];
};
}

View File

@ -0,0 +1,6 @@
{pkgs, config, lib, ... }: {
# relevant configuration for running this as lxc proxmox container
boot.isContainer = true;
boot.loader.initScript.enable = true;
}

10
modules/sops.nix Normal file
View File

@ -0,0 +1,10 @@
{ config, lib, pkgs, inputs, ... }:
{
imports = [ inputs.sops-nix.nixosModules.sops ];
sops.defaultSopsFile = ../secrets.yaml;
sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
sops.age.keyFile = "/var/lib/sops-nix/key.txt";
sops.age.generateKey = true;
}