From 048bd78eeb0c4b416d180df643e11ccf18889ef9 Mon Sep 17 00:00:00 2001 From: revol-xut Date: Tue, 19 Apr 2022 16:39:09 +0200 Subject: [PATCH] added option to toggle office bloat --- flake.nix | 11 +++++++++++ hosts/birne/configuration.nix | 3 +-- hosts/sanddorn/configuration.nix | 16 ++++++++++------ modules/desktop.nix | 28 +++++++++++++++------------- modules/infoscreen.nix | 6 +----- modules/options.nix | 7 +++++++ 6 files changed, 45 insertions(+), 26 deletions(-) create mode 100644 modules/options.nix diff --git a/flake.nix b/flake.nix index da54452..ce97986 100755 --- a/flake.nix +++ b/flake.nix @@ -9,6 +9,9 @@ outputs = { self, nixpkgs, sops-nix, fsr-infoscreen, ... }@inputs: let in { + packages."aarch64-linux".sanddorn = self.nixosConfigurations.sanddorn.config.system.build.sdImage; + packages."x86_64-linux".sanddorn = self.nixosConfigurations.sanddorn.config.system.build.sdImage; + nixosConfigurations = { birne = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; @@ -20,6 +23,10 @@ ./modules/desktop.nix ./modules/printing.nix ./modules/wifi.nix + ./modules/options.nix + { + fsr.enable_office_bloat = true; + } ]; }; @@ -37,7 +44,11 @@ ./modules/autoupdate.nix ./modules/wifi.nix ./modules/desktop.nix + ./modules/options.nix "${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix" + { + fsr.enable_office_bloat = false; + } ]; }; }; diff --git a/hosts/birne/configuration.nix b/hosts/birne/configuration.nix index c25f0e3..df3eb13 100755 --- a/hosts/birne/configuration.nix +++ b/hosts/birne/configuration.nix @@ -7,7 +7,6 @@ { imports = [ # Include the results of the hardware scan. - ./hardware-configuration.nix ]; # Use the systemd-boot EFI boot loader. @@ -35,7 +34,7 @@ firefox ]; - system.stateVersion = "21.11"; + system.stateVersion = "21.05"; } diff --git a/hosts/sanddorn/configuration.nix b/hosts/sanddorn/configuration.nix index bd5d0b0..b1a43e3 100644 --- a/hosts/sanddorn/configuration.nix +++ b/hosts/sanddorn/configuration.nix @@ -1,9 +1,5 @@ { config, lib, pkgs, ... }: { - imports = [ - ./hardware-configuration.nix - ]; - boot = { loader = { grub.enable = false; @@ -18,6 +14,11 @@ tmpOnTmpfs = true; }; + nix = { + autoOptimiseStore = true; + }; + + networking = { hostName = "sanddorn"; @@ -27,6 +28,8 @@ firewall.enable = false; }; + programs.tmux.enable = true; + # Do not log to flash: services.journald.extraConfig = '' Storage=volatile @@ -37,6 +40,7 @@ wheelNeedsPassword = false; }; - system.stateVersion = "21.11"; + documentation.enable = false; + + system.stateVersion = "21.05"; } - diff --git a/modules/desktop.nix b/modules/desktop.nix index 5833acb..fb1cf70 100755 --- a/modules/desktop.nix +++ b/modules/desktop.nix @@ -1,6 +1,16 @@ -{ pkgs, config, ... }: +{ pkgs, lib, config, office_stuff, ... }: -{ +let + +extra_office_packages = (lib.ifEnable config.fsr.enable_office_bloat (with pkgs; [ + vlc + libreoffice-fresh + okular + texlive.combined.scheme-full +])); + + +in { # enable XFCE as lightweight desktop environment services = { xserver.enable = true; @@ -24,16 +34,8 @@ ## audio management pavucontrol ## terminal, browsers, text editing - vscodium + #vscodium firefox - ## document viewers - okular - ## LaTeX - texlive.combined.scheme-full - texstudio - ## the eternal pain continues - libreoffice-fresh - # media viewers - vlc - ]; + ] ++ extra_office_packages; + } diff --git a/modules/infoscreen.nix b/modules/infoscreen.nix index 51050a5..6082211 100644 --- a/modules/infoscreen.nix +++ b/modules/infoscreen.nix @@ -1,8 +1,4 @@ -{ pkgs -, lib -, config -, ... -}: +{ pkgs, lib, config, ...}: let fsr-infoscreen = pkgs.fsr-infoscreen; diff --git a/modules/options.nix b/modules/options.nix new file mode 100644 index 0000000..28acb30 --- /dev/null +++ b/modules/options.nix @@ -0,0 +1,7 @@ +{config, lib, ...}: with lib; { + options.fsr.enable_office_bloat = mkOption { + type = types.bool; + default = false; + description = "install heavy office bloat like texlive, okular, ..."; + }; +}