From 1ae036c0323c78c08fdf2b8c64bedcf17748e2cf Mon Sep 17 00:00:00 2001 From: Levi Neely <141506390+lneely@users.noreply.github.com> Date: Fri, 11 Apr 2025 20:54:28 +0200 Subject: [PATCH] nix shell now uses flakes --- default.nix | 31 --------------------------- flake.lock | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 47 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 108 insertions(+), 31 deletions(-) delete mode 100644 default.nix create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/default.nix b/default.nix deleted file mode 100644 index 3ded3b9..0000000 --- a/default.nix +++ /dev/null @@ -1,31 +0,0 @@ -let - pkgs = import {}; -in -pkgs.mkShell { - buildInputs = with pkgs; [ - 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" - ]; -} 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" + ]; + + }; + }; + }; +}