From e4510488ab3e4b72806b6c6db233b55bc183f21a Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Sun, 2 Feb 2025 11:23:32 +0100 Subject: [PATCH] refactor --- hosts/yodaGaming/configuration.nix | 23 ++++++-------- hosts/yodaNas/configuration.nix | 1 - hosts/yodaTab/configuration.nix | 24 ++++++-------- hosts/yodaTux/configuration.nix | 21 ++++++------- ...{host-specific.nix => BikeTripPlanner.nix} | 13 +++++++- hosts/yodaYoga/configuration.nix | 31 ++++++++++--------- modules/base-graphical.nix | 7 +++++ modules/headless.nix | 2 +- modules/programs-base.nix | 10 ++++-- 9 files changed, 74 insertions(+), 58 deletions(-) rename hosts/yodaYoga/{host-specific.nix => BikeTripPlanner.nix} (75%) create mode 100644 modules/base-graphical.nix diff --git a/hosts/yodaGaming/configuration.nix b/hosts/yodaGaming/configuration.nix index 7eb8e3b..345e9e3 100644 --- a/hosts/yodaGaming/configuration.nix +++ b/hosts/yodaGaming/configuration.nix @@ -7,18 +7,8 @@ ../../modules/base.nix ../../modules/base-bios-grub.nix - ../../modules/power-management.nix - ../../modules/ntfs.nix - #../../modules/ssh-fde-unlock.nix - ../../modules/nitrokey-gpg-smartcard.nix - ../../modules/ssh-client.nix - ../../modules/ssh-server.nix + ../../modules/base-graphical.nix - #../../modules/headless.nix - # - #../../modules/kde.nix - #../../modules/programs-kde.nix - # ../../modules/gnome-base.nix ../../modules/fwupd-gnome.nix ../../modules/programs-gnome.nix @@ -26,13 +16,20 @@ ../../modules/programs-base.nix #../../modules/programs.nix ../../modules/flatpak.nix - ../../modules/signal-desktop.nix - ../../modules/firefox.nix #../../modules/games.nix #../../modules/dosbox-x.nix ../../modules/steam.nix + # + # Development + # + + ../../modules/git.nix + ../../modules/nitrokey-gpg-smartcard.nix + ../../modules/ssh-client.nix + ../../modules/ssh-server.nix + ../../modules/jetbrains-ide.nix ]; diff --git a/hosts/yodaNas/configuration.nix b/hosts/yodaNas/configuration.nix index 62e01ee..ed30cf5 100644 --- a/hosts/yodaNas/configuration.nix +++ b/hosts/yodaNas/configuration.nix @@ -10,7 +10,6 @@ ../../modules/headless.nix ../../modules/ssh-fde-unlock.nix - #../../modules/git.nix #../../modules/ssh-client.nix ../../modules/ssh-server.nix diff --git a/hosts/yodaTab/configuration.nix b/hosts/yodaTab/configuration.nix index cb10afb..7d48a80 100644 --- a/hosts/yodaTab/configuration.nix +++ b/hosts/yodaTab/configuration.nix @@ -6,21 +6,11 @@ ../../modules/base.nix ../../modules/base-efi-systemd.nix - ../../modules/xdg.nix + ../../modules/base-graphical.nix ../../modules/power-management.nix ../../modules/usb-mtp-ptp.nix - ../../modules/ntfs.nix - ../../modules/git.nix - ../../modules/nitrokey-gpg-smartcard.nix - ../../modules/ssh-client.nix - ../../modules/ssh-server.nix ../../modules/lid-switch-handling.nix - #../../modules/headless.nix - # - #../../modules/kde.nix - #../../modules/programs-kde.nix - # ../../modules/gnome-base.nix # Not required as display scale is set 2.0 (multiple of 1). #../../modules/gnome-fractional-scaling.nix @@ -34,11 +24,8 @@ ../../modules/ausweisapp.nix ../../modules/nextcloud-client.nix ../../modules/syncthing.nix - ../../modules/signal-desktop.nix ../../modules/element-desktop.nix ../../modules/obsidian.nix - ../../modules/vlc-dvd-blu-ray.nix - ../../modules/firefox.nix ../../modules/tor-browser.nix #../../modules/tor.nix #../../modules/digikam-rawtherapee-hugin-gimp.nix @@ -50,6 +37,15 @@ ../../modules/autostart.nix + # + # Development + # + + ../../modules/git.nix + ../../modules/nitrokey-gpg-smartcard.nix + ../../modules/ssh-client.nix + ../../modules/ssh-server.nix + ../../modules/jetbrains-ide.nix #../../modules/vscodium.nix #../../modules/android.nix diff --git a/hosts/yodaTux/configuration.nix b/hosts/yodaTux/configuration.nix index 6c0d21a..7809723 100644 --- a/hosts/yodaTux/configuration.nix +++ b/hosts/yodaTux/configuration.nix @@ -26,19 +26,12 @@ ../../modules/base.nix ../../modules/base-efi-systemd.nix - ../../modules/xdg.nix + ../../modules/base-graphical.nix ../../modules/power-management.nix ../../modules/usb-mtp-ptp.nix - ../../modules/ntfs.nix - ../../modules/git.nix - ../../modules/nitrokey-gpg-smartcard.nix - ../../modules/ssh-client.nix - ../../modules/ssh-server.nix ../../modules/lid-switch-handling.nix #../../modules/package-list.nix - #../../modules/headless.nix - # #../../modules/kde.nix #../../modules/programs-kde.nix # @@ -54,11 +47,8 @@ ../../modules/ausweisapp.nix ../../modules/nextcloud-client.nix ../../modules/syncthing.nix - ../../modules/signal-desktop.nix ../../modules/element-desktop.nix ../../modules/obsidian.nix - ../../modules/vlc-dvd-blu-ray.nix - ../../modules/firefox.nix ../../modules/tor-browser.nix #../../modules/tor.nix ../../modules/digikam-rawtherapee-hugin-gimp.nix @@ -75,6 +65,15 @@ #../../modules/autostart.nix + # + # Development + # + + ../../modules/git.nix + ../../modules/nitrokey-gpg-smartcard.nix + ../../modules/ssh-client.nix + ../../modules/ssh-server.nix + ../../modules/jetbrains-ide.nix #../../modules/vscodium.nix ../../modules/android.nix diff --git a/hosts/yodaYoga/host-specific.nix b/hosts/yodaYoga/BikeTripPlanner.nix similarity index 75% rename from hosts/yodaYoga/host-specific.nix rename to hosts/yodaYoga/BikeTripPlanner.nix index ad0c5fa..9c8e465 100644 --- a/hosts/yodaYoga/host-specific.nix +++ b/hosts/yodaYoga/BikeTripPlanner.nix @@ -1,6 +1,17 @@ { config, pkgs, ... }: - { + imports = [ + ../../modules/headless.nix + + ../../modules/ssh-fde-unlock.nix + ../../modules/ssh-server.nix + ../../modules/docker.nix + + ../../modules/lid-switch-handling.nix + ../../modules/sendmail-mta.nix + ../../modules/journalwatch.nix + ]; + # Download BikeTripPlanner Git repository. home-manager.users.yoda = { osConfig, config, pkgs, ... }: { home.file."readonly-git/BikeTripPlanner".source = (builtins.fetchGit { diff --git a/hosts/yodaYoga/configuration.nix b/hosts/yodaYoga/configuration.nix index c19cc32..71c7a72 100644 --- a/hosts/yodaYoga/configuration.nix +++ b/hosts/yodaYoga/configuration.nix @@ -1,23 +1,24 @@ { config, pkgs, ... }: { - imports = - [ - ./hardware-configuration.nix - ./host-specific.nix - ../../modules/base.nix - ../../modules/base-efi-systemd.nix - ../../modules/headless.nix + imports = [ + ./hardware-configuration.nix + ../../modules/base.nix + ../../modules/base-efi-systemd.nix + ../../modules/base-graphical.nix - ../../modules/ssh-fde-unlock.nix - ../../modules/ssh-server.nix - ../../modules/docker.nix + # Remote unlock + ../../modules/ssh-fde-unlock.nix + # Remote deployment + ../../modules/ssh-server.nix - ../../modules/lid-switch-handling.nix - ../../modules/sendmail-mta.nix - ../../modules/journalwatch.nix - ]; + ../../modules/gnome-base.nix + ../../modules/gnome-fractional-scaling.nix + ../../modules/fwupd-gnome.nix + ../../modules/programs-gnome.nix - #foo = throw "NixOS rebuild boot required to update to 24.05"; + ../../modules/programs-base.nix + ../../modules/print-and-scan.nix + ]; networking.hostName = "yodaYoga"; boot.initrd.luks.devices."luks-a8521407-e25b-4f26-8e7a-a56fcbfd2e35".allowDiscards = true; diff --git a/modules/base-graphical.nix b/modules/base-graphical.nix new file mode 100644 index 0000000..9c6a9ea --- /dev/null +++ b/modules/base-graphical.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: +{ + imports = [ + ./xdg.nix + ./ntfs.nix + ]; +} diff --git a/modules/headless.nix b/modules/headless.nix index 81d5d92..8d1955d 100644 --- a/modules/headless.nix +++ b/modules/headless.nix @@ -2,7 +2,7 @@ { users.users.yoda = { packages = with pkgs; [ - zenith # Terminal resource monitor / task manager + #zenith # Terminal resource monitor / task manager btop # Terminal resource monitor / task manager htop # Terminal resource monitor / task manager ]; diff --git a/modules/programs-base.nix b/modules/programs-base.nix index 9ed5d40..ccaf877 100644 --- a/modules/programs-base.nix +++ b/modules/programs-base.nix @@ -1,14 +1,20 @@ { config, pkgs, ... }: { + imports = [ + ./vlc-dvd-blu-ray.nix + ./firefox.nix + ./signal-desktop.nix + ]; + users.users.yoda = { packages = with pkgs; [ - zenith # Terminal resource monitor / task manager + #zenith # Terminal resource monitor / task manager btop # Terminal resource monitor / task manager htop # Terminal resource monitor / task manager niv # NixOS dependency management colmena # NixOS config deployment - keepassxc # Password manager. TODO Wayland: Maybe QT_QPA_PLATFORM defined in ghostwriter.nix fixed blurry fonts? + keepassxc # Password manager. warp # Fast and secure file transfer ]; };