From 3dfb8de92752a560cd640c47a31bf4fbc5189abf Mon Sep 17 00:00:00 2001 From: Levi Neely <141506390+lneely@users.noreply.github.com> Date: Fri, 11 Apr 2025 20:55:58 +0200 Subject: [PATCH] Nix shell uses flakes (#147) * nix shell now uses flakes --- flake.lock | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 47 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..5b2aa3d --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1743550720, + "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "c621e8422220273271f52058f618c94e405bb0f5", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1744232761, + "narHash": "sha256-gbl9hE39nQRpZaLjhWKmEu5ejtQsgI5TWYrIVVJn30U=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "f675531bc7e6657c10a18b565cfebd8aa9e24c14", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1743296961, + "narHash": "sha256-b1EdN3cULCqtorQ4QeWgLMrd5ZGOjLSLemfa00heasc=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "e4822aea2a6d1cdd36653c134cacfd64c97ff4fa", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..63e6dd9 --- /dev/null +++ b/flake.nix @@ -0,0 +1,47 @@ +{ + description = "pcloudcc-lneely dev environment"; + + inputs = { + flake-parts.url = "github:hercules-ci/flake-parts"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + }; + + outputs = inputs@{ flake-parts, ... }: + flake-parts.lib.mkFlake { inherit inputs; } { + systems = [ "x86_64-linux" "aarch64-linux" ]; + perSystem = { config, self', inputs', pkgs, system, ... }: { + devShells.default = pkgs.mkShell { + packages = with pkgs; [ + bear + clang-tools + zlib + sqlite + boost + libudev-zero + readline + fuse + mbedtls + ]; + + CFLAGS = [ + "-I${pkgs.zlib.dev}/include" + "-I${pkgs.sqlite.dev}/include" + "-I${pkgs.boost.dev}/include" + "-I${pkgs.readline.dev}/include" + "-I${pkgs.fuse.dev}/include" + "-I${pkgs.mbedtls}/include" + ]; + + CXXFLAGS = [ + "-I${pkgs.zlib.dev}/include" + "-I${pkgs.sqlite.dev}/include" + "-I${pkgs.boost.dev}/include" + "-I${pkgs.readline.dev}/include" + "-I${pkgs.fuse.dev}/include" + "-I${pkgs.mbedtls}/include" + ]; + + }; + }; + }; +}