|
| 1 | +# SPDX-FileCopyrightText: 2022-2026 TII (SSRC) and the Ghaf contributors |
| 2 | +# SPDX-License-Identifier: Apache-2.0 |
| 3 | +# |
| 4 | +{ |
| 5 | + config, |
| 6 | + lib, |
| 7 | + pkgs, |
| 8 | + ... |
| 9 | +}: |
| 10 | +let |
| 11 | + cfg = config.ghaf.profiles.minimal; |
| 12 | + inherit (lib) |
| 13 | + mkEnableOption |
| 14 | + mkIf |
| 15 | + mkDefault |
| 16 | + ; |
| 17 | +in |
| 18 | +{ |
| 19 | + options.ghaf.profiles.minimal = { |
| 20 | + enable = (mkEnableOption "minimal profile") // { |
| 21 | + default = false; |
| 22 | + }; |
| 23 | + }; |
| 24 | + |
| 25 | + config = mkIf cfg.enable { |
| 26 | + # Minimal profile provides the base configuration that all other profiles build upon |
| 27 | + # This profile should contain only the essential settings needed for a basic Ghaf system |
| 28 | + # As the upstream changes such as bashless, minimal and other optimizations are too drastic |
| 29 | + # we will manually add the ones here that are deemed safe and useful for all profiles. |
| 30 | + |
| 31 | + documentation = { |
| 32 | + enable = mkDefault false; |
| 33 | + doc.enable = mkDefault false; |
| 34 | + info.enable = mkDefault false; |
| 35 | + man.enable = mkDefault false; |
| 36 | + man.man-db.enable = mkDefault false; |
| 37 | + nixos.enable = mkDefault false; |
| 38 | + }; |
| 39 | + |
| 40 | + environment = { |
| 41 | + # Perl is a default package. |
| 42 | + # TODO: reenable the below, once we sync with the test teams-for-linux |
| 43 | + #defaultPackages = mkForce [ ]; |
| 44 | + #corePackages = mkForce [ ]; |
| 45 | + #stub-ld.enable = mkDefault false; |
| 46 | + }; |
| 47 | + |
| 48 | + programs = { |
| 49 | + command-not-found.enable = mkDefault false; |
| 50 | + fish.generateCompletions = mkDefault false; |
| 51 | + # The lessopen package pulls in Perl. |
| 52 | + less.lessopen = mkDefault null; |
| 53 | + }; |
| 54 | + |
| 55 | + # Disable automatic config generation |
| 56 | + system.tools.nixos-generate-config.enable = mkDefault false; |
| 57 | + |
| 58 | + boot = { |
| 59 | + loader.grub.enable = mkDefault false; |
| 60 | + # This pulls in nixos-containers which depends on Perl. |
| 61 | + enableContainers = mkDefault false; |
| 62 | + }; |
| 63 | + |
| 64 | + # Provide a minimal set of system packages |
| 65 | + environment.systemPackages = [ |
| 66 | + # TODO: will need to define the base set of packages |
| 67 | + #pkgs.busybox |
| 68 | + pkgs.openssh |
| 69 | + ]; |
| 70 | + |
| 71 | + # The system cannot be rebuilt, these should be enabled |
| 72 | + # especially when making the storeDiskImages |
| 73 | + # TODO: enable this for storeDiskImages only |
| 74 | + #nix.enable = mkDefault false; |
| 75 | + #system.switch.enable = mkDefault false; |
| 76 | + |
| 77 | + ghaf = { |
| 78 | + # Add minimal base configuration here |
| 79 | + # Currently empty - will be populated as we move common settings from debug/release |
| 80 | + }; |
| 81 | + }; |
| 82 | +} |
0 commit comments