mirror of
https://github.com/Username404-59/Dotfiles-NixOS.git
synced 2026-07-03 21:08:08 +02:00
123 lines
3.4 KiB
Nix
123 lines
3.4 KiB
Nix
{ pkgs, lib, nixtamal, ... }:
|
|
|
|
let
|
|
functions = rec {
|
|
mkSpecial = pkg: version: src_name: suffix:
|
|
let
|
|
src = nixtamal.${src_name + suffix};
|
|
in pkg.overrideAttrs (old: {
|
|
inherit version src;
|
|
} // lib.optionalAttrs (old ? cargoDeps) { # Removes the need to set the cargo vendor hash (that nixtamal doesn't handle, obviously)
|
|
cargoDeps = pkgs.rustPlatform.importCargoLock {
|
|
lockFile = "${src}/Cargo.lock";
|
|
};
|
|
});
|
|
mkSpecialAuto = pkg: version: suffix: mkSpecial pkg version pkg.pname suffix;
|
|
mkSpecialVersion = pkg: version: mkSpecialAuto pkg version "";
|
|
mkUnstable = pkg: mkSpecialAuto pkg "unstable" "-git";
|
|
|
|
mkPatched = pkg: newPatches:
|
|
pkg.overrideAttrs (old: {
|
|
patches = newPatches;
|
|
});
|
|
mkPatchedAuto = pkg: mkPatched pkg [ nixtamal.${pkg.pname + "-patch"} ];
|
|
|
|
mkWithCFlags = pkg: flags: (pkg.override {
|
|
stdenv = pkgs.fastStdenv; # Faster GCC
|
|
}).overrideAttrs (old: {
|
|
NIX_CFLAGS_COMPILE = (old.NIX_CFLAGS_COMPILE or "") + " ${flags}"; # https://gcc.gnu.org/onlinedocs/gcc-16.1.0/gcc/Optimize-Options.html
|
|
});
|
|
|
|
importFlake = flakeRef:
|
|
let
|
|
src = nixtamal.${flakeRef};
|
|
in
|
|
((import nixtamal.flake-compat { inherit pkgs; }) {
|
|
inherit src;
|
|
}).defaultNix.packages.${pkgs.system}.default;
|
|
};
|
|
in
|
|
{
|
|
_module.args.functions = functions;
|
|
home-manager.extraSpecialArgs = { inherit functions; };
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
git git-lfs
|
|
curl
|
|
wget
|
|
neovim
|
|
fastfetch
|
|
htop
|
|
killall
|
|
file
|
|
e2fsprogs
|
|
cpu-x
|
|
steam-run
|
|
exfatprogs
|
|
pkgs.nixtamal # Important
|
|
android-tools
|
|
kdePackages.kleopatra # Needed to add keys easily
|
|
nload
|
|
graalvmPackages.graalvm-ce # Java
|
|
clang gcc mold
|
|
cmake
|
|
sbctl # For secure boot with Limine
|
|
jq # I use it somewhere in my nixtamal manifest
|
|
(functions.mkSpecial lsfg-vk-ui "unstable" "lsfg-vk" "-git")
|
|
steamcmd
|
|
];
|
|
|
|
programs.steam = {
|
|
enable = true;
|
|
dedicatedServer.openFirewall = true; # 27015 port
|
|
remotePlay.openFirewall = true;
|
|
localNetworkGameTransfers.openFirewall = true;
|
|
extraCompatPackages = with pkgs; [
|
|
proton-ge-bin
|
|
dw-proton-bin # From nix-citizen overlay
|
|
];
|
|
# Note: to make another disk visible to games add
|
|
# STEAM_COMPAT_MOUNTS=/disk2 %command%
|
|
# to commandline options
|
|
};
|
|
programs.gamescope = {
|
|
enable = true;
|
|
capSysNice = true;
|
|
};
|
|
|
|
services.flatpak.enable = true;
|
|
systemd.user.services.flatpak-repos = {
|
|
after = [ "network.target" ];
|
|
serviceConfig = {
|
|
Type = "oneshot";
|
|
RemainAfterExit = "yes";
|
|
ExecStart = "${pkgs.bash}/bin/sh -c '" +
|
|
"${pkgs.flatpak}/bin/flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo && " +
|
|
"${pkgs.flatpak}/bin/flatpak remote-add --user --if-not-exists flathub-beta https://flathub.org/beta-repo/flathub-beta.flatpakrepo" +
|
|
"'";
|
|
};
|
|
wantedBy = [ "default.target" ];
|
|
};
|
|
|
|
services.lact = {
|
|
enable = true;
|
|
package = functions.mkPatchedAuto pkgs.lact;
|
|
};
|
|
|
|
programs.gnupg.agent = {
|
|
enable = true;
|
|
enableSSHSupport = true;
|
|
pinentryPackage = pkgs.pinentry-qt;
|
|
};
|
|
|
|
programs.partition-manager.enable = true;
|
|
|
|
environment.sessionVariables = rec {
|
|
NIXTAMAL_DIRECTORY = "tamal";
|
|
};
|
|
|
|
environment.shellAliases = {
|
|
nixtamal = "bash -c 'cd /etc/nixos && nixtamal \"$@\"' --";
|
|
};
|
|
}
|