shells and stuff 2

This commit is contained in:
cnst
2024-07-13 09:02:31 +02:00
parent a20d307574
commit df0a92cde1
4 changed files with 28 additions and 159 deletions

6
flake.lock generated
View File

@@ -45,11 +45,11 @@
"rust-analyzer-src": "rust-analyzer-src" "rust-analyzer-src": "rust-analyzer-src"
}, },
"locked": { "locked": {
"lastModified": 1720765732, "lastModified": 1720852044,
"narHash": "sha256-I1tpD/7KqcKaVVHSXQcLx6oxvdQEVHjCrcEqunsmBeg=", "narHash": "sha256-3NBYz8VuXuKU+8ONd9NFafCNjPEGHIZQ2Mdoam1a4mY=",
"owner": "nix-community", "owner": "nix-community",
"repo": "fenix", "repo": "fenix",
"rev": "e7aefd2e730c4d43adca53602a0446c29653fef8", "rev": "5087b12a595ee73131a944d922f24d81dae05725",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -35,6 +35,7 @@
url = "github:nix-community/fenix"; url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
rust-overlay.url = "github:oxalica/rust-overlay";
}; };
outputs = { outputs = {
self, self,
@@ -42,6 +43,8 @@
home-manager, home-manager,
systems, systems,
lanzaboote, lanzaboote,
flake-utils,
rust-overlay,
... ...
} @ inputs: let } @ inputs: let
inherit (self) outputs; inherit (self) outputs;

View File

@@ -1,151 +1,29 @@
{ {nixpkgs ? import <nixpkgs> {}}: let
pkgs, rustOverlay = builtins.fetchTarball "https://github.com/oxalica/rust-overlay/archive/master.tar.gz";
inputs, pinnedPkgs = nixpkgs.fetchFromGitHub {
... owner = "NixOS";
}: let repo = "nixpkgs";
minimalMkShell = import ./minimal.nix {inherit pkgs;}; rev = "1fe6ed37fd9beb92afe90671c0c2a662a03463dd";
sha256 = "1daa0y3p17shn9gibr321vx8vija6bfsb5zd7h4pxdbbwjkfq8n2";
# 16 is broken: https://github.com/NixOS/nixpkgs/issues/244609 };
# llvmPackages = pkgs.llvmPackages_16; pkgs = import pinnedPkgs {
llvmPackages = pkgs.llvmPackages_15; overlays = [(import rustOverlay)];
};
gstreamerPath =
""
+ ":"
+ "${pkgs.gst_all_1.gst-plugins-base}/lib/gstreamer-1.0"
+ ":"
+ "${pkgs.gst_all_1.gst-plugins-good}/lib/gstreamer-1.0"
+ ":"
+ "${pkgs.gst_all_1.gst-plugins-bad}/lib/gstreamer-1.0"
+ ":"
+ "${pkgs.gst_all_1.gst-plugins-ugly}/lib/gstreamer-1.0";
_rustBuildFenix = inputs.fenix.packages.${pkgs.stdenv.hostPlatform.system}.latest.withComponents [
"cargo"
"clippy"
"rust-src"
"rustc"
"rustfmt"
"rust-analyzer"
];
_rustBuild = _rustBuildFenix;
in in
minimalMkShell { pkgs.mkShell {
name = "cnst-nixcfg-dev";
hardeningDisable = ["fortify"];
LD_LIBRARY_PATH = "${pkgs.libglvnd}/lib";
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
RUST_BACKTRACE = 1;
GST_PLUGIN_SYSTEM_PATH = gstreamerPath;
nativeBuildInputs = with pkgs; [
_rustBuild
llvmPackages.lldb
# inputs.nix-eval-jobs.outputs.packages.${pkgs.stdenv.hostPlatform.system}.default
nix
## nix lsp
# rnix-lsp # pulls in old nix (CVE)
nil
nixd
## nix space usage / visualizers
nix-du
nix-tree
# nix formatters
nixpkgs-fmt
alejandra
## nodejs
nodejs
yarn
## golang
go
go-outline
gotools
godef
gopls
# generic build essentials
pkg-config
cmake
gnumake
nasm
perl
# json tools
gron
gst_all_1.gstreamer
protobuf
# not a good sign
dos2unix
];
buildInputs = with pkgs; [ buildInputs = with pkgs; [
llvmPackages.libclang rust-bin.stable.latest.default
llvmPackages.libclang.lib rust-analyzer
pipewire
freetype
ncurses
pcsclite
openssl openssl
clang pkg-config
libusb1 ez
gpgme fd
libgpg-error
libgit2
git # passrs
dbus # passrs libsecret
nettle # pass-rust (sequoia->nettle-sys)
gst_all_1.gstreamer
libnice
pango
cairo
gst_all_1.gst-plugins-base
gst_all_1.gst-plugins-good
gst_all_1.gst-plugins-bad
gst_all_1.gst-plugins-ugly
gst_all_1.gst-libav
crate2nix
glslang
gtk3 gtk3
gtk4 gtk4
atk # sirula
gdk-pixbuf # sirula
udev
mesa
libinput # Anodium
seatd # Anodium
xorg.libXcursor
xorg.libXrandr
xorg.libXi # Anodium
libxkbcommon
wayland
wayland-protocols # wezterm
fontconfig
libglvnd
opencv
ffmpeg
egl-wayland # wezterm
xorg.libX11
xorg.libxcb
xorg.xcbutil # wezterm
xorg.xcbproto
xorg.xcbutil
xorg.xcbutilwm # wezterm
xorg.xcbutilkeysyms
xorg.xcbutilimage # wezterm
]; ];
shellHook = ''
alias ls=eza
alias find=fd
'';
RUST_BACKTRACE = 1;
} }

View File

@@ -1,12 +0,0 @@
{pkgs}: let
stdenvMinimal = pkgs.stdenvNoCC.override {
cc = null;
preHook = "";
allowedRequisites = null;
initialPath =
pkgs.lib.filter (a: pkgs.lib.hasPrefix "coreutils" a.name)
pkgs.stdenvNoCC.initialPath;
extraNativeBuildInputs = [];
};
in
pkgs.mkShell.override {stdenv = stdenvMinimal;}