94 lines
2.4 KiB
Nix
94 lines
2.4 KiB
Nix
# Edit this configuration file to define what should be installed on
|
|
# 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,
|
|
...
|
|
}:let
|
|
serverIP = "192.168.0.202";
|
|
in{
|
|
imports = [
|
|
# Include the results of the hardware scan.
|
|
./hardware-configuration.nix
|
|
];
|
|
|
|
# Use the systemd-boot EFI boot loader.
|
|
boot.loader.systemd-boot.enable = true;
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
|
|
|
networking.hostName = "saberofxebec";
|
|
# Pick only one of the below networking options.
|
|
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
|
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
|
|
|
|
# Set your time zone.
|
|
time.timeZone = "Europe/Vienna";
|
|
|
|
# Configure network proxy if necessary
|
|
# networking.proxy.default = "http://user:password@proxy:port/";
|
|
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
|
|
|
# Select internationalisation properties.
|
|
# i18n.defaultLocale = "en_US.UTF-8";
|
|
# console = {
|
|
# font = "Lat2-Terminus16";
|
|
# keyMap = "us";
|
|
# useXkbConfig = true; # use xkb.options in tty.
|
|
# };
|
|
|
|
# List packages installed in system profile. To search, run:
|
|
# $ nix search wget
|
|
environment.systemPackages = with pkgs; [
|
|
vim
|
|
wget
|
|
git
|
|
btop
|
|
];
|
|
|
|
services.openssh = {
|
|
enable = true;
|
|
settings = {
|
|
PermitRootLogin = "yes";
|
|
};
|
|
};
|
|
services.logind.lidSwitchExternalPower = "ignore";
|
|
systemd.sleep.extraConfig = ''
|
|
AllowSuspend=no
|
|
AllowHibernation=no
|
|
AllowHybridSleep=no
|
|
AllowSuspendThenHibernate=no
|
|
'';
|
|
|
|
nix.settings.experimental-features = ["nix-command" "flakes"];
|
|
|
|
virtualisation.docker.enable = true;
|
|
virtualisation.oci-containers = {
|
|
backend = "docker";
|
|
containers.pihole = {
|
|
image = "pihole/pihole:latest";
|
|
ports = [
|
|
"${serverIP}:53:53/tcp"
|
|
"${serverIP}:53:53/udp"
|
|
"80:80"
|
|
"443:443"
|
|
];
|
|
volumes = [
|
|
"/var/lib/pihole/:/etc/pihole/"
|
|
"/var/lib/dnsmasq.d:/etc/dnsmasq.d/"
|
|
];
|
|
environment = {
|
|
ServerIP = serverIP;
|
|
};
|
|
extraOptions = [
|
|
"--cap-add=NET_ADMIN"
|
|
"--dns=127.0.0.1"
|
|
"--dns=1.1.1.1"
|
|
];
|
|
workdir = "/var/lib/pihole/";
|
|
};
|
|
};
|
|
|
|
system.stateVersion = "24.11"; # Did you read the comment?
|
|
}
|