Compare commits
6 Commits
0e33a2f672
...
f2a70fbdf9
| Author | SHA1 | Date | |
|---|---|---|---|
| f2a70fbdf9 | |||
| 51ad947887 | |||
| 68d0291fbf | |||
| 650798e229 | |||
| 047107ee21 | |||
| 17bc48eab7 |
161
config/flake.nix
Normal file
161
config/flake.nix
Normal file
@ -0,0 +1,161 @@
|
||||
rec {
|
||||
description = "";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "nixpkgs"; # Use nixpkgs from system registry
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
|
||||
rust-overlay.url = "github:oxalica/rust-overlay";
|
||||
rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
rust-overlay,
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true;
|
||||
overlays = [
|
||||
rust-overlay.overlays.default
|
||||
];
|
||||
};
|
||||
|
||||
python = pkgs.python313.withPackages (p:
|
||||
with p; [
|
||||
pyside6
|
||||
ffmpeg-python
|
||||
matplotlib
|
||||
numpy
|
||||
]);
|
||||
|
||||
rust = pkgs.rust-bin.stable.latest.default.override {
|
||||
extensions = ["rust-src"]; # Include the Rust stdlib source (for IntelliJ)
|
||||
};
|
||||
|
||||
# 64 bit C/C++ compilers that don't collide (use the same libc)
|
||||
bintools = pkgs.wrapBintoolsWith {
|
||||
bintools = pkgs.bintools.bintools; # Unwrapped bintools
|
||||
libc = pkgs.glibc;
|
||||
};
|
||||
gcc = pkgs.hiPrio (pkgs.wrapCCWith {
|
||||
cc = pkgs.gcc.cc; # Unwrapped gcc
|
||||
libc = pkgs.glibc;
|
||||
bintools = bintools;
|
||||
});
|
||||
clang = pkgs.wrapCCWith {
|
||||
cc = pkgs.clang.cc; # Unwrapped clang
|
||||
libc = pkgs.glibc;
|
||||
bintools = bintools;
|
||||
};
|
||||
|
||||
# Multilib C/C++ compilers that don't collide (use the same libc)
|
||||
bintools_multilib = pkgs.wrapBintoolsWith {
|
||||
bintools = pkgs.bintools.bintools; # Unwrapped bintools
|
||||
libc = pkgs.glibc_multi;
|
||||
};
|
||||
gcc_multilib = pkgs.hiPrio (pkgs.wrapCCWith {
|
||||
cc = pkgs.gcc.cc; # Unwrapped gcc
|
||||
libc = pkgs.glibc_multi;
|
||||
bintools = bintools_multilib;
|
||||
});
|
||||
clang_multilib = pkgs.wrapCCWith {
|
||||
cc = pkgs.clang.cc; # Unwrapped clang
|
||||
libc = pkgs.glibc_multi;
|
||||
bintools = bintools_multilib;
|
||||
};
|
||||
in {
|
||||
# TODO: Add default packages for different languages
|
||||
# TODO: check nixpkgs docs for buildPythonApplication
|
||||
# packages.default = pkgs.buildPythonApplication {
|
||||
# pname = "pyside6_image_viewer";
|
||||
# version = "0.1.0";
|
||||
# };
|
||||
|
||||
devShell = pkgs.mkShell {
|
||||
name = description;
|
||||
|
||||
# Comments on buildInputs, nativeBuildInputs, buildPackages:
|
||||
# https://discourse.nixos.org/t/use-buildinputs-or-nativebuildinputs-for-nix-shell/8464
|
||||
# For our "nix develop" shell, buildInputs can be used for everything.
|
||||
|
||||
# Stuff that's linked against.
|
||||
# Architecture will be the host platform.
|
||||
# Packages will be added to $PATH unless "strictDeps = true;".
|
||||
buildInputs = with pkgs; [
|
||||
# Languages:
|
||||
# python
|
||||
# rust
|
||||
# bintools
|
||||
# gcc
|
||||
# clang
|
||||
# bintools_multilib
|
||||
# gcc_multilib
|
||||
# clang_multilib
|
||||
|
||||
# C/C++:
|
||||
# gdb
|
||||
# valgrind
|
||||
# gnumake
|
||||
# cmake
|
||||
# boost
|
||||
# sfml
|
||||
|
||||
# Qt:
|
||||
# qt6.qtbase
|
||||
# qt6.full
|
||||
# qt6.wrapQtAppsHook # For the shellHook
|
||||
];
|
||||
|
||||
# Stuff ran at build-time (e.g. cmake, autoPatchelfHook).
|
||||
# Architecture will be the build/target platform (relevant for e.g. cross-compilation).
|
||||
# Packages will be added to $PATH.
|
||||
nativeBuildInputs = with pkgs; [];
|
||||
|
||||
# Rust stdlib source:
|
||||
# RUST_SRC_PATH = "${rust}/lib/rustlib/src/rust/library";
|
||||
|
||||
# Custom dynamic libraries:
|
||||
# LD_LIBRARY_PATH = builtins.concatStringsSep ":" [
|
||||
# # Rust Bevy GUI app
|
||||
# "${pkgs.xorg.libX11}/lib"
|
||||
# "${pkgs.xorg.libXcursor}/lib"
|
||||
# "${pkgs.xorg.libXrandr}/lib"
|
||||
# "${pkgs.xorg.libXi}/lib"
|
||||
# "${pkgs.libGL}/lib"
|
||||
# ];
|
||||
|
||||
# Dynamic libraries from buildinputs:
|
||||
# LD_LIBRARY_PATH = nixpkgs.lib.makeLibraryPath buildInputs;
|
||||
|
||||
# Setup the shell when entering the "nix develop" environment (bash script).
|
||||
shellHook = let
|
||||
# Use this to specify commands that should be ran after entering fish shell
|
||||
initProjectShell = pkgs.writeShellScript "init-shell.fish" ''
|
||||
echo "Entering \"${description}\" environment..."
|
||||
|
||||
# Add shell abbreviations specific to this build environment
|
||||
|
||||
# Rust Bevy:
|
||||
# abbr -a build-release-windows "CARGO_FEATURE_PURE=1 cargo xwin build --release --target x86_64-pc-windows-msvc"
|
||||
'';
|
||||
in
|
||||
builtins.concatStringsSep "\n" [
|
||||
# Launch into pure fish shell
|
||||
''
|
||||
exec "$(type -p fish)" -C "source ${initProjectShell}"
|
||||
''
|
||||
|
||||
# Qt: Launch into wrapped fish shell
|
||||
# ''
|
||||
# fishdir=$(mktemp -d)
|
||||
# makeWrapper "$(type -p fish)" "$fishdir/fish" "''${qtWrapperArgs[@]}"
|
||||
# exec "$fishdir/fish" -C "source ${initProjectShell}"
|
||||
# ''
|
||||
];
|
||||
};
|
||||
});
|
||||
}
|
||||
87
env/flake_c++-with-libs.nix
vendored
87
env/flake_c++-with-libs.nix
vendored
@ -1,87 +0,0 @@
|
||||
{
|
||||
description = "C/C++ Environment with Libraries";
|
||||
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||
inputs.devshell.url = "github:numtide/devshell";
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
devshell,
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true; # For clion
|
||||
overlays = [devshell.overlays.default];
|
||||
};
|
||||
|
||||
# NOTE: Usual 64 bit compilers that don't collide
|
||||
bintools = pkgs.wrapBintoolsWith {
|
||||
bintools = pkgs.bintools.bintools;
|
||||
libc = pkgs.glibc;
|
||||
};
|
||||
gcc13 = pkgs.hiPrio (pkgs.wrapCCWith {
|
||||
cc = pkgs.gcc13.cc;
|
||||
libc = pkgs.glibc;
|
||||
bintools = bintools;
|
||||
});
|
||||
clang16 = pkgs.wrapCCWith {
|
||||
cc = pkgs.clang_16.cc;
|
||||
libc = pkgs.glibc;
|
||||
bintools = bintools;
|
||||
};
|
||||
|
||||
# NOTE: Multilib compilers that don't collide
|
||||
bintools_multi = pkgs.wrapBintoolsWith {
|
||||
bintools = pkgs.bintools.bintools; # Get the unwrapped bintools from the wrapper
|
||||
libc = pkgs.glibc_multi;
|
||||
};
|
||||
gcc13_multi = pkgs.hiPrio (pkgs.wrapCCWith {
|
||||
cc = pkgs.gcc13.cc; # Get the unwrapped gcc from the wrapper
|
||||
libc = pkgs.glibc_multi;
|
||||
bintools = bintools_multi;
|
||||
});
|
||||
clang16_multi = pkgs.wrapCCWith {
|
||||
cc = pkgs.clang_16.cc;
|
||||
libc = pkgs.glibc_multi;
|
||||
bintools = bintools_multi;
|
||||
};
|
||||
in {
|
||||
# NOTE: We cannot use devshell, as it doesn't propagate library paths (yet?)
|
||||
devShells.default = pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
# Compilers
|
||||
bintools
|
||||
gcc13
|
||||
clang16
|
||||
# bintools_multi
|
||||
# gcc13_multi
|
||||
# clang15_multi
|
||||
|
||||
# Native buildinputs
|
||||
gnumake
|
||||
cmake
|
||||
# nasm
|
||||
|
||||
# Development
|
||||
# bear # To generate compilation database
|
||||
gdb
|
||||
# cling # To try out my bullshit implementations
|
||||
# doxygen # Generate docs + graphs
|
||||
|
||||
# C++ Libraries
|
||||
# boost181
|
||||
# raylib
|
||||
# sfml
|
||||
|
||||
# C Libraries
|
||||
# blas
|
||||
# lapack
|
||||
# libsvm
|
||||
];
|
||||
};
|
||||
});
|
||||
}
|
||||
87
env/flake_c++.nix
vendored
87
env/flake_c++.nix
vendored
@ -1,87 +0,0 @@
|
||||
{
|
||||
description = "C/C++ Environment";
|
||||
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||
inputs.devshell.url = "github:numtide/devshell";
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
devshell,
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true; # For clion
|
||||
overlays = [devshell.overlays.default];
|
||||
};
|
||||
|
||||
# NOTE: Usual 64 bit compilers that don't collide
|
||||
bintools = pkgs.wrapBintoolsWith {
|
||||
bintools = pkgs.bintools.bintools;
|
||||
libc = pkgs.glibc;
|
||||
};
|
||||
gcc13 = pkgs.hiPrio (pkgs.wrapCCWith {
|
||||
cc = pkgs.gcc13.cc;
|
||||
libc = pkgs.glibc;
|
||||
bintools = bintools;
|
||||
});
|
||||
clang16 = pkgs.wrapCCWith {
|
||||
cc = pkgs.clang_16.cc;
|
||||
libc = pkgs.glibc;
|
||||
bintools = bintools;
|
||||
};
|
||||
|
||||
# NOTE: Multilib compilers that don't collide
|
||||
bintools_multi = pkgs.wrapBintoolsWith {
|
||||
bintools = pkgs.bintools.bintools; # Get the unwrapped bintools from the wrapper
|
||||
libc = pkgs.glibc_multi;
|
||||
};
|
||||
gcc13_multi = pkgs.hiPrio (pkgs.wrapCCWith {
|
||||
cc = pkgs.gcc13.cc; # Get the unwrapped gcc from the wrapper
|
||||
libc = pkgs.glibc_multi;
|
||||
bintools = bintools_multi;
|
||||
});
|
||||
clang16_multi = pkgs.wrapCCWith {
|
||||
cc = pkgs.clang_16.cc;
|
||||
libc = pkgs.glibc_multi;
|
||||
bintools = bintools_multi;
|
||||
};
|
||||
in {
|
||||
# devShell = pkgs.devshell.mkShell ...
|
||||
devShell = pkgs.devshell.mkShell {
|
||||
name = "C/C++ Environment";
|
||||
|
||||
packages = with pkgs; [
|
||||
# Compilers
|
||||
bintools
|
||||
gcc13
|
||||
clang16
|
||||
# bintools_multi
|
||||
# gcc13_multi
|
||||
# clang15_multi
|
||||
|
||||
# Native buildinputs
|
||||
gnumake
|
||||
cmake
|
||||
# nasm
|
||||
|
||||
# Development
|
||||
# bear # To generate compilation database
|
||||
gdb
|
||||
# cling # To try out my bullshit implementations
|
||||
# doxygen # Generate docs + graphs
|
||||
];
|
||||
|
||||
commands = [
|
||||
# {
|
||||
# name = "ide";
|
||||
# help = "Run clion for project";
|
||||
# command = "clion &>/dev/null ./ &";
|
||||
# }
|
||||
];
|
||||
};
|
||||
});
|
||||
}
|
||||
33
env/flake_java.nix
vendored
33
env/flake_java.nix
vendored
@ -1,33 +0,0 @@
|
||||
{
|
||||
description = "Java Environment";
|
||||
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||
inputs.devshell.url = "github:numtide/devshell";
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
devshell,
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true; # For clion
|
||||
overlays = [devshell.overlays.default];
|
||||
};
|
||||
in {
|
||||
devShell = pkgs.devshell.mkShell {
|
||||
name = "Java Environment";
|
||||
|
||||
packages = with pkgs; [
|
||||
jdk22
|
||||
jdt-language-server
|
||||
gradle
|
||||
];
|
||||
|
||||
commands = [];
|
||||
};
|
||||
});
|
||||
}
|
||||
42
env/flake_latex.nix
vendored
42
env/flake_latex.nix
vendored
@ -1,42 +0,0 @@
|
||||
{
|
||||
description = "LaTeX Environment";
|
||||
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||
inputs.devshell.url = "github:numtide/devshell";
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
devshell,
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true;
|
||||
overlays = [devshell.overlays.default];
|
||||
};
|
||||
|
||||
latexPython = pkgs.python311.withPackages (p:
|
||||
with p; [
|
||||
rich
|
||||
pygments
|
||||
]);
|
||||
in {
|
||||
devShell = pkgs.devshell.mkShell {
|
||||
name = "LaTeX Environment";
|
||||
|
||||
packages = with pkgs; [
|
||||
texlive.combined.scheme-full
|
||||
inkscape
|
||||
latexPython
|
||||
texlab
|
||||
];
|
||||
|
||||
# Use $1 for positional args
|
||||
# commands = [
|
||||
# ];
|
||||
};
|
||||
});
|
||||
}
|
||||
63
env/flake_python.nix
vendored
63
env/flake_python.nix
vendored
@ -1,63 +0,0 @@
|
||||
{
|
||||
description = "Python Environment";
|
||||
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||
inputs.devshell.url = "github:numtide/devshell";
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
devshell,
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true;
|
||||
overlays = [devshell.overlays.default];
|
||||
};
|
||||
|
||||
python-with-packages = pkgs.python311.withPackages (p:
|
||||
with p; [
|
||||
# Basic
|
||||
rich
|
||||
# python-dotenv
|
||||
|
||||
# Math
|
||||
# numpy
|
||||
# matplotlib
|
||||
# sympy
|
||||
|
||||
# Web
|
||||
# flask
|
||||
# flask-sqlalchemy
|
||||
# sqlalchemy
|
||||
|
||||
# Discord
|
||||
# discordpy
|
||||
# pynacl # discordpy voice support
|
||||
|
||||
# Scraping
|
||||
# beautifulsoup4
|
||||
# requests
|
||||
]);
|
||||
in {
|
||||
devShell = pkgs.devshell.mkShell {
|
||||
name = "Python Environment";
|
||||
|
||||
packages = with pkgs; [
|
||||
python-with-packages
|
||||
];
|
||||
|
||||
# Use $1 for positional args
|
||||
commands = [
|
||||
# {
|
||||
# name = "";
|
||||
# help = "";
|
||||
# command = "";
|
||||
# }
|
||||
];
|
||||
};
|
||||
});
|
||||
}
|
||||
62
env/flake_rust.nix
vendored
62
env/flake_rust.nix
vendored
@ -1,62 +0,0 @@
|
||||
{
|
||||
description = "Rust Environment";
|
||||
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||
inputs.devshell.url = "github:numtide/devshell";
|
||||
inputs.rust-overlay.url = "github:oxalica/rust-overlay";
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
devshell,
|
||||
rust-overlay,
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true; # For clion
|
||||
overlays = [
|
||||
devshell.overlays.default
|
||||
rust-overlay.overlays.default
|
||||
];
|
||||
};
|
||||
|
||||
# Includes cargo, rustc, rustfmt
|
||||
rust-stable = pkgs.rust-bin.stable.latest.default.override {
|
||||
extensions = ["rust-src"]; # Include the rust stdlib source for intellij
|
||||
};
|
||||
in {
|
||||
devShell = pkgs.devshell.mkShell {
|
||||
name = "Rust Environment";
|
||||
|
||||
packages = with pkgs; [
|
||||
rust-stable
|
||||
rust-analyzer
|
||||
];
|
||||
|
||||
env = [
|
||||
# Allow for intellij to find the stdlib
|
||||
# {
|
||||
# name = "RUST_SRC_PATH";
|
||||
# value = "${rust-stable}/lib/rustlib/src/rust/library";
|
||||
# }
|
||||
|
||||
# Use this if the rust binary needs additional libraries
|
||||
# {
|
||||
# name = "LD_LIBRARY_PATH";
|
||||
# value = "${pkgs.xorg.libX11}/lib:${pkgs.xorg.libXcursor}/lib:${pkgs.xorg.libXrandr}/lib:${pkgs.xorg.libXi}/lib:${pkgs.libGL}/lib";
|
||||
# }
|
||||
];
|
||||
|
||||
commands = [
|
||||
# {
|
||||
# name = "ide";
|
||||
# help = "Run clion for project";
|
||||
# command = "clion &>/dev/null ./ &";
|
||||
# }
|
||||
];
|
||||
};
|
||||
});
|
||||
}
|
||||
@ -78,6 +78,7 @@ rec {
|
||||
"$mainMod, N" = ["exec, neovide"];
|
||||
"$mainMod SHIFT, N" = ["exec, neovide ${config.paths.dotfiles}/navi/christoph.cheat"];
|
||||
"$mainMod CTRL, N" = ["exec, kitty navi"];
|
||||
"$mainMod SHIFT, F" = ["exec, neovide ${config.paths.dotfiles}/flake.nix"];
|
||||
|
||||
"$mainMod, P" = ["exec, hyprpicker --autocopy --format=hex"];
|
||||
"$mainMod, S" = ["exec, grim -g \"$(slurp)\""];
|
||||
|
||||
@ -23,6 +23,8 @@ in {
|
||||
|
||||
# TODO: Derivation borked on standalone HM
|
||||
# (lib.optionals firefox.gnomeTheme [firefox-gnome-theme])
|
||||
|
||||
[vdhcoapp]
|
||||
];
|
||||
|
||||
home.sessionVariables = lib.mkMerge [
|
||||
|
||||
@ -35,7 +35,7 @@ in {
|
||||
# nodejs_latest
|
||||
|
||||
# Language servers
|
||||
clang-tools_18
|
||||
clang-tools
|
||||
clojure-lsp
|
||||
cmake-language-server
|
||||
haskell-language-server
|
||||
|
||||
@ -12,7 +12,8 @@
|
||||
};
|
||||
|
||||
modifications = final: prev: rec {
|
||||
# dconf-editor-wrapped = import ./dconf-editor.nix { inherit final prev; }; # Only kept as an example, has nothing to do with current dconf-editor-wrapped derivation
|
||||
# Only kept as an example, has nothing to do with current dconf-editor-wrapped derivation
|
||||
# dconf-editor-wrapped = import ./dconf-editor.nix { inherit final prev; };
|
||||
# Use dconf-editor.nix: { final, prev }: final.<package>.overrideAttrs (oldAttrs: { ... }) or sth similar
|
||||
};
|
||||
in
|
||||
|
||||
@ -359,6 +359,7 @@ with mylib.networking; {
|
||||
"networkmanager"
|
||||
"wheel"
|
||||
"audio"
|
||||
"video"
|
||||
"pipewire"
|
||||
"realtime"
|
||||
"gamemode"
|
||||
@ -515,8 +516,8 @@ with mylib.networking; {
|
||||
];
|
||||
};
|
||||
|
||||
gnome.gnome-keyring.enable = false; # TODO: Do apps require this?
|
||||
gnome.gcr-ssh-agent.enable = false;
|
||||
gnome.gnome-keyring.enable = true; # Apps (e.g. nextcloud) require this
|
||||
gnome.gcr-ssh-agent.enable = false; # TODO: Use this instead of ssh.startAgent?
|
||||
};
|
||||
|
||||
virtualisation = {
|
||||
|
||||
Reference in New Issue
Block a user