Compare commits
18 Commits
phoenix
...
5424bfc493
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5424bfc493 | ||
|
|
1412004174 | ||
|
|
beaceffff0 | ||
|
|
c9a5c521db | ||
|
|
0a7e0c699e | ||
|
|
0e93982125 | ||
|
|
2114c6c347 | ||
|
|
b0da60cdab | ||
|
|
0fee255cbf | ||
|
|
3fc40529c8 | ||
|
|
2ed0cade4d | ||
|
|
1d17664e7a | ||
|
|
c632cd20c6 | ||
|
|
5366c48991 | ||
|
|
6db05df6a7 | ||
|
|
52a906919d | ||
|
|
e665bb0b14 | ||
|
|
33814b565d |
141
flake.lock
generated
141
flake.lock
generated
@@ -91,6 +91,22 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"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"
|
||||||
|
}
|
||||||
|
},
|
||||||
"darwin": {
|
"darwin": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@@ -130,6 +146,22 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-compat": {
|
"flake-compat": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1761588595,
|
||||||
|
"narHash": "sha256-XKUZz9zewJNUj46b4AJdiRZJAvSZ0Dqj2BNfXvFlJC4=",
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"rev": "f387cd2afec9419c8ee37694406ca490c3f34ee5",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-compat_2": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751685974,
|
"lastModified": 1751685974,
|
||||||
@@ -224,6 +256,54 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"git-hooks": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-compat": [
|
||||||
|
"nixos-mailserver",
|
||||||
|
"flake-compat"
|
||||||
|
],
|
||||||
|
"gitignore": "gitignore",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixos-mailserver",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1763988335,
|
||||||
|
"narHash": "sha256-QlcnByMc8KBjpU37rbq5iP7Cp97HvjRP0ucfdh+M4Qc=",
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "git-hooks.nix",
|
||||||
|
"rev": "50b9238891e388c9fdc6a5c49e49c42533a1b5ce",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "git-hooks.nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"gitignore": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"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"
|
||||||
|
}
|
||||||
|
},
|
||||||
"gnome-shell": {
|
"gnome-shell": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
@@ -332,6 +412,45 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nix-zulip": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1764583012,
|
||||||
|
"narHash": "sha256-6ht4dtI1TBDAaB/Tatq+FcPexaZTBWuRiJGnioCDx5c=",
|
||||||
|
"ref": "refs/heads/main",
|
||||||
|
"rev": "a9dd0f80d775745f1d88055f24d944562db97c5e",
|
||||||
|
"revCount": 67,
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://git.afnix.fr/nix-zulip/nix-zulip"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://git.afnix.fr/nix-zulip/nix-zulip"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixos-mailserver": {
|
||||||
|
"inputs": {
|
||||||
|
"blobs": "blobs",
|
||||||
|
"flake-compat": "flake-compat",
|
||||||
|
"git-hooks": "git-hooks",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1766321686,
|
||||||
|
"narHash": "sha256-icOWbnD977HXhveirqA10zoqvErczVs3NKx8Bj+ikHY=",
|
||||||
|
"owner": "simple-nixos-mailserver",
|
||||||
|
"repo": "nixos-mailserver",
|
||||||
|
"rev": "7d433bf89882f61621f95082e90a4ab91eb0bdd3",
|
||||||
|
"type": "gitlab"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "simple-nixos-mailserver",
|
||||||
|
"repo": "nixos-mailserver",
|
||||||
|
"type": "gitlab"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1766651565,
|
"lastModified": 1766651565,
|
||||||
@@ -432,7 +551,7 @@
|
|||||||
},
|
},
|
||||||
"nvf": {
|
"nvf": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat",
|
"flake-compat": "flake-compat_2",
|
||||||
"flake-parts": "flake-parts_2",
|
"flake-parts": "flake-parts_2",
|
||||||
"mnw": "mnw",
|
"mnw": "mnw",
|
||||||
"ndg": "ndg",
|
"ndg": "ndg",
|
||||||
@@ -462,17 +581,17 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1767512451,
|
"lastModified": 1766543224,
|
||||||
"narHash": "sha256-ig5p+D8ruePISv0bbU3XUhMg4mOtpvpxYXZBKwanh2g=",
|
"narHash": "sha256-96PBoNqh3sPU9t+IXxcB1OjjuQ8HOv42OOh9UtwFHbU=",
|
||||||
"ref": "refs/heads/home-manager",
|
"owner": "celenityy",
|
||||||
"rev": "5b227c1bd23728d57376fe9009c6e1c5569593e1",
|
"repo": "Phoenix",
|
||||||
"revCount": 2515,
|
"rev": "f09568c8a71af4fe42dd43c6f711c67daf605f1e",
|
||||||
"type": "git",
|
"type": "github"
|
||||||
"url": "file:///home/andromeda/pp/forks/phoenix"
|
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"type": "git",
|
"owner": "celenityy",
|
||||||
"url": "file:///home/andromeda/pp/forks/phoenix"
|
"repo": "Phoenix",
|
||||||
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
@@ -480,6 +599,8 @@
|
|||||||
"agenix": "agenix",
|
"agenix": "agenix",
|
||||||
"home-manager": "home-manager_2",
|
"home-manager": "home-manager_2",
|
||||||
"impermanence": "impermanence",
|
"impermanence": "impermanence",
|
||||||
|
"nix-zulip": "nix-zulip",
|
||||||
|
"nixos-mailserver": "nixos-mailserver",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"noshell": "noshell",
|
"noshell": "noshell",
|
||||||
"nur": "nur",
|
"nur": "nur",
|
||||||
|
|||||||
41
flake.nix
41
flake.nix
@@ -9,7 +9,15 @@
|
|||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
impermanence.url = "github:nix-community/impermanence";
|
impermanence.url = "github:nix-community/impermanence";
|
||||||
|
nixos-mailserver = {
|
||||||
|
url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
|
nix-zulip = {
|
||||||
|
url = "git+https://git.afnix.fr/nix-zulip/nix-zulip";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
noshell = {
|
noshell = {
|
||||||
url = "github:viperML/noshell";
|
url = "github:viperML/noshell";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
@@ -23,7 +31,7 @@
|
|||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
phoenix = {
|
phoenix = {
|
||||||
url = "git+file:///home/andromeda/pp/forks/phoenix";
|
url = "github:celenityy/Phoenix";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
stylix = {
|
stylix = {
|
||||||
@@ -35,7 +43,9 @@
|
|||||||
agenix,
|
agenix,
|
||||||
home-manager,
|
home-manager,
|
||||||
impermanence,
|
impermanence,
|
||||||
|
nixos-mailserver,
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
|
nix-zulip,
|
||||||
noshell,
|
noshell,
|
||||||
nur,
|
nur,
|
||||||
nvf,
|
nvf,
|
||||||
@@ -43,6 +53,7 @@
|
|||||||
stylix,
|
stylix,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
|
nix-zulip' = (import "${nix-zulip}/nix/default.nix" {}).output;
|
||||||
machines = import ./machines.nix;
|
machines = import ./machines.nix;
|
||||||
configuration = machine: modules:
|
configuration = machine: modules:
|
||||||
nixpkgs.lib.nixosSystem {
|
nixpkgs.lib.nixosSystem {
|
||||||
@@ -51,22 +62,37 @@
|
|||||||
modules =
|
modules =
|
||||||
modules
|
modules
|
||||||
++ [
|
++ [
|
||||||
./machines/${machine.hostname}/configuration.nix
|
|
||||||
./users.nix
|
./users.nix
|
||||||
./secrets.nix
|
./secrets.nix
|
||||||
impermanence.nixosModules.impermanence
|
impermanence.nixosModules.impermanence
|
||||||
agenix.nixosModules.default
|
agenix.nixosModules.default
|
||||||
|
nixos-mailserver.nixosModule
|
||||||
|
phoenix.nixosModules.default
|
||||||
|
nix-zulip'.nixosModules.zulip
|
||||||
|
{
|
||||||
|
nixpkgs.overlays = [
|
||||||
|
agenix.overlays.default
|
||||||
|
nur.overlays.default
|
||||||
|
nix-zulip'.overlays.default
|
||||||
|
];
|
||||||
|
}
|
||||||
|
(
|
||||||
|
if machine.hostname != "109-199-104-83"
|
||||||
|
then
|
||||||
|
{config, ...}: {
|
||||||
|
imports = [
|
||||||
|
./machines/${machine.hostname}/configuration.nix
|
||||||
|
];
|
||||||
|
networking.domain = config.networking.hostName; # temporary fix
|
||||||
|
}
|
||||||
|
else {imports = machine.modules;}
|
||||||
|
)
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
configurationWithHomeManager = machine: (configuration machine
|
configurationWithHomeManager = machine: (configuration machine
|
||||||
[
|
[
|
||||||
home-manager.nixosModules.home-manager
|
home-manager.nixosModules.home-manager
|
||||||
{
|
{
|
||||||
nixpkgs.overlays = [
|
|
||||||
agenix.overlays.default
|
|
||||||
nur.overlays.default
|
|
||||||
phoenix.overlays.default
|
|
||||||
];
|
|
||||||
home-manager.useGlobalPkgs = true;
|
home-manager.useGlobalPkgs = true;
|
||||||
home-manager.extraSpecialArgs = {inherit machine;};
|
home-manager.extraSpecialArgs = {inherit machine;};
|
||||||
home-manager.users =
|
home-manager.users =
|
||||||
@@ -79,7 +105,6 @@
|
|||||||
name: {
|
name: {
|
||||||
imports = [
|
imports = [
|
||||||
agenix.homeManagerModules.default
|
agenix.homeManagerModules.default
|
||||||
phoenix.homeModules.default
|
|
||||||
stylix.homeModules.stylix
|
stylix.homeModules.stylix
|
||||||
nvf.homeManagerModules.default
|
nvf.homeManagerModules.default
|
||||||
./users/${name}/home.nix
|
./users/${name}/home.nix
|
||||||
|
|||||||
42
machines.nix
42
machines.nix
@@ -6,12 +6,50 @@
|
|||||||
"andromeda"
|
"andromeda"
|
||||||
"mtgmonkey"
|
"mtgmonkey"
|
||||||
];
|
];
|
||||||
|
modules = [
|
||||||
|
];
|
||||||
};
|
};
|
||||||
"109-199-104-83" = {
|
"109-199-104-83" = {
|
||||||
hostname = "109-199-104-83";
|
hostname = "109-199-104-83";
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
users = [
|
users = [];
|
||||||
"mtgmonkey"
|
modules = [
|
||||||
|
# hardware configuration
|
||||||
|
# verbatim as `nixos-generate-config` AND `system.stateVersion`
|
||||||
|
./machines/109-199-104-83.nix
|
||||||
|
|
||||||
|
# boot process
|
||||||
|
# grub boot on /dev/sda
|
||||||
|
./modules/nixos/boot/109-199-104-83.nix
|
||||||
|
|
||||||
|
# networking
|
||||||
|
./modules/nixos/networking/domains/galaxious.de.nix
|
||||||
|
./modules/nixos/networking/networks/109-199-104-83.nix
|
||||||
|
|
||||||
|
# ssh through port 5522 among other things
|
||||||
|
# andromeda@lenovo is the only user allowed access
|
||||||
|
./modules/nixos/networking/hard-ssh.nix
|
||||||
|
./modules/nixos/networking/ssh-as-root.nix
|
||||||
|
({config, ...}: {users.users.root.openssh.authorizedKeys.keys = [config.pub-keys.ssh.andromeda];})
|
||||||
|
|
||||||
|
# boilerplate settings
|
||||||
|
./modules/nixos/common.nix
|
||||||
|
|
||||||
|
# simple-nixos-mailserver email server
|
||||||
|
# mail.domain
|
||||||
|
./modules/nixos/mailserver.nix
|
||||||
|
|
||||||
|
# roundcube webmail client
|
||||||
|
# webmail.domain
|
||||||
|
./modules/nixos/roundcube.nix
|
||||||
|
|
||||||
|
# zulip chat client
|
||||||
|
# chat.domain
|
||||||
|
# zulip chat server
|
||||||
|
# zulip.domain
|
||||||
|
./modules/nixos/zulip.nix
|
||||||
|
{
|
||||||
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
35
machines/109-199-104-83.nix
Normal file
35
machines/109-199-104-83.nix
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
# 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" "virtio_scsi" "sd_mod"];
|
||||||
|
boot.initrd.kernelModules = [];
|
||||||
|
boot.kernelModules = [];
|
||||||
|
boot.extraModulePackages = [];
|
||||||
|
|
||||||
|
fileSystems."/" = {
|
||||||
|
device = "/dev/disk/by-uuid/159e6a69-b4e2-49c3-a6f0-5fcba0ea6a59";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/efi" = {
|
||||||
|
device = "systemd-1";
|
||||||
|
fsType = "autofs";
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices = [];
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
|
||||||
|
system.stateVersion = "25.11";
|
||||||
|
}
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
modulesPath,
|
|
||||||
machine,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
system.stateVersion = "25.11";
|
|
||||||
nix.settings.experimental-features = ["flakes" "nix-command"];
|
|
||||||
imports = [(modulesPath + "/profiles/qemu-guest.nix")];
|
|
||||||
fileSystems."/" = {
|
|
||||||
device = "/dev/sda1";
|
|
||||||
fsType = "ext4";
|
|
||||||
};
|
|
||||||
boot.loader.grub.device = "/dev/sda";
|
|
||||||
boot.loader.timeout = 30;
|
|
||||||
boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "xen_blkfront"];
|
|
||||||
boot.initrd.kernelModules = ["nvme"];
|
|
||||||
boot.tmp.cleanOnBoot = true;
|
|
||||||
zramSwap.enable = true;
|
|
||||||
networking = {
|
|
||||||
useNetworkd = true;
|
|
||||||
usePredictableInterfaceNames = true;
|
|
||||||
hostName = machine.hostname;
|
|
||||||
domain = "galaxious.de";
|
|
||||||
};
|
|
||||||
systemd.network = {
|
|
||||||
enable = true;
|
|
||||||
networks."40-wan" = {
|
|
||||||
matchConfig.Name = "enx0050565f4fff";
|
|
||||||
address = ["2a02:c207:2299:8419::1/64" "109.199.104.83/20"];
|
|
||||||
routes = [
|
|
||||||
{
|
|
||||||
Gateway = "109.199.96.1";
|
|
||||||
GatewayOnLink = true;
|
|
||||||
}
|
|
||||||
{Gateway = "fe80::1";}
|
|
||||||
];
|
|
||||||
dns = ["2620:fe::fe" "9.9.9.9"];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
services.openssh.enable = true;
|
|
||||||
users.mutableUsers = false;
|
|
||||||
users.users.root.openssh.authorizedKeys.keys = [config.pub-keys.ssh.andromeda];
|
|
||||||
programs.noshell.enable = true;
|
|
||||||
}
|
|
||||||
@@ -9,10 +9,6 @@
|
|||||||
./impermanence.nix
|
./impermanence.nix
|
||||||
(modulesPath + "/installer/scan/not-detected.nix")
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
];
|
];
|
||||||
age.secrets = {
|
|
||||||
secret0.file = ../../secrets/secret0.age;
|
|
||||||
secret1.file = ../../secrets/secret1.age;
|
|
||||||
};
|
|
||||||
boot.loader = {
|
boot.loader = {
|
||||||
efi.canTouchEfiVariables = true;
|
efi.canTouchEfiVariables = true;
|
||||||
systemd-boot.enable = true;
|
systemd-boot.enable = true;
|
||||||
|
|||||||
3
modules/nixos/boot/109-199-104-83.nix
Normal file
3
modules/nixos/boot/109-199-104-83.nix
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
boot.loader.grub.device = "/dev/sda";
|
||||||
|
}
|
||||||
20
modules/nixos/common.nix
Normal file
20
modules/nixos/common.nix
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
# flakes usage
|
||||||
|
nix.settings.experimental-features = [
|
||||||
|
"flakes"
|
||||||
|
"nix-command"
|
||||||
|
];
|
||||||
|
|
||||||
|
# allows users to customize shell in `$XDG_CONFIG_HOME/shell` rather than
|
||||||
|
# needing /etc/shells. Useful for home-manager. Falls back.
|
||||||
|
programs.noshell.enable = true;
|
||||||
|
|
||||||
|
# cleans /tmp to maintain a tidy system
|
||||||
|
boot.tmp.cleanOnBoot = true;
|
||||||
|
|
||||||
|
networking.domain = lib.mkDefault config.networking.hostName;
|
||||||
|
}
|
||||||
30
modules/nixos/mailserver.nix
Normal file
30
modules/nixos/mailserver.nix
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
{config, ...}: {
|
||||||
|
mailserver = {
|
||||||
|
enable = true;
|
||||||
|
stateVersion = 3;
|
||||||
|
fqdn = "mail.${config.networking.domain}";
|
||||||
|
domains = ["${config.networking.domain}"];
|
||||||
|
x509.useACMEHost = config.mailserver.fqdn;
|
||||||
|
loginAccounts = {
|
||||||
|
"test@${config.networking.domain}" = {
|
||||||
|
hashedPasswordFile = builtins.toString config.age.secrets.mailserver-acc-test-pw.path;
|
||||||
|
};
|
||||||
|
"admin@${config.networking.domain}" = {
|
||||||
|
hashedPasswordFile = builtins.toString config.age.secrets.mailserver-acc-admin-pw.path;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
services.nginx = {
|
||||||
|
enable = true;
|
||||||
|
virtualHosts = {
|
||||||
|
"mail.${config.networking.domain}" = {
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
security.acme = {
|
||||||
|
acceptTerms = true;
|
||||||
|
defaults.email = "mtgmonket@gmail.com";
|
||||||
|
};
|
||||||
|
}
|
||||||
3
modules/nixos/networking/domains/galaxious.de.nix
Normal file
3
modules/nixos/networking/domains/galaxious.de.nix
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
networking.domain = "galaxious.de";
|
||||||
|
}
|
||||||
19
modules/nixos/networking/hard-ssh.nix
Normal file
19
modules/nixos/networking/hard-ssh.nix
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
services.openssh = {
|
||||||
|
enable = true;
|
||||||
|
allowSFTP = false;
|
||||||
|
ports = [5522];
|
||||||
|
settings = {
|
||||||
|
PermitRootLogin = "no";
|
||||||
|
PasswordAuthentication = false;
|
||||||
|
KbdInteractiveAuthentication = true;
|
||||||
|
};
|
||||||
|
extraConfig = ''
|
||||||
|
AllowTcpForwarding no
|
||||||
|
AllowAgentForwarding no
|
||||||
|
MaxAuthTries 3
|
||||||
|
MaxSessions 4
|
||||||
|
TCPKeepAlive no
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
27
modules/nixos/networking/networks/109-199-104-83.nix
Normal file
27
modules/nixos/networking/networks/109-199-104-83.nix
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
networking = {
|
||||||
|
useNetworkd = true;
|
||||||
|
usePredictableInterfaceNames = true;
|
||||||
|
hostName = "109-199-104-83";
|
||||||
|
firewall = {
|
||||||
|
enable = true;
|
||||||
|
allowedTCPPorts = [80 443];
|
||||||
|
allowedUDPPorts = [80 443];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
systemd.network = {
|
||||||
|
enable = true;
|
||||||
|
networks."40-wan" = {
|
||||||
|
matchConfig.Name = "enx0050565f4fff";
|
||||||
|
address = ["2a02:c207:2299:8419::1/64" "109.199.104.83/20"];
|
||||||
|
routes = [
|
||||||
|
{
|
||||||
|
Gateway = "109.199.96.1";
|
||||||
|
GatewayOnLink = true;
|
||||||
|
}
|
||||||
|
{Gateway = "fe80::1";}
|
||||||
|
];
|
||||||
|
dns = ["2620:fe::fe" "9.9.9.9"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
3
modules/nixos/networking/ssh-as-root.nix
Normal file
3
modules/nixos/networking/ssh-as-root.nix
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{lib, ...}: {
|
||||||
|
services.openssh.settings.PermitRootLogin = lib.mkForce "yes";
|
||||||
|
}
|
||||||
12
modules/nixos/roundcube.nix
Normal file
12
modules/nixos/roundcube.nix
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{config, ...}: {
|
||||||
|
services.roundcube = {
|
||||||
|
enable = true;
|
||||||
|
hostName = "webmail.${config.networking.domain}";
|
||||||
|
extraConfig = ''
|
||||||
|
$config['imap_host'] = "ssl://${config.mailserver.fqdn}";
|
||||||
|
$config['smtp_host'] = "ssl://${config.mailserver.fqdn}";
|
||||||
|
$config['smtp_user'] = "%u";
|
||||||
|
$config['smtp_pass'] = "%p";
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
24
modules/nixos/zulip.nix
Normal file
24
modules/nixos/zulip.nix
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
{config, ...}: {
|
||||||
|
imports = [
|
||||||
|
./mailserver.nix
|
||||||
|
];
|
||||||
|
services.zulip = {
|
||||||
|
enable = true;
|
||||||
|
host = "zulip.${config.networking.domain}";
|
||||||
|
camoKeyFile = builtins.toString config.age.secrets.zulip-camoKey.path;
|
||||||
|
rabbitmqPasswordFile = builtins.toString config.age.secrets.zulip-rabbitmqPassword.path;
|
||||||
|
secretKeyFile = builtins.toString config.age.secrets.zulip-secretKey.path;
|
||||||
|
sharedSecretKeyFile = builtins.toString config.age.secrets.zulip-sharedSecretKey.path;
|
||||||
|
avatarSaltKeyFile = builtins.toString config.age.secrets.zulip-avatarSaltKey.path;
|
||||||
|
zulipSettings = {
|
||||||
|
ZULIP_ADMINISTRATOR = "admin+zulip@${config.networking.domain}";
|
||||||
|
EXTERNAL_HOST = "chat.${config.networking.domain}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
services.postgresql.enable = true;
|
||||||
|
mailserver.loginAccounts = {
|
||||||
|
"zulip+admin@${config.networking.domain}" = {
|
||||||
|
hashedPasswordFile = builtins.toString config.age.secrets."mailserver-acc-zulip+admin-pw".path;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
11
modules/template.nix
Normal file
11
modules/template.nix
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
modulesPath,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
imports = [];
|
||||||
|
options = {};
|
||||||
|
config = {};
|
||||||
|
}
|
||||||
13
pub-keys.nix
13
pub-keys.nix
@@ -1,8 +1,15 @@
|
|||||||
{
|
{
|
||||||
age.secrets = {
|
age.secrets = {
|
||||||
secret0.file = ./secrets/secret0.age;
|
andromeda-pw.file = ./secrets/andromeda-pw.age;
|
||||||
secret1.file = ./secrets/secret1.age;
|
mtgmonkey-pw.file = ./secrets/mtgmonkey-pw.age;
|
||||||
secret2.file = ./secrets/secret2.age;
|
mailserver-acc-test-pw.file = ./secrets/mailserver-acc-test-pw.age;
|
||||||
|
mailserver-acc-admin-pw.file = ./secrets/mailserver-acc-admin-pw.age;
|
||||||
|
"mailserver-acc-zulip+admin-pw".file = ./secrets + "/mailserver-acc-zulip+admin-pw.age";
|
||||||
|
zulip-avatarSaltKey.file = ./secrets/zulip-avatarSaltKey.age;
|
||||||
|
zulip-camoKey.file = ./secrets/zulip-camoKey.age;
|
||||||
|
zulip-rabbitmqPassword.file = ./secrets/zulip-rabbitmqPassword.age;
|
||||||
|
zulip-secretKey.file = ./secrets/zulip-secretKey.age;
|
||||||
|
zulip-sharedSecretKey.file = ./secrets/zulip-sharedSecretKey.age;
|
||||||
};
|
};
|
||||||
pub-keys = {
|
pub-keys = {
|
||||||
ssh = {
|
ssh = {
|
||||||
|
|||||||
9
secrets/mailserver-acc-admin-pw.age
Normal file
9
secrets/mailserver-acc-admin-pw.age
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
age-encryption.org/v1
|
||||||
|
-> ssh-ed25519 mT2fyg Lt6EG5R9iQWuD/eDXM+vsablwqCn7wUBKFuNO3qcq04
|
||||||
|
07jSpN+5/CJFCaBAEVB5TYqLEnGj8Fbt6z3qIVSijqU
|
||||||
|
-> ssh-ed25519 UHxfvA 8iIyIoZxJUYrvL9DFmleATVYs0TSZvPjSFqxSWYnVFs
|
||||||
|
XDQQGlQXJqjjAqslyfJerVATPIO4vCxTPRWOcBuF7f8
|
||||||
|
-> ssh-ed25519 Xoin5w tE8Tx9cSJH+4eJoEpG8CVf9+C1WrurERvGG0kOLatG4
|
||||||
|
YUUPvg6Ev3+7idthbcUeLeRZ+iE8yp+uirJojSt1gVg
|
||||||
|
--- FamPgM9+DjHiHQBkCmPaHe9aLLXIL3ZPCUtmtEtNOAI
|
||||||
|
Ց<EFBFBD><EFBFBD>}<7D>_rT6<54>Uwz<77>|<7C><<3C>_<EFBFBD><0F><><EFBFBD><EFBFBD>5<><35><EFBFBD>!~<>N<EFBFBD><18>cǦi<>*<2A>E<10>M?H?<3F>QSb<53><62><EFBFBD><EFBFBD><EFBFBD>\<5C><EFBFBD><DB9D>z<>K ?z<><7A>;<1C><>R<EFBFBD>Jp<4A>Ҷ<><D2B6>ɴs<C9B4>蔈<EFBFBD>y<EFBFBD><79>
|
||||||
9
secrets/mailserver-acc-test-pw.age
Normal file
9
secrets/mailserver-acc-test-pw.age
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
age-encryption.org/v1
|
||||||
|
-> ssh-ed25519 mT2fyg slLOkD/9TAYOuZ/g5U4NvPWUlmYZeie12xzggioviw0
|
||||||
|
E0uAj4RMgv7DTJpvtEO54G9XHNLFOgFflR54Cl6/X8g
|
||||||
|
-> ssh-ed25519 UHxfvA xHFujOdegur0PLNHZP+h5RxHhVD2K906NZx7nprMkUs
|
||||||
|
PdDxzD5QBdE/yWPMnF+CDGROEpE4nYvg12v1G3QK9XI
|
||||||
|
-> ssh-ed25519 Xoin5w YWsO9HtEFB79+aKr6eWi5Sg5geKfzT+IrDy2L5qEmx4
|
||||||
|
sXLRmcRDyAv64nSGs8QXcHmKYO+F11Pzea1EVGmpEys
|
||||||
|
--- Sjg8SqkkEEL4X0G1GOUoHO702ZtrM0hMniIdS7yIsDA
|
||||||
|
'<27>B<EFBFBD><42>(<28><>7Dϓ=<3D><>h<EFBFBD><10><>h f<>ɮ<13>xT<78><54>!K.<2E><1D><>~س<>,<2C>ߓ<>D|<7C><>+p<><70><EFBFBD>"<22>t<EFBFBD><74>G<EFBFBD>y<EFBFBD>Q<EFBFBD><51>RcP<63>Q<EFBFBD><51>Q<><51>
|
||||||
BIN
secrets/mailserver-acc-zulip+admin-pw.age
Normal file
BIN
secrets/mailserver-acc-zulip+admin-pw.age
Normal file
Binary file not shown.
Binary file not shown.
@@ -4,7 +4,14 @@ let
|
|||||||
lenovo = pub-keys.ssh.lenovo;
|
lenovo = pub-keys.ssh.lenovo;
|
||||||
_109-199-104-83 = pub-keys.ssh._109-199-104-83;
|
_109-199-104-83 = pub-keys.ssh._109-199-104-83;
|
||||||
in {
|
in {
|
||||||
"secret0.age".publicKeys = [andromeda lenovo];
|
"andromeda-pw.age".publicKeys = [andromeda lenovo];
|
||||||
"secret1.age".publicKeys = [andromeda lenovo];
|
"mtgmonkey-pw.age".publicKeys = [andromeda lenovo];
|
||||||
"secret2.age".publicKeys = [andromeda lenovo _109-199-104-83];
|
"mailserver-acc-test-pw.age".publicKeys = [andromeda lenovo _109-199-104-83];
|
||||||
|
"mailserver-acc-admin-pw.age".publicKeys = [andromeda lenovo _109-199-104-83];
|
||||||
|
"mailserver-acc-zulip+admin-pw.age".publicKeys = [andromeda lenovo _109-199-104-83];
|
||||||
|
"zulip-avatarSaltKey.age".publicKeys = [andromeda lenovo _109-199-104-83];
|
||||||
|
"zulip-camoKey.age".publicKeys = [andromeda lenovo _109-199-104-83];
|
||||||
|
"zulip-rabbitmqPassword.age".publicKeys = [andromeda lenovo _109-199-104-83];
|
||||||
|
"zulip-secretKey.age".publicKeys = [andromeda lenovo _109-199-104-83];
|
||||||
|
"zulip-sharedSecretKey.age".publicKeys = [andromeda lenovo _109-199-104-83];
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
secrets/zulip-avatarSaltKey.age
Normal file
BIN
secrets/zulip-avatarSaltKey.age
Normal file
Binary file not shown.
BIN
secrets/zulip-camoKey.age
Normal file
BIN
secrets/zulip-camoKey.age
Normal file
Binary file not shown.
9
secrets/zulip-rabbitmqPassword.age
Normal file
9
secrets/zulip-rabbitmqPassword.age
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
age-encryption.org/v1
|
||||||
|
-> ssh-ed25519 mT2fyg N+K4UqHYGQTzqq5wMhEs5ijh8a8uXarYy2BpWH2GAUY
|
||||||
|
7mWlRNsudiBCr34QMXkzwkyRZa9K6pAPLX0phQBIH1A
|
||||||
|
-> ssh-ed25519 UHxfvA i5e8E+FMsG+n+jl5ASBYbPvnME7X58sMMAlYelZAm3A
|
||||||
|
ARlV+vWRRsFVAsjdk+JgUMgp49muyGFF5g+iyzpyJQY
|
||||||
|
-> ssh-ed25519 Xoin5w 0EH6bLW0DwwVi8GMjq4ZjlBak1QQ0cxh/+KK/e1rPTY
|
||||||
|
yIpSegzmBeJ86jApt23Kv9vZ2sVLC8dFYa9t43/x8MM
|
||||||
|
--- c4PhDnZ271mJc2sc7DSIRqVF503JSsZhBj2ANwcT2po
|
||||||
|
PK<EFBFBD>F<0C><0E>!"<22><08><><EFBFBD>Mgo<67>/<2F><><EFBFBD>gF<67><46>0@<19><><EFBFBD>gA<15><>΄<EFBFBD>P<EFBFBD><50><EFBFBD>m+u<><75>Lo<4C>
|
||||||
BIN
secrets/zulip-secretKey.age
Normal file
BIN
secrets/zulip-secretKey.age
Normal file
Binary file not shown.
BIN
secrets/zulip-sharedSecretKey.age
Normal file
BIN
secrets/zulip-sharedSecretKey.age
Normal file
Binary file not shown.
@@ -13,7 +13,7 @@ in {
|
|||||||
"andromeda" = {
|
"andromeda" = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
description = "andromeda";
|
description = "andromeda";
|
||||||
hashedPasswordFile = builtins.toString config.age.secrets.secret0.path;
|
hashedPasswordFile = builtins.toString config.age.secrets.andromeda-pw.path;
|
||||||
extraGroups = [
|
extraGroups = [
|
||||||
"networkmanager"
|
"networkmanager"
|
||||||
"wheel"
|
"wheel"
|
||||||
@@ -22,7 +22,7 @@ in {
|
|||||||
"mtgmonkey" = {
|
"mtgmonkey" = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
description = "mtgmonkey";
|
description = "mtgmonkey";
|
||||||
hashedPasswordFile = builtins.toString config.age.secrets.secret1.path;
|
hashedPasswordFile = builtins.toString config.age.secrets.mtgmonkey-pw.path;
|
||||||
extraGroups = [
|
extraGroups = [
|
||||||
(lib.mkIf
|
(lib.mkIf
|
||||||
(machine == machines.lenovo)
|
(machine == machines.lenovo)
|
||||||
|
|||||||
@@ -181,22 +181,13 @@ in {
|
|||||||
home-manager.enable = true;
|
home-manager.enable = true;
|
||||||
firefox = {
|
firefox = {
|
||||||
enable = true;
|
enable = true;
|
||||||
profiles."andromeda".name = "andromeda";
|
package = pkgs.firefox.override {
|
||||||
package = pkgs.withPhoenix pkgs.firefox;
|
cfg.enableTridactylNative = true;
|
||||||
};
|
};
|
||||||
firefox.phoenix = {
|
profiles.${config.home.username}.extensions.packages = [
|
||||||
enable = true;
|
pkgs.nur.repos.rycee.firefox-addons.tridactyl
|
||||||
profiles = ["andromeda"];
|
];
|
||||||
};
|
};
|
||||||
# librewolf = {
|
|
||||||
# enable = true;
|
|
||||||
# package = pkgs.librewolf.override {
|
|
||||||
# cfg.enableTridactylNative = true;
|
|
||||||
# };
|
|
||||||
# profiles.${config.home.username}.extensions.packages = [
|
|
||||||
# pkgs.nur.repos.rycee.firefox-addons.tridactyl
|
|
||||||
# ];
|
|
||||||
# };
|
|
||||||
lsd.enable = true;
|
lsd.enable = true;
|
||||||
nvf = {
|
nvf = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user