diff --git a/hosts/pennsardin/configuration.nix b/hosts/pennsardin/configuration.nix index 98df612..9a9717a 100644 --- a/hosts/pennsardin/configuration.nix +++ b/hosts/pennsardin/configuration.nix @@ -3,29 +3,9 @@ let globals = import ../../config/globals.nix; in { imports = [ - ../../modules/common/nix.nix + ../../profiles/workstation-bspwm.nix ../../modules/hardware/bepovim.nix - ../modules/desktop/xorg-bspwm.nix - ../modules/common/base.nix - ../modules/common/fonts.nix - ../modules/common/networking.nix - ../modules/common/plymouth.nix - ../modules/common/audio.nix - ../modules/common/bluetooth.nix - ../modules/common/gaming.nix - ../modules/common/lockscreen.nix - ../modules/common/energy.nix - ../modules/common/qemu.nix - ../modules/common/smtp.nix - - ../modules/hardware/firmware.nix - ../modules/hardware/gpu-amd.nix - ../modules/hardware/sensors-zenpower.nix - - ../modules/services/printing.nix - - ../modules/virtual/kvm-amd.nix - ../modules/virtual/vfio.nix + ../../modules/common/nix.nix ]; networking.hostName = "pennsardin"; @@ -37,35 +17,8 @@ in { environment.systemPackages = with pkgs; [ lm_sensors - btrfs-progs - cifs-utils - evtest - git - vim - wget - curl - ripgrep - fd - pciutils - usbutils - p7zip - gdu - glances - parted - tmux - xorg.xauth - xorg.xkbcomp - xorg.xev ]; - services.openssh = { - enable = true; - settings = { - X11Forwarding = true; - X11DisplayOffset = 10; - }; - }; - fileSystems = { "/" = { device = "/dev/disk/by-uuid/b1a1ae71-4277-45d5-a3d2-f49354f263d4"; diff --git a/hosts/terre-neuvas/configuration.nix b/hosts/terre-neuvas/configuration.nix index b90388b..2774051 100644 --- a/hosts/terre-neuvas/configuration.nix +++ b/hosts/terre-neuvas/configuration.nix @@ -12,18 +12,9 @@ in { imports = [ # Include the results of the hardware scan. ./hardware.nix - ../../modules/common/nix.nix - ../../modules/roles/server.nix - ../../modules/common/base.nix - ../../modules/common/smtp.nix - ../../modules/common/qemu.nix - - ../../modules/services/goaccess.nix - ../../modules/services/wikijs.nix + ../../profiles/server-selfhosted.nix + ../../modules/services/ftp.nix ../../modules/services/forgejo.nix - ../../modules/sites/porzh.me.nix - ../../modules/sites/levr.porzh.me.nix - ]; # Bootloader. @@ -57,32 +48,7 @@ in { environment.systemPackages = with pkgs; [ neovim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. git - - btrfs-progs - cifs-utils - lm_sensors - wakeonlan - wget - curl - ripgrep - fd - pciutils - usbutils - p7zip - gdu - glances - tmux - ]; - - services.openssh = { - enable = true; - settings = { - PasswordAuthentication = false; - PubkeyAuthentication = true; - }; - }; - networking = { useNetworkd = true; firewall.allowedTCPPorts = [22 80 5900 5901 5902]; diff --git a/modules/roles/server.nix b/modules/roles/server.nix new file mode 100644 index 0000000..67c158d --- /dev/null +++ b/modules/roles/server.nix @@ -0,0 +1,19 @@ +{pkgs, ...}: { + imports = [ + ../common/nix.nix + ]; + + environment.systemPackages = with pkgs; [ + git + wget + curl + ripgrep + fd + pciutils + usbutils + p7zip + gdu + glances + tmux + ]; +} diff --git a/modules/roles/workstation.nix b/modules/roles/workstation.nix new file mode 100644 index 0000000..b99a5c7 --- /dev/null +++ b/modules/roles/workstation.nix @@ -0,0 +1,27 @@ +{pkgs, ...}: { + imports = [ + ../common/nix.nix + ../hardware/gpu-amd.nix + ../hardware/sensors-zenpower.nix + ../virtual/kvm-amd.nix + ../virtual/vfio.nix + ]; + + environment.systemPackages = with pkgs; [ + git + vim + wget + curl + ripgrep + fd + pciutils + usbutils + p7zip + gdu + glances + parted + tmux + discord + xorg.xauth + ]; +} diff --git a/modules/services/pihole.nix b/modules/services/pihole.nix new file mode 100644 index 0000000..78e4dc4 --- /dev/null +++ b/modules/services/pihole.nix @@ -0,0 +1,24 @@ +{ + virtualisation.oci-containers.containers.pihole = { + image = "pihole/pihole:latest"; + autoStart = true; + + ports = [ + "53:53/udp" + "53:53/tcp" + "80:80/tcp" + ]; + + environment = { + TZ = "Europe/Paris"; + WEBPASSWORD = "changeme"; # Change à ta convenance + PIHOLE_DNS_ = "1.1.1.1;1.0.0.1"; + }; + + volumes = [ + "/srv/pihole/etc-pihole:/etc/pihole" + "/srv/pihole/etc-dnsmasq.d:/etc/dnsmasq.d" + ]; + extraOptions = ["--cap-add=NET_ADMIN"]; + }; +} diff --git a/profiles/server-selfhosted.nix b/profiles/server-selfhosted.nix new file mode 100644 index 0000000..1f76436 --- /dev/null +++ b/profiles/server-selfhosted.nix @@ -0,0 +1,30 @@ +{pkgs, ...}: { + imports = [ + ../modules/roles/server.nix + ../modules/common/base.nix + ../modules/common/smtp.nix + ../modules/common/qemu.nix + ../modules/services/printing.nix + ../modules/services/goaccess.nix + ../modules/services/wikijs.nix + ../modules/sites/porzh.me.nix + ../modules/sites/levr.porzh.me.nix + ]; + + services.openssh = { + enable = true; + settings = { + PasswordAuthentication = false; + PubkeyAuthentication = true; + }; + }; + + environment.systemPackages = with pkgs; [ + btrfs-progs + cifs-utils + lm_sensors + wakeonlan + ]; +} +# vim: set ts=2 sw=2 sts=2 et : + diff --git a/profiles/workstation-bspwm.nix b/profiles/workstation-bspwm.nix new file mode 100644 index 0000000..6a1fa38 --- /dev/null +++ b/profiles/workstation-bspwm.nix @@ -0,0 +1,39 @@ +{pkgs, ...}: { + imports = [ + ../modules/roles/workstation.nix + ../modules/desktop/xorg-bspwm.nix + ../modules/common/base.nix + ../modules/common/fonts.nix + ../modules/common/networking.nix + ../modules/common/plymouth.nix + ../modules/hardware/firmware.nix + ../modules/hardware/gpu-amd.nix + ../modules/common/audio.nix + ../modules/common/bluetooth.nix + ../modules/common/gaming.nix + ../modules/services/printing.nix + ../modules/common/lockscreen.nix + ../modules/common/energy.nix + ../modules/common/qemu.nix + ../modules/common/smtp.nix + ]; + + services.openssh = { + enable = true; + settings = { + X11Forwarding = true; + X11DisplayOffset = 10; + }; + }; + + environment.systemPackages = with pkgs; [ + btrfs-progs + cifs-utils + evtest + lm_sensors + xorg.xev + xorg.xkbcomp + ]; +} +# vim: set ts=2 sw=2 sts=2 et : +