refactoring repository structure
This commit is contained in:
parent
655787822b
commit
e805743afb
|
@ -1 +1,2 @@
|
||||||
result
|
result
|
||||||
|
*.qcow2
|
||||||
|
|
|
@ -16,6 +16,7 @@ The Nix Mail setup to rule them all.
|
||||||
|
|
||||||
## Testing Locally
|
## Testing Locally
|
||||||
|
|
||||||
|
Using Qemu as supervisor.
|
||||||
``
|
``
|
||||||
$ nix build
|
$ nix build
|
||||||
``
|
``
|
||||||
|
|
|
@ -1,17 +1,15 @@
|
||||||
{ pkgs, lib, ... }:
|
# Edit this configuration file to define what should be installed on
|
||||||
{
|
# your system. Help is available in the configuration.nix(5) man page
|
||||||
boot.isContainer = true;
|
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||||
boot.loader.initScript.enable = true;
|
|
||||||
|
|
||||||
networking = {
|
{ config, pkgs, lib, ... }:
|
||||||
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" ];
|
imports =
|
||||||
hostName = lib.mkDefault "mailtngbert";
|
[
|
||||||
useDHCP = false;
|
./modules/base.nix
|
||||||
interfaces.eth0.useDHCP = false;
|
./modules/network.nix
|
||||||
firewall.allowedTCPPorts = [ 22 ];
|
];
|
||||||
};
|
|
||||||
|
|
||||||
nix = {
|
nix = {
|
||||||
useSandbox = false;
|
useSandbox = false;
|
||||||
|
@ -19,6 +17,8 @@
|
||||||
package = pkgs.nixFlakes;
|
package = pkgs.nixFlakes;
|
||||||
};
|
};
|
||||||
|
|
||||||
services.openssh.enable = true;
|
time.timeZone = "Europe/Berlin";
|
||||||
environment.systemPackages = with pkgs; [ neovim git ];
|
system.stateVersion = "20.11";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
descripton = "Testing Nix Email-Setup for C3D2";
|
description = "Testing Nix Email-Setup for C3D2";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = github:NixOS/nixpkgs/nixos-21.11;
|
nixpkgs.url = github:NixOS/nixpkgs/nixos-21.11;
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
specialArgs = { inherit inputs; };
|
specialArgs = { inherit inputs; };
|
||||||
modules = [
|
modules = [
|
||||||
simple-nixos-mailserver.nixosModule
|
simple-nixos-mailserver.nixosModule
|
||||||
./mailbert/configuration.nix
|
./configuration.nix
|
||||||
|
|
||||||
(_: { _module.args.buildVM = true; })
|
(_: { _module.args.buildVM = true; })
|
||||||
"${nixpkgs}/nixos/modules/virtualisation/qemu-vm.nix"
|
"${nixpkgs}/nixos/modules/virtualisation/qemu-vm.nix"
|
||||||
|
@ -27,7 +27,8 @@
|
||||||
specialArgs = { inherit inputs; };
|
specialArgs = { inherit inputs; };
|
||||||
modules = [
|
modules = [
|
||||||
simple-nixos-mailserver.nixosModule
|
simple-nixos-mailserver.nixosModule
|
||||||
./mailbert/configuration.nix
|
./configuration.nix
|
||||||
|
./modules/proxmox.nix
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
BIN
mailbert.qcow2
BIN
mailbert.qcow2
Binary file not shown.
|
@ -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. It‘s 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?
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
@ -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 = [ ];
|
|
||||||
|
|
||||||
}
|
|
|
@ -3,14 +3,6 @@
|
||||||
{
|
{
|
||||||
_module.args.buildVM = false;
|
_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 = {
|
users.users.root = {
|
||||||
openssh.authorizedKeys.keyFiles = [
|
openssh.authorizedKeys.keyFiles = [
|
||||||
./keys/revol-xut
|
./keys/revol-xut
|
||||||
|
|
|
@ -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 ];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
{pkgs, config, lib, ... }: {
|
||||||
|
|
||||||
|
# relevant configuration for running this as lxc proxmox container
|
||||||
|
boot.isContainer = true;
|
||||||
|
boot.loader.initScript.enable = true;
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
Loading…
Reference in New Issue