far out test

This commit is contained in:
cnst
2024-07-13 06:45:01 +02:00
parent b7580af22a
commit 17ff4d452a
9 changed files with 263 additions and 32 deletions

75
flake.lock generated
View File

@@ -37,6 +37,27 @@
"type": "github" "type": "github"
} }
}, },
"fenix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1720765732,
"narHash": "sha256-I1tpD/7KqcKaVVHSXQcLx6oxvdQEVHjCrcEqunsmBeg=",
"owner": "nix-community",
"repo": "fenix",
"rev": "e7aefd2e730c4d43adca53602a0446c29653fef8",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "fenix",
"type": "github"
}
},
"firefox-nightly": { "firefox-nightly": {
"inputs": { "inputs": {
"cachix": "cachix", "cachix": "cachix",
@@ -48,11 +69,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1720700945, "lastModified": 1720790404,
"narHash": "sha256-5X162qEyixlrXji9cUFjxxJAkIMunq2xTBQ5a1eR2gk=", "narHash": "sha256-9qe2eVsUAIZIf9aDa7PVui77cr1RW4CpZbWTwOdtXrI=",
"owner": "nix-community", "owner": "nix-community",
"repo": "flake-firefox-nightly", "repo": "flake-firefox-nightly",
"rev": "fc711e0d70732be3c98bc27e88250ec818eb45db", "rev": "20773f6a9a6bb52444f5fe7495932740f840fe6d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -316,11 +337,11 @@
}, },
"hardware": { "hardware": {
"locked": { "locked": {
"lastModified": 1720515935, "lastModified": 1720737798,
"narHash": "sha256-8b+fzR4W2hI5axwB+4nBwoA15awPKkck4ghhCt8v39M=", "narHash": "sha256-G/OtEAts7ZUvW5lrGMXSb8HqRp2Jr9I7reBuvCOL54w=",
"owner": "nixos", "owner": "nixos",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "a111ce6b537df12a39874aa9672caa87f8677eda", "rev": "c5013aa7ce2c7ec90acee5d965d950c8348db751",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -358,11 +379,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1720646128, "lastModified": 1720734513,
"narHash": "sha256-BivO5yIQukDlJL+1875Sqf3GuOPxZDdA48dYDi3PkL8=", "narHash": "sha256-neWQ8eNtLTd+YMesb7WjKl1SVCbDyCm46LUgP/g/hdo=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "c085b984ff2808bf322f375b10fea5a415a9c43d", "rev": "90ae324e2c56af10f20549ab72014804a3064c7f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -443,11 +464,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1720697493, "lastModified": 1720796317,
"narHash": "sha256-vFIYB95F9m4JJiYNzboO/6lHAgma7W9MWZt22Gf5F2M=", "narHash": "sha256-2B4PFl75fFjQkquRCPB5PYeY0bFqF/xvsLy014c+7W4=",
"owner": "nix-community", "owner": "nix-community",
"repo": "neovim-nightly-overlay", "repo": "neovim-nightly-overlay",
"rev": "06c3c793a59f17571b2d8b630fadee5bffd6ce25", "rev": "a07ca86e6922bc2a68ec4c801ab7e05e12397af0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -459,11 +480,11 @@
"neovim-src": { "neovim-src": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1720651300, "lastModified": 1720739431,
"narHash": "sha256-Zn9VHit79RpdRGPfpGZgx0m3HDSAjmhnsAak7+875KM=", "narHash": "sha256-lEgZwuKL1eLsiFqoSiOZgq30jQCFTEYlreL79Txbxu4=",
"owner": "neovim", "owner": "neovim",
"repo": "neovim", "repo": "neovim",
"rev": "afbe7736a4966f22146d857f246eac01cd080773", "rev": "a5de650f0eb93a848831f1ba631485437a82d57b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -521,11 +542,11 @@
}, },
"nixpkgs-stable_2": { "nixpkgs-stable_2": {
"locked": { "locked": {
"lastModified": 1720553833, "lastModified": 1720691131,
"narHash": "sha256-IXMiHQMtdShDXcBW95ctA+m5Oq2kLxnBt7WlMxvDQXA=", "narHash": "sha256-CWT+KN8aTPyMIx8P303gsVxUnkinIz0a/Cmasz1jyIM=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "249fbde2a178a2ea2638b65b9ecebd531b338cf9", "rev": "a046c1202e11b62cbede5385ba64908feb7bfac4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -580,6 +601,7 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"fenix": "fenix",
"firefox-nightly": "firefox-nightly", "firefox-nightly": "firefox-nightly",
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils_2",
"hardware": "hardware", "hardware": "hardware",
@@ -591,6 +613,23 @@
"systems": "systems_3" "systems": "systems_3"
} }
}, },
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1720717809,
"narHash": "sha256-6I+fm+nTLF/iaj7ffiFGlSY7POmubwUaPA/Wq0Bm53M=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "ffbc5ad993d5cd2f3b8bcf9a511165470944ab91",
"type": "github"
},
"original": {
"owner": "rust-lang",
"ref": "nightly",
"repo": "rust-analyzer",
"type": "github"
}
},
"rust-overlay": { "rust-overlay": {
"inputs": { "inputs": {
"flake-utils": [ "flake-utils": [

View File

@@ -31,6 +31,10 @@
url = "github:nix-community/flake-firefox-nightly"; url = "github:nix-community/flake-firefox-nightly";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = { outputs = {
self, self,
@@ -38,6 +42,7 @@
home-manager, home-manager,
systems, systems,
lanzaboote, lanzaboote,
fenix,
... ...
} @ inputs: let } @ inputs: let
inherit (self) outputs; inherit (self) outputs;
@@ -52,6 +57,8 @@
); );
in { in {
inherit lib; inherit lib;
packages.x86_64-linux.default = fenix.packages.x86_64-linux.minimal.toolchain;
devShells = forEachSystem (pkgs: import ./core/shell/dev.nix {inherit pkgs;});
formatter = forEachSystem (pkgs: pkgs.alejandra); formatter = forEachSystem (pkgs: pkgs.alejandra);
nixosConfigurations = { nixosConfigurations = {

View File

@@ -7,6 +7,7 @@
syntaxHighlighting.enable = true; syntaxHighlighting.enable = true;
shellAliases = { shellAliases = {
nixdev = "nix develop ~/.nix-config -c $SHELL";
nixconfig = "cd /home/cnst/.nix-config/"; nixconfig = "cd /home/cnst/.nix-config/";
ll = "ls -l"; ll = "ls -l";
nixupdate = "nh os switch -v -H cnix"; nixupdate = "nh os switch -v -H cnix";

View File

@@ -9,15 +9,9 @@ with pkgs; let
fzf fzf
git git
sqlite sqlite
tree-sitter
]; ];
c = [ c = [
clang
clang-tools
cmake
gcc
gnumake
]; ];
gamedev = [ gamedev = [
@@ -69,9 +63,9 @@ with pkgs; let
]; ];
rust = [ rust = [
cargo
rustfmt rustfmt
rust-analyzer rust-analyzer
clippy
]; ];
shell = [ shell = [
@@ -95,7 +89,6 @@ with pkgs; let
tools ++ c ++ gamedev ++ golang ++ lua ++ markup ++ nix ++ python ++ rust ++ shell ++ web; tools ++ c ++ gamedev ++ golang ++ lua ++ markup ++ nix ++ python ++ rust ++ shell ++ web;
in { in {
# for quick development # for quick development
home.packages = rust;
programs.neovim = { programs.neovim = {
enable = true; enable = true;

View File

@@ -0,0 +1,12 @@
{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;}

167
nixos/core/shell/dev.nix Normal file
View File

@@ -0,0 +1,167 @@
{
pkgs,
inputs,
...
}: let
minimalMkShell = import ./_minimal.nix {inherit pkgs;};
# 16 is broken: https://github.com/NixOS/nixpkgs/issues/244609
# llvmPackages = pkgs.llvmPackages_16;
llvmPackages = pkgs.llvmPackages_15;
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"
]
);
_rustBuildOxalica = inputs.rust-overlay.packages.${pkgs.stdenv.hostPlatform.system}.rust.override {
extensions = [
"rust-src"
"rust-analyzer"
"clippy"
];
};
# so far I can't tell a big difference...
_rustBuild = _rustBuildFenix;
in
# _rustBuild = _rustBuildFenix;
minimalMkShell {
name = "cnst-nixcfg-dev";
hardeningDisable = ["fortify"];
shellHook = ''
exec nu
'';
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; [
llvmPackages.libclang
llvmPackages.libclang.lib
pipewire
freetype
ncurses
pcsclite
openssl
clang
libusb1
gpgme
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
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
];
}

View File

@@ -46,14 +46,10 @@
curl curl
fzf fzf
gnome-disk-utility gnome-disk-utility
hyprlang
killall killall
lazygit lazygit
ntfs3g ntfs3g
p7zip p7zip
python3
python312Packages.httplib2
python312Packages.oauth2
ripgrep ripgrep
stow stow
tmux tmux
@@ -66,6 +62,21 @@
wlroots wlroots
xdg-user-dirs xdg-user-dirs
xdg-utils xdg-utils
# Dev
binutils
clang
clang-tools
cargo-edit
cargo-insta
cargo-nextest
gcc
gnumake
cmake
hyprlang
python3
python312Packages.httplib2
python312Packages.oauth2
]; ];
}; };
} }

View File

@@ -24,7 +24,7 @@
}; };
}; };
nixpkgs = { nixpkgs = {
overlays = [ overlays = with inputs; [
(_: prev: { (_: prev: {
python312 = prev.python312.override {packageOverrides = _: pysuper: {nose = pysuper.pynose;};}; python312 = prev.python312.override {packageOverrides = _: pysuper: {nose = pysuper.pynose;};};
}) })

View File

@@ -1,6 +1,7 @@
{pkgs, ...}: { {pkgs, ...}: {
services.locate = { services.locate = {
enable = true; enable = true;
locate = pkgs.plocate; package = pkgs.plocate;
localuser = null;
}; };
} }