From df2c680394b2b3412e43d60cc505539e8f91c9ef Mon Sep 17 00:00:00 2001 From: Alejandro Diaz Date: Sun, 10 Sep 2023 22:25:55 -0600 Subject: [PATCH] disable unused modules --- README.md | 2 +- triviOS/default.nix | 65 ++++++++++++++++++++++++++------------------- 2 files changed, 38 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 24ebd0e..37346a6 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ### Compilation command: ```bash -nix build .\#nixosConfigurations.triviOS.config.system.build.toplevel +nix build .\#nixosConfigurations.triviOS.config.system.build.sdImage --no-link --print-build-logs ``` diff --git a/triviOS/default.nix b/triviOS/default.nix index 2f40e5f..5c077e4 100644 --- a/triviOS/default.nix +++ b/triviOS/default.nix @@ -5,7 +5,17 @@ # # Copyright (C) 2023 - Group 8 -{ pkgs, ... }: { +{ pkgs, modulesPath, ... }: { + + imports = [ + (modulesPath + "/installer/sd-card/sd-image-aarch64.nix") + (modulesPath + "/profiles/minimal.nix") + ]; + + disabledModules = [ + (modulesPath + "/profiles/base.nix") + (modulesPath + "/profiles/all-hardware.nix") + ]; system.stateVersion = "23.05"; @@ -13,45 +23,44 @@ distroName = "TriviOS"; variant_id = "rpi3"; }; + sdImage.imageBaseName = "trivios-sd-image"; + + nix.enable = false; hardware.enableRedistributableFirmware = true; - environment.systemPackages = with pkgs; [ libraspberrypi ]; + environment.systemPackages = with pkgs; [ + libraspberrypi + (python3.withPackages (py: [ py.django ])) + ]; networking.wireless.enable = true; + services.openssh = { + enable = true; + settings.PasswordAuthentication = true; + settings.PermitRootLogin = "yes"; + }; + + users.users."root".initialPassword = "password"; + boot = { - loader = { - raspberryPi = { - enable = true; - version = 3; - firmwareConfig = '' - core_freq=250 - ''; - }; - grub.enable = false; - }; + # Doesn't work per https://github.com/NixOS/nixpkgs/issues/146199 + # loader.raspberryPi = { + # enable = true; + # version = 3; + # firmwareConfig = '' + # core_freq=250 + # gpu_mem=256 + # ''; + # }; + initrd.includeDefaultModules = false; kernelPackages = pkgs.linuxPackages_rpi3; kernelParams = [ "console=ttyS1,115200n8" + "cma=256M" ]; }; - fileSystems = { - "/" = { - device = "/dev/disk/by-uuid/B007-B007"; - fsType = "vfat"; - options = [ "umask=027" ]; - }; - }; - - documentation = { - enable = false; - nixos.enable = false; - man.enable = false; - doc.enable = false; - info.enable = false; - }; - services.timesyncd.enable = false; systemd.oomd.enable = false; systemd.coredump.enable = false;