Files
oott/flake.nix
T

90 lines
2.6 KiB
Nix
Raw Normal View History

2026-01-24 12:16:24 -05:00
{
2026-01-24 15:30:10 -05:00
description = "OOTT - An easy to setup and use network device monitoring service";
2026-01-24 12:16:24 -05:00
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
};
outputs = {
self,
nixpkgs,
2026-01-25 10:37:47 -05:00
nix,
2026-01-24 12:16:24 -05:00
}: let
# System types to support.
supportedSystems = ["x86_64-linux"];
# Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
2026-01-25 10:37:47 -05:00
forEachSystem = nixpkgs.lib.genAttrs supportedSystems;
# Package overlays to include
overlayList = [self.overlays.default];
2026-01-24 12:16:24 -05:00
# Nixpkgs instantiated for supported system types.
2026-01-25 10:37:47 -05:00
pkgsBySystem = forEachSystem (system:
import nixpkgs {
inherit system;
overlays = overlayList;
2026-02-11 14:07:27 -05:00
# Front-end specific items
config = {
android_sdk.accept_license = true;
allowUnfree = true;
};
2026-01-25 10:37:47 -05:00
});
in rec {
2026-02-11 14:07:27 -05:00
# Development shell to test the app locally
devShells = forEachSystem (system: {
default = pkgsBySystem.${system}.mkShell rec {
androidSdk = pkgsBySystem.${system}.androidenv.androidPkgs.androidsdk;
ANDROID_SDK_ROOT = "${androidSdk}/libexec/android-sdk";
nativeBuildInputs = with pkgsBySystem.${system}; [
pkg-config
];
buildInputs = with pkgsBySystem.${system}; [
openssl
rustc
cargo
sqlite
flutter
android-tools
androidSdk
jdk17
];
};
});
2026-01-24 19:26:09 -05:00
# A Nixpkgs overlay that provides a 'oott' package.
2026-02-12 12:55:20 -05:00
overlays.default = final: prev: {oott = final.callPackage ./nix/package.nix {};};
2026-01-24 19:26:09 -05:00
# Package definition
2026-01-25 10:37:47 -05:00
packages = forEachSystem (system: {
2026-01-25 11:01:11 -05:00
oott = pkgsBySystem.${system}.oott;
default = pkgsBySystem.${system}.oott;
# Docker image generation
# use via 'nix build .#dockerImage'
dockerImage = with pkgsBySystem.${system};
dockerTools.buildLayeredImage {
# Based on the official nixos image
fromImage = dockerTools.pullImage {
imageName = "nixos/nix";
imageDigest = "sha256:d5cce2440bda1f966357732c06d86cb92368069fb52dfb6b2bae8725eea488a5";
sha256 = "sha256-4+99v7Jej0dY0zv8iJLtFiulCsw90ZnGwtjTaGu2L+c=";
finalImageTag = "2.33.1";
finalImageName = "nix";
};
name = "oott";
tag = "latest";
contents = [oott curl bash openssl cacert];
config = {
Cmd = ["${oott}/bin/oott" "--config" "/config/oott.toml"];
};
};
2026-01-24 12:16:24 -05:00
});
2026-01-24 14:43:46 -05:00
2026-01-25 10:37:47 -05:00
# Modules definition
2026-01-25 11:01:11 -05:00
nixosModules = import ./nix/modules {overlays = overlayList;};
2026-01-24 12:16:24 -05:00
};
}