commit 8926e6cef64fb8ccee8766ebfa878e049316fc3f
parent 8f62154ad39d17a2c4596c9527d2cffd3a0e7423
Author: Bradley Gannon <bradley@bradleygannon.com>
Date: Mon, 25 May 2026 17:07:46 -0400
Replace shell.nix with flake.nix
Diffstat:
| A | flake.lock | | | 66 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | flake.nix | | | 64 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| D | shell.nix | | | 12 | ------------ |
3 files changed, 130 insertions(+), 12 deletions(-)
diff --git a/flake.lock b/flake.lock
@@ -0,0 +1,66 @@
+{
+ "nodes": {
+ "fenixLib": {
+ "inputs": {
+ "nixpkgs": [
+ "stablePkgs"
+ ],
+ "rust-analyzer-src": "rust-analyzer-src"
+ },
+ "locked": {
+ "lastModified": 1779704612,
+ "narHash": "sha256-J0HFmpzCC/qY4QnPG6o3OTolZejSjg2KBbgyodyuD9Q=",
+ "owner": "nix-community",
+ "repo": "fenix",
+ "rev": "fd67f3ee990cb1b3fc06f4f83c494c4f782ac467",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-community",
+ "repo": "fenix",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "fenixLib": "fenixLib",
+ "stablePkgs": "stablePkgs"
+ }
+ },
+ "rust-analyzer-src": {
+ "flake": false,
+ "locked": {
+ "lastModified": 1779616926,
+ "narHash": "sha256-0XU9z2w0guTsnYiudijlc5tLoHESldL/X1yPCpTZByY=",
+ "owner": "rust-lang",
+ "repo": "rust-analyzer",
+ "rev": "de5824b6d0457b0e35cb77de2c0d99402d63770f",
+ "type": "github"
+ },
+ "original": {
+ "owner": "rust-lang",
+ "ref": "nightly",
+ "repo": "rust-analyzer",
+ "type": "github"
+ }
+ },
+ "stablePkgs": {
+ "locked": {
+ "lastModified": 1779467186,
+ "narHash": "sha256-nOesoDCiXcUftqbRBMz9tt4blI5PvljMWbm3kuCA+0s=",
+ "owner": "nixos",
+ "repo": "nixpkgs",
+ "rev": "b77b3de8775677f84492abe84635f87b0e153f0f",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nixos",
+ "ref": "nixos-25.11",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/flake.nix b/flake.nix
@@ -0,0 +1,64 @@
+{
+ description = "Arduino TNC";
+
+ inputs = {
+ stablePkgs.url = "github:nixos/nixpkgs?ref=nixos-25.11";
+ fenixLib = {
+ url = "github:nix-community/fenix";
+ inputs.nixpkgs.follows = "stablePkgs";
+ };
+ };
+
+ outputs =
+ {
+ self,
+ stablePkgs,
+ fenixLib,
+ }:
+ let
+ system = "x86_64-linux";
+ stable = import stablePkgs {
+ inherit system;
+ config = { };
+ overlays = [ ];
+ };
+ fenix = import fenixLib {
+ inherit system;
+ };
+ rust = fenix.fromToolchainFile {
+ file = ./rust-toolchain.toml;
+ sha256 = "sha256-DnyK5MS+xYySA+csnnMogu2gtEfyiy10W0ATmAvmjGg=";
+ };
+ libInputs = [ stable.stdenv.cc.cc.lib ];
+ lib-path = with stable; lib.makeLibraryPath libInputs;
+ fastgoertzel = stable.python313Packages.buildPythonPackage {
+ name = "fastgoertzel";
+ src = stable.fetchurl {
+ url = "https://files.pythonhosted.org/packages/86/9d/cbe1f6b4a74c5816cdfa201485db4dd6f85a2900b57287ae2e601886f314/fastgoertzel-1.0.2-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl";
+ hash = "sha256-XgQ4h3hW14fcEG664F6l94zlzDVi+FGe0I8ldT20JH8=";
+ };
+ format = "wheel";
+ };
+ in
+ {
+ devShells.${system}.default = stable.mkShell {
+ packages = with stable; [
+ avrdude
+ direwolf
+ fastgoertzel
+ pkgsCross.avr.buildPackages.gcc
+ python313Packages.matplotlib
+ python313Packages.numpy
+ python313Packages.scipy
+ ravedude
+ ruff
+ rust
+ ty
+ ];
+
+ shellHook = ''
+ export "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${lib-path}"
+ '';
+ };
+ };
+}
diff --git a/shell.nix b/shell.nix
@@ -1,12 +0,0 @@
-let
- nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-25.11";
- pkgs = import nixpkgs { config = {}; overlays = []; };
-in
-
-pkgs.mkShellNoCC {
- packages = with pkgs; [
- avrdude
- pkgsCross.avr.buildPackages.gcc
- ravedude
- ];
-}