Adds comments.

This commit is contained in:
Bailey Stevens 2023-08-03 16:26:44 -04:00
parent 00ad5f6c8c
commit 403edc9219
2 changed files with 19 additions and 3 deletions

View file

@ -2,20 +2,27 @@
{ {
system.stateVersion = "23.05"; system.stateVersion = "23.05";
# Enables flakes and the updated `nix` command
nix.settings.experimental-features = [ "nix-command" "flakes" ]; nix.settings.experimental-features = [ "nix-command" "flakes" ];
# Enables opengl support
hardware.opengl.enable = true; hardware.opengl.enable = true;
# Includes packages needed for startx
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
xorg.xauth xorg.xinit xorg.xauth xorg.xinit
]; ];
users = { users = {
# No need to edit users on a single-purpose system.
mutableUsers = false; mutableUsers = false;
users = { users = {
# My authorized keys are used for remote access
# CHANGE THIS if forking
root.openssh.authorizedKeys.keyFiles = [ root.openssh.authorizedKeys.keyFiles = [
./authorized_keys ./authorized_keys
]; ];
# Unprivledged user for running the application.
appuser = { appuser = {
isNormalUser = true; isNormalUser = true;
group = "appuser"; group = "appuser";
@ -27,6 +34,7 @@
}; };
}; };
# Allow SSH with authorized keys only!
services.openssh = { services.openssh = {
enable = true; enable = true;
settings.PasswordAuthentication = false; settings.PasswordAuthentication = false;

View file

@ -13,6 +13,7 @@
outputs = inputs@{self, nixpkgs, flake-utils, ...}: outputs = inputs@{self, nixpkgs, flake-utils, ...}:
flake-utils.lib.eachDefaultSystem (system: flake-utils.lib.eachDefaultSystem (system:
let let
# nixpkgs for native system.
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
overlays = [ overlays = [
@ -20,6 +21,7 @@
inputs.colmena.overlay inputs.colmena.overlay
]; ];
}; };
# Native VM config.
clementine = nixpkgs.lib.nixosSystem { clementine = nixpkgs.lib.nixosSystem {
inherit pkgs; inherit pkgs;
modules = [ modules = [
@ -28,27 +30,33 @@
]; ];
}; };
in rec { in rec {
# Install colmena in dev shell for deployment.
devShell = pkgs.mkShell { devShell = pkgs.mkShell {
packages = with pkgs; [ colmena ]; packages = with pkgs; [ colmena ];
}; };
# Run testing VM using `nix run`
packages.default = clementine.config.system.build.vm; packages.default = clementine.config.system.build.vm;
}) // (let }) // (let
# Target device (RPi3 aarch64) nixpkgs.
pkgs = import nixpkgs { pkgs = import nixpkgs {
system = "aarch64-linux"; system = "aarch64-linux";
overlays = [ inputs.graphfix.overlay ]; overlays = [ inputs.graphfix.overlay ];
}; };
# Modules for colmena and sd card image are the same.
modules = [ modules = [
./citrus.nix ./citrus.nix
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix" "${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"
./platforms/orange.nix ./platforms/orange.nix
]; ];
in { in {
# Colmena deploy manifest
colmena = { colmena = {
meta.nixpkgs = pkgs; meta.nixpkgs = pkgs;
orange = { orange = {
imports = modules; imports = modules;
}; };
}; };
# SD card image build.
orange = (nixpkgs.lib.nixosSystem { orange = (nixpkgs.lib.nixosSystem {
inherit pkgs modules; inherit pkgs modules;
}).config.system.build.sdImage; }).config.system.build.sdImage;