# your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
-{ config, lib, pkgs, ... } @ args:
+{ config, lib, pkgs, inputs, ... } @ args:
{
imports =
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nix.settings.download-buffer-size = 500000000;
- nix.package = pkgs.nixVersions.nix_2_28;
nix.gc = {
automatic = true;
sudo.wheelNeedsPassword = false;
};
- # nixpkgs.config.allowUnfree = true;
+ nixpkgs.config.allowUnfree = true;
+
+ nixpkgs.overlays = [
+ (inputs.psch-flakes.overlays.cgit)
+ ];
# List packages installed in system profile. To search, run:
# $ nix search wget
# virtualisation.qemu.guestAgent.enable = true;
programs.mosh.enable = true;
-
services.caddy = {
enable = true;
+
+ virtualHosts."tnx.sh".extraConfig = ''
+ respond "The Website is under Construction."
+ '';
virtualHosts."psch.dev".extraConfig = ''
basic_auth /julius_cam/* { test $2a$14$iKv0GlwavCunG0zQbaf2fOl4r4/8k8gDKUVUouu9Q3o.MfSDkp6Te }
root * /srv/www
request_buffers 8192
}
'';
+ virtualHosts."mail.psch.dev".extraConfig = ''
+ respond mail
+ '';
};
services.caddy.virtualHosts."git.psch.dev".extraConfig = ''
encode gzip zstd
clone-url=https://git.psch.dev/$CGIT_REPO_URL git://psch.dev/$CGIT_REPO_URL ssh://git@psch.dev/~/$CGIT_REPO_URL
noplainemail=1
side-by-side-diffs=1
+ repository-sort=age
about-filter=${pkgs.writeShellScript "markdown-filter" ''
echo '<div class="markdown-body">'
${pkgs.md4c}/bin/md2html --github --ftables
};
};
+ # Mail Server
+ mailserver = {
+ enable = true;
+ # stateVersion = 1;
+ fqdn = "mail.psch.dev";
+ domains = [ "psch.dev" ];
+
+ # A list of all login accounts. To create the password hashes, use
+ # nix-shell -p mkpasswd --run 'mkpasswd -sm bcrypt'
+ loginAccounts = {
+ "ps@psch.dev" = {
+ hashedPassword = "$2b$05$dd65mMjWxZNc.MK4YUwLgeRMInJHvwNTazptImrw4paRqyX/p4TQG";
+ aliases = ["p@psch.dev" "patrick@psch.dev"];
+ };
+ };
+
+ certificateScheme = "manual";
+ certificateFile = "/var/lib/caddy/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/mail.psch.dev/mail.psch.dev.crt";
+ keyFile = "/var/lib/caddy/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/mail.psch.dev/mail.psch.dev.key";
+ };
+ # security.acme.acceptTerms = true;
+ # security.acme.defaults.email = "patrick.schoenberger@posteo.de";
+
# Copy the NixOS configuration file and link it from the resulting system
# (/run/current-system/configuration.nix). This is useful in case you
# accidentally delete configuration.nix.
{
"nodes": {
+ "blobs": {
+ "flake": false,
+ "locked": {
+ "lastModified": 1604995301,
+ "narHash": "sha256-wcLzgLec6SGJA8fx1OEN1yV/Py5b+U5iyYpksUY/yLw=",
+ "owner": "simple-nixos-mailserver",
+ "repo": "blobs",
+ "rev": "2cccdf1ca48316f2cfd1c9a0017e8de5a7156265",
+ "type": "gitlab"
+ },
+ "original": {
+ "owner": "simple-nixos-mailserver",
+ "repo": "blobs",
+ "type": "gitlab"
+ }
+ },
"chirp": {
"inputs": {
"flake-utils": "flake-utils",
- "nixpkgs": "nixpkgs"
+ "nixpkgs": [
+ "nixpkgs"
+ ]
},
"locked": {
"lastModified": 1745404365,
"url": "git://psch.dev/chirp"
}
},
+ "flake-compat": {
+ "flake": false,
+ "locked": {
+ "lastModified": 1747046372,
+ "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
+ "owner": "edolstra",
+ "repo": "flake-compat",
+ "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
+ "type": "github"
+ },
+ "original": {
+ "owner": "edolstra",
+ "repo": "flake-compat",
+ "type": "github"
+ }
+ },
"flake-utils": {
"inputs": {
"systems": "systems"
"type": "github"
}
},
+ "flake-utils_3": {
+ "inputs": {
+ "systems": "systems_3"
+ },
+ "locked": {
+ "lastModified": 1731533236,
+ "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
+ "type": "github"
+ },
+ "original": {
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "type": "github"
+ }
+ },
+ "git-hooks": {
+ "inputs": {
+ "flake-compat": [
+ "simple-nixos-mailserver",
+ "flake-compat"
+ ],
+ "gitignore": "gitignore",
+ "nixpkgs": [
+ "simple-nixos-mailserver",
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1742649964,
+ "narHash": "sha256-DwOTp7nvfi8mRfuL1escHDXabVXFGT1VlPD1JHrtrco=",
+ "owner": "cachix",
+ "repo": "git-hooks.nix",
+ "rev": "dcf5072734cb576d2b0c59b2ac44f5050b5eac82",
+ "type": "github"
+ },
+ "original": {
+ "owner": "cachix",
+ "repo": "git-hooks.nix",
+ "type": "github"
+ }
+ },
+ "gitignore": {
+ "inputs": {
+ "nixpkgs": [
+ "simple-nixos-mailserver",
+ "git-hooks",
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1709087332,
+ "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
+ "owner": "hercules-ci",
+ "repo": "gitignore.nix",
+ "rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
+ "type": "github"
+ },
+ "original": {
+ "owner": "hercules-ci",
+ "repo": "gitignore.nix",
+ "type": "github"
+ }
+ },
"nixpkgs": {
"locked": {
- "lastModified": 1744463964,
- "narHash": "sha256-LWqduOgLHCFxiTNYi3Uj5Lgz0SR+Xhw3kr/3Xd0GPTM=",
+ "lastModified": 1751211869,
+ "narHash": "sha256-1Cu92i1KSPbhPCKxoiVG5qnoRiKTgR5CcGSRyLpOd7Y=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "2631b0b7abcea6e640ce31cd78ea58910d31e650",
+ "rev": "b43c397f6c213918d6cfe6e3550abfe79b5d1c51",
"type": "github"
},
"original": {
"owner": "NixOS",
- "ref": "nixos-unstable",
+ "ref": "nixos-25.05",
"repo": "nixpkgs",
"type": "github"
}
},
- "nixpkgs_2": {
+ "nixpkgs-25_05": {
"locked": {
- "lastModified": 1749237914,
- "narHash": "sha256-N5waoqWt8aMr/MykZjSErOokYH6rOsMMXu3UOVH5kiw=",
+ "lastModified": 1747610100,
+ "narHash": "sha256-rpR5ZPMkWzcnCcYYo3lScqfuzEw5Uyfh+R0EKZfroAc=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "70c74b02eac46f4e4aa071e45a6189ce0f6d9265",
+ "rev": "ca49c4304acf0973078db0a9d200fd2bae75676d",
"type": "github"
},
"original": {
"type": "github"
}
},
+ "psch-flakes": {
+ "inputs": {
+ "flake-utils": "flake-utils_3",
+ "nixpkgs": [
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1751534912,
+ "narHash": "sha256-UceGTTox8E1y4QNmsm7nlFXLncIBhPhONTsi6GZfdNA=",
+ "ref": "refs/heads/main",
+ "rev": "2f75d496563e6b4053f21bd9a66bc4b06b09360c",
+ "revCount": 15,
+ "type": "git",
+ "url": "git://psch.dev/flakes"
+ },
+ "original": {
+ "type": "git",
+ "url": "git://psch.dev/flakes"
+ }
+ },
"root": {
"inputs": {
"chirp": "chirp",
"flake-utils": "flake-utils_2",
- "nixpkgs": "nixpkgs_2"
+ "nixpkgs": "nixpkgs",
+ "psch-flakes": "psch-flakes",
+ "simple-nixos-mailserver": "simple-nixos-mailserver"
+ }
+ },
+ "simple-nixos-mailserver": {
+ "inputs": {
+ "blobs": "blobs",
+ "flake-compat": "flake-compat",
+ "git-hooks": "git-hooks",
+ "nixpkgs": [
+ "nixpkgs"
+ ],
+ "nixpkgs-25_05": "nixpkgs-25_05"
+ },
+ "locked": {
+ "lastModified": 1747965231,
+ "narHash": "sha256-BW3ktviEhfCN/z3+kEyzpDKAI8qFTwO7+S0NVA0C90o=",
+ "owner": "simple-nixos-mailserver",
+ "repo": "nixos-mailserver",
+ "rev": "53007af63fade28853408370c4c600a63dd97f41",
+ "type": "gitlab"
+ },
+ "original": {
+ "owner": "simple-nixos-mailserver",
+ "ref": "nixos-25.05",
+ "repo": "nixos-mailserver",
+ "type": "gitlab"
}
},
"systems": {
"repo": "default",
"type": "github"
}
+ },
+ "systems_3": {
+ "locked": {
+ "lastModified": 1681028828,
+ "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+ "owner": "nix-systems",
+ "repo": "default",
+ "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-systems",
+ "repo": "default",
+ "type": "github"
+ }
}
},
"root": "root",