From 8dcece083656a03e2cf33a82cfb9946a5a0090d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Schr=C3=B6ter?= Date: Sun, 26 Jun 2022 13:12:01 +0200 Subject: [PATCH] feat: restructure system config Create common system config and derive common server & desktop configs from it. --- home-pc.nix | 2 +- rpi4.nix | 5 +---- system/common.nix | 7 +++++++ system/desktop.nix | 8 ++++++++ system/{default.nix => fonts.nix} | 14 -------------- system/server.nix | 5 +++++ 6 files changed, 22 insertions(+), 19 deletions(-) create mode 100644 system/common.nix create mode 100644 system/desktop.nix rename system/{default.nix => fonts.nix} (77%) create mode 100644 system/server.nix diff --git a/home-pc.nix b/home-pc.nix index 13b3279..3143fd3 100644 --- a/home-pc.nix +++ b/home-pc.nix @@ -6,7 +6,7 @@ ./hardware/gpu-amd.nix ./hardware/steam.nix ./hardware/ledger.nix - ./system + ./system/desktop.nix ./system/gaming.nix ./desktop ./virtualisation/libvirt.nix diff --git a/rpi4.nix b/rpi4.nix index 6dd93e1..dcaa9e5 100644 --- a/rpi4.nix +++ b/rpi4.nix @@ -12,10 +12,7 @@ in with builtins; { imports = [ # ./hardware/base.nix ./hardware/gpu-rpi4.nix - # ./system - ./system/nix.nix - ./system/i18n.nix - ./system/networking.nix + ./system/server.nix ./modules/emailNotify.nix ./services/mail.nix ./services/restic/rpi4.nix diff --git a/system/common.nix b/system/common.nix new file mode 100644 index 0000000..c78ab85 --- /dev/null +++ b/system/common.nix @@ -0,0 +1,7 @@ +{ config, pkgs, ... }: + +{ + imports = [ ./i18n.nix ./nix.nix ./networking.nix ./hardened.nix ]; + + environment.systemPackages = with pkgs; [ wget curl openssl neovim ]; +} diff --git a/system/desktop.nix b/system/desktop.nix new file mode 100644 index 0000000..3e0688c --- /dev/null +++ b/system/desktop.nix @@ -0,0 +1,8 @@ +{ config, pkgs, ... }: + +{ + imports = [ ./common.nix ./fonts.nix ./sound.nix ./vpn.nix ]; + + services.printing.enable = true; + services.fwupd.enable = true; +} diff --git a/system/default.nix b/system/fonts.nix similarity index 77% rename from system/default.nix rename to system/fonts.nix index fb3733f..fab2f07 100644 --- a/system/default.nix +++ b/system/fonts.nix @@ -1,17 +1,6 @@ { config, pkgs, ... }: { - imports = [ - ./hardened.nix - ./sound.nix - ./i18n.nix - ./nix.nix - ./networking.nix - ./vpn.nix - ]; - - environment.systemPackages = with pkgs; [ wget curl openssl neovim ]; - # TODO once nerdfonts 2.2.0 is released switch to NerdFontsSymbolsOnly # Also needs to be added to known fonts in nixpkgs: # https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/data/fonts/nerdfonts/shas.nix @@ -32,7 +21,4 @@ monospace = [ "Fira Code" "Noto Color Emoji" "FiraCode Nerd Font" ]; emoji = [ "Noto Color Emoji" "FiraCode Nerd Font" ]; }; - - services.printing.enable = true; - services.fwupd.enable = true; } diff --git a/system/server.nix b/system/server.nix new file mode 100644 index 0000000..9a7db85 --- /dev/null +++ b/system/server.nix @@ -0,0 +1,5 @@ +{ config, pkgs, ... }: + +{ + imports = [ ./common.nix ]; +}