204 lines
5.1 KiB
Nix
Raw Normal View History

2023-01-26 00:24:32 +03:00
{ modulesPath, inputs, lib, pkgs, config, options, ... }:
2023-06-27 01:25:28 +03:00
let persistRoot = config.autoinstall.persist.persistRoot or "/persist";
2023-01-26 00:24:32 +03:00
in {
imports = with inputs.self; [
./boot.nix
2023-01-26 00:43:11 +03:00
./hardware-configuration.nix
2023-01-26 00:24:32 +03:00
./virtualisation.nix
2023-03-23 01:53:09 +03:00
./disks.nix
2023-11-16 03:45:22 +03:00
./backups.nix
2023-10-13 19:43:02 +03:00
customProfiles.hardened
2023-01-26 00:24:32 +03:00
2023-10-13 19:43:02 +03:00
customRoles.hypervisor
customProfiles.acme
customProfiles.authentik
customProfiles.battery-historian
customProfiles.fail2ban
# customProfiles.firefox-syncserver
customProfiles.gitea
customProfiles.joplin-server
2023-12-18 02:08:29 +03:00
# customProfiles.mailserver
2023-10-13 19:43:02 +03:00
customProfiles.nginx
2023-12-18 02:08:29 +03:00
# customProfiles.roundcube
2023-10-13 19:43:02 +03:00
customProfiles.tinyproxy
customProfiles.vaultwarden
customProfiles.vscode-server
2023-03-23 01:58:10 +03:00
2023-10-13 19:43:02 +03:00
customProfiles.media-stack
# customProfiles.copyparty
2023-12-30 04:42:09 +03:00
customProfiles.inpx-web
# customProfiles.seafile
2023-12-30 04:34:49 +03:00
customProfiles.spdf
2023-10-13 19:43:02 +03:00
# customProfiles.cocalc
# customProfiles.neko-browser
customProfiles.openbooks
customProfiles.webhooks
2023-03-23 01:58:10 +03:00
2023-10-13 19:43:02 +03:00
customProfiles.yandex-db
customProfiles.hoyolab
customProfiles.it-tools
customProfiles.homepage
customProfiles.matrix
customProfiles.atticd
customProfiles.attic
2023-12-30 04:41:07 +03:00
# customProfiles.restic-server
2023-10-13 19:43:02 +03:00
customProfiles.outline
customProfiles.radicale
customProfiles.wiki
2023-06-27 01:25:28 +03:00
2023-10-13 19:43:02 +03:00
(import customProfiles.blocky {
2023-06-27 01:25:28 +03:00
inherit config;
inherit (import ./dns-mapping.nix) dns-mapping;
})
(import customProfiles.headscale {
inherit config pkgs;
inherit (import ./dns-headscale.nix) dns-mapping;
})
2023-01-26 00:24:32 +03:00
];
deviceSpecific.devInfo = {
cpu = {
vendor = "intel";
clock = 2300;
cores = 4;
};
drive = {
type = "ssd";
speed = 500;
size = 500;
};
2023-06-27 01:25:28 +03:00
gpu = { vendor = "other"; };
2023-01-26 00:24:32 +03:00
bigScreen = false;
ram = 12;
fileSystem = "zfs";
};
deviceSpecific.enableVirtualisation = true;
deviceSpecific.vpn.mullvad.enable = false;
deviceSpecific.isServer = true;
zramSwap = {
enable = true;
algorithm = "zstd";
2023-05-24 21:28:50 +03:00
memoryPercent = 150;
2023-01-26 00:24:32 +03:00
};
services.tailscale.enable = true;
services.tailscale.useRoutingFeatures = "client";
2023-01-26 00:24:32 +03:00
# Impermanence
persist = {
enable = true;
cache.clean.enable = true;
state = {
files = [ "/etc/machine-id" ];
directories = [ "/var/lib/tailscale" ];
};
2023-01-26 00:24:32 +03:00
};
fileSystems."/home".neededForBoot = true;
fileSystems.${persistRoot}.neededForBoot = true;
boot.initrd.postDeviceCommands = lib.mkAfter ''
zfs rollback -r rpool/nixos/root@empty
zfs rollback -r rpool/user/home@empty
'';
2023-06-23 18:28:56 +03:00
environment.memoryAllocator.provider = "libc";
2023-01-26 00:24:32 +03:00
# build hell
environment.noXlibs = lib.mkForce false;
# minimal profile
documentation.nixos.enable = lib.mkForce false;
programs.command-not-found.enable = lib.mkForce false;
xdg.autostart.enable = lib.mkForce false;
xdg.icons.enable = lib.mkForce false;
xdg.mime.enable = lib.mkForce false;
xdg.sounds.enable = lib.mkForce false;
services.udisks2.enable = lib.mkForce false;
2023-08-04 02:37:47 +03:00
fonts.enableDefaultPackages = lib.mkForce false;
fonts.packages =
2023-06-27 01:25:28 +03:00
[ (pkgs.nerdfonts.override { fonts = [ "FiraCode" "VictorMono" ]; }) ];
2023-01-26 00:24:32 +03:00
security.polkit.enable = true;
# security.pam.enableSSHAgentAuth = true;
services.zfs = {
autoScrub.enable = true;
2023-11-22 05:57:58 +03:00
autoScrub.interval = "monthly";
2023-01-26 00:24:32 +03:00
trim.enable = true;
trim.interval = "weekly";
};
# hardened
networking.firewall.enable = true;
2023-06-27 01:25:28 +03:00
networking.firewall.allowedTCPPorts = lib.mkDefault [ ];
networking.firewall.allowedUDPPorts = lib.mkDefault [ ];
2023-01-26 00:24:32 +03:00
systemd.coredump.enable = false;
programs.firejail.enable = true;
networking.wireless.enable = false;
networking.networkmanager.enable = false;
networking.hostName = config.device;
2023-01-13 04:03:15 +03:00
networking.nameservers = [ "192.168.0.1" ];
networking.defaultGateway = "192.168.0.1";
networking.bridges.br0.interfaces = [ "enp2s0f0" ];
networking.interfaces.br0 = {
useDHCP = false;
ipv4.addresses = [{
2023-01-26 00:43:11 +03:00
address = "192.168.0.10";
prefixLength = 24;
2023-01-13 04:03:15 +03:00
}];
};
networking.extraHosts = ''
127.0.0.1 code.ataraxiadev.com
2023-06-14 03:39:35 +03:00
127.0.0.1 cache.ataraxiadev.com
2023-01-13 04:03:15 +03:00
'';
2023-03-23 01:58:10 +03:00
# networking.proxy.default = "http://127.0.0.1:3128";
nix.optimise.automatic = false;
2023-01-13 04:03:15 +03:00
services.logind.lidSwitch = "lock";
services.logind.lidSwitchDocked = "lock";
services.logind.lidSwitchExternalPower = "lock";
services.timesyncd.enable = lib.mkForce false;
2023-01-26 00:24:32 +03:00
services.openntpd.enable = true;
networking.timeServers = [
"0.ru.pool.ntp.org"
"1.ru.pool.ntp.org"
"2.ru.pool.ntp.org"
"3.ru.pool.ntp.org"
"0.europe.pool.ntp.org"
"1.europe.pool.ntp.org"
"2.europe.pool.ntp.org"
"3.europe.pool.ntp.org"
] ++ options.networking.timeServers.default;
home-manager.users.${config.mainuser} = {
home.file.".config/libvirt/libvirt.conf".text = ''
uri_default = "qemu:///system"
'';
2023-01-13 04:03:15 +03:00
home.packages = with pkgs; [
2023-06-27 01:25:28 +03:00
bat
bottom
comma
2023-11-11 03:15:07 +03:00
dig.dnsutils
2023-07-30 03:27:14 +03:00
fd
2023-06-27 01:25:28 +03:00
kitty
micro
nix-index-update
2023-07-30 03:27:14 +03:00
p7zip
2023-06-27 01:25:28 +03:00
podman-compose
pwgen
2023-11-11 03:14:37 +03:00
rclone
2023-07-30 03:27:14 +03:00
repgrep
2023-11-11 03:14:37 +03:00
restic
rustic-rs
2023-06-27 01:25:28 +03:00
smartmontools
2023-01-13 04:03:15 +03:00
];
2023-01-26 00:24:32 +03:00
xdg.mime.enable = false;
home.stateVersion = "22.11";
};
system.stateVersion = "22.11";
}