Compare commits

...

6 Commits

Author SHA1 Message Date
Tom Alexander
7828591f87
Fix build on quark. 2025-09-04 18:51:14 -04:00
Tom Alexander
5b9d56fd23
Switch to using my fork of nixpkgs. 2025-09-04 18:51:14 -04:00
Tom Alexander
96ea6c4232
Reduce abmlevel to 2.
Everything got dimmer in 6.14 so I am reducing the abmlevel.
2025-09-04 18:51:14 -04:00
Tom Alexander
2a584915e4
Install d2. 2025-09-04 18:51:14 -04:00
Tom Alexander
a6a50d7c22
Add d2 to emacs. 2025-09-04 18:51:14 -04:00
Tom Alexander
edfafd1017
Add latex packages for org export. 2025-09-04 18:51:13 -04:00
18 changed files with 134 additions and 230 deletions

View File

@ -16,6 +16,7 @@
./roles/boot
./roles/chromecast
./roles/chromium
./roles/d2
./roles/direnv
./roles/distributed_build
./roles/docker

View File

@ -39,11 +39,11 @@
]
},
"locked": {
"lastModified": 1750903843,
"narHash": "sha256-Ng9+f0H5/dW+mq/XOKvB9uwvGbsuiiO6HrPdAcVglCs=",
"lastModified": 1756115622,
"narHash": "sha256-iv8xVtmLMNLWFcDM/HcAPLRGONyTRpzL9NS09RnryRM=",
"owner": "nix-community",
"repo": "disko",
"rev": "83c4da299c1d7d300f8c6fd3a72ac46cb0d59aae",
"rev": "bafad29f89e83b2d861b493aa23034ea16595560",
"type": "github"
},
"original": {
@ -190,18 +190,18 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1751271578,
"narHash": "sha256-P/SQmKDu06x8yv7i0s8bvnnuJYkxVGBWLWHaU+tt4YY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "3016b4b15d13f3089db8a41ef937b13a9e33a8df",
"type": "github"
"lastModified": 1756692750,
"narHash": "sha256-5n58fYrcMlPZB/xvj/yD53Lx+4I2pswUT4Zz3S0tnn0=",
"ref": "og-amd-debug-tools",
"rev": "977f46c905217623642e46eeb259044635bba4d2",
"revCount": 854038,
"type": "git",
"url": "https://github.com/tomalexander/nixpkgs.git"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
"ref": "og-amd-debug-tools",
"type": "git",
"url": "https://github.com/tomalexander/nixpkgs.git"
}
},
"nixpkgs-dda3dcd3f": {
@ -238,18 +238,18 @@
},
"nixpkgs-unoptimized": {
"locked": {
"lastModified": 1751271578,
"narHash": "sha256-P/SQmKDu06x8yv7i0s8bvnnuJYkxVGBWLWHaU+tt4YY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "3016b4b15d13f3089db8a41ef937b13a9e33a8df",
"type": "github"
"lastModified": 1756692750,
"narHash": "sha256-5n58fYrcMlPZB/xvj/yD53Lx+4I2pswUT4Zz3S0tnn0=",
"ref": "og-amd-debug-tools",
"rev": "977f46c905217623642e46eeb259044635bba4d2",
"revCount": 854038,
"type": "git",
"url": "https://github.com/tomalexander/nixpkgs.git"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
"ref": "og-amd-debug-tools",
"type": "git",
"url": "https://github.com/tomalexander/nixpkgs.git"
}
},
"pre-commit-hooks-nix": {

View File

@ -42,9 +42,11 @@
inputs = {
impermanence.url = "github:nix-community/impermanence";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
# nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
# nixpkgs.url = "github:tomalexander/nixpkgs/amd-debug-tools";
nixpkgs.url = "git+https://github.com/tomalexander/nixpkgs.git?ref=og-amd-debug-tools";
nixpkgs-dda3dcd3f.url = "github:NixOS/nixpkgs/dda3dcd3fe03e991015e9a74b22d35950f264a54";
nixpkgs-unoptimized.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-unoptimized.url = "git+https://github.com/tomalexander/nixpkgs.git?ref=og-amd-debug-tools";
lanzaboote = {
url = "github:nix-community/lanzaboote/v0.4.2";

View File

@ -65,6 +65,7 @@
me.bluetooth.enable = true;
me.chromecast.enable = true;
me.chromium.enable = true;
me.d2.enable = true;
me.direnv.enable = true;
me.docker.enable = true;
me.ecc.enable = false;

View File

@ -20,7 +20,7 @@
# amd_pstate=guided :: Same as passive except we can set upper and lower frequency bounds.
# amdgpu.dcdebugmask=0x10 :: Allegedly disables Panel Replay from https://community.frame.work/t/tracking-freezing-arch-linux-amd/39495/32
boot.kernelParams = [
"amdgpu.abmlevel=3"
"amdgpu.abmlevel=2"
"pcie_aspm=force"
# "pcie_aspm.policy=powersupersave"
"nowatchdog"

View File

@ -9,6 +9,6 @@
imports = [ ];
systemd.tmpfiles.rules = [
"w- /sys/class/backlight/amdgpu_bl1/brightness - - - - 85"
"w- /sys/class/backlight/amdgpu_bl1/brightness - - - - 21845"
];
}

View File

@ -26,7 +26,7 @@
me.optimizations = {
enable = true;
arch = "znver5";
arch = "znver4"; # build breaks on znver5 currently.
system_features = [
"gccarch-znver4"
"gccarch-znver5"
@ -60,6 +60,7 @@
me.bluetooth.enable = true;
me.chromecast.enable = true;
me.chromium.enable = true;
me.d2.enable = true;
me.direnv.enable = true;
me.docker.enable = true;
me.ecc.enable = true;

View File

@ -1,76 +0,0 @@
# unpackPhase
# patchPhase
# configurePhase
# buildPhase
# checkPhase
# installPhase
# fixupPhase
# installCheckPhase
# distPhase
{
stdenv,
pkgs,
sqlite,
makeWrapper,
lib,
python3,
systemd,
# setuptools,
# cython,
pkg-config,
# python3Packages,
...
}:
let
version = "1.6.3";
in
python3.pkgs.buildPythonPackage {
pname = "cysystemd";
version = version;
pyproject = true;
# format = "pyproject";
build-system = [
python3.pkgs.setuptools
python3.pkgs.cython
];
buildInputs = [ systemd ];
nativeBuildInputs = with python3.pkgs; [
# setuptools
# setuptools-git-versioning
# setuptools-git
# pyudev
# pkgs.systemd
pkg-config
];
propagatedBuildInputs = with python3.pkgs; [
# pyudev
# pandas
# jinja2
# tabulate
# seaborn
# cysystemd
# jinja2
# matplotlib
# seaborn
];
src = pkgs.fetchgit {
url = "https://github.com/mosquito/cysystemd.git";
tag = version;
sha256 = "sha256-xumrQgoKfFeKdRQUIYXXiXEcNd76i4wo/EIDm8BN7oU=";
# leaveDotGit = true;
};
# postPatch = ''
# substituteInPlace pyproject.toml \
# --replace-fail ', "setuptools-git-versioning>=2.0,<3"' ""
# '';
meta = with lib; {
description = "systemd wrapper on Cython";
homepage = "https://github.com/mosquito/cysystemd";
license = licenses.asl20;
platforms = platforms.linux;
};
}

View File

@ -21,37 +21,7 @@
lib.mkMerge [
{
environment.systemPackages = with pkgs; [
amd_s2idle
];
nixpkgs.overlays = [
(
final: prev:
let
innerPackage = (final.callPackage ./package.nix { });
in
{
amd_s2idle = innerPackage;
# amd_s2idle = final.buildEnv {
# name = innerPackage.name;
# paths = [
# innerPackage
# ];
# nativeBuildInputs = [ final.makeWrapper ];
# postBuild = ''
# wrapProgram $out/bin/amd_s2idle --prefix PATH : ${
# lib.makeBinPath [
# (final.python3.withPackages (python-pkgs: [
# python-pkgs.distro # For https://gitlab.freedesktop.org/drm/amd/-/blob/master/scripts/amd_s2idle.py
# python-pkgs.pyudev # For https://gitlab.freedesktop.org/drm/amd/-/blob/master/scripts/amd_s2idle.py
# python-pkgs.systemd # For https://gitlab.freedesktop.org/drm/amd/-/blob/master/scripts/amd_s2idle.py
# python-pkgs.packaging # For https://gitlab.freedesktop.org/drm/amd/-/blob/master/scripts/amd_s2idle.py
# ]))
# ]
# }
# '';
# };
}
)
amd-debug-tools
];
}
]

View File

@ -1,70 +0,0 @@
# unpackPhase
# patchPhase
# configurePhase
# buildPhase
# checkPhase
# installPhase
# fixupPhase
# installCheckPhase
# distPhase
{
stdenv,
pkgs,
sqlite,
makeWrapper,
lib,
python3,
callPackage,
# python3Packages,
acpica-tools,
ethtool,
libdisplay-info,
...
}:
let
version = "0.2.7";
in
python3.pkgs.buildPythonApplication {
pname = "amd-debug-tools";
version = version;
pyproject = true;
# name = "amd-debug-tools";
# format = "pyproject";
nativeBuildInputs = with python3.pkgs; [
setuptools
setuptools-git-versioning
setuptools-git
pyudev
];
propagatedBuildInputs = with python3.pkgs; [
(callPackage ./cysystemd.nix { })
jinja2
matplotlib
pandas
pyudev
seaborn
tabulate
acpica-tools
ethtool
libdisplay-info
];
src = pkgs.fetchgit {
url = "https://git.kernel.org/pub/scm/linux/kernel/git/superm1/amd-debug-tools.git";
tag = version;
sha256 = "sha256-6X9cUKN0BkkKcYGU+YJYCGT+l5iUZDN+D8Fqq/ns98Q=";
leaveDotGit = true;
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail ', "setuptools-git-versioning>=2.0,<3"' ""
'';
meta = with lib; {
description = "Debug tools for AMD zen systems";
homepage = "https://git.kernel.org/pub/scm/linux/kernel/git/superm1/amd-debug-tools.git/";
license = licenses.mit;
platforms = platforms.linux;
};
}

View File

@ -0,0 +1,29 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [ ];
options.me = {
d2.enable = lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
description = "Whether we want to install d2.";
};
};
config = lib.mkIf config.me.d2.enable (
lib.mkMerge [
{
environment.systemPackages = with pkgs; [
d2
];
}
]
);
}

View File

@ -134,6 +134,7 @@ in
final.prettier # Format yaml, json, and JS
final.terraform-ls
final.typescript-language-server
final.tex
]
}
'';

View File

@ -0,0 +1,16 @@
(defun d2-format-buffer ()
"Run prettier."
(interactive)
(run-command-on-buffer "d2" "fmt" "-")
)
(use-package d2-mode
:commands (d2-mode)
:hook (
(d2-mode . (lambda ()
;; (add-hook 'before-save-hook 'd2-format-buffer nil 'local)
))
)
)
(provide 'lang-d2)

View File

@ -87,4 +87,8 @@
(use-package gnuplot)
(use-package graphviz-dot-mode)
(use-package htmlize
;; For syntax highlighting when exporting to HTML.
)
(provide 'lang-org)

View File

@ -40,4 +40,6 @@
(require 'lang-cmake)
(require 'lang-d2)
(load-directory autoload-directory)

View File

@ -5,22 +5,6 @@
...
}:
let
tex = (
pkgs.texlive.combine {
inherit (pkgs.texlive)
scheme-basic
dvisvgm
dvipng # for preview and export as html in org-mode
wrapfig
amsmath
ulem
hyperref
capt-of
;
}
);
in
{
imports = [ ];
@ -40,6 +24,35 @@ in
tex
];
}
{
nixpkgs.overlays = [
(final: prev: {
tex = (
pkgs.texlive.combine {
inherit (pkgs.texlive)
scheme-basic
dvisvgm
dvipng # for preview and export as html in org-mode
wrapfig
amsmath
ulem
hyperref
capt-of
svg # emacs org-mode pdf export
catchfile # emacs org-mode pdf export
xcolor # emacs org-mode pdf export
transparent # emacs org-mode pdf export
pgf # emacs org-mode pdf export
minted # emacs org-mode pdf export code block highlighting
upquote # emacs org-mode pdf export
lineno # emacs org-mode pdf export
;
}
);
})
];
}
]
);
}

View File

@ -94,12 +94,12 @@
# "net.ipv6.conf.default.use_tempaddr" = 2;
};
nixpkgs.overlays = [
(final: prev: {
inherit (pkgs-dda3dcd3f)
linux-firmware
;
})
];
# nixpkgs.overlays = [
# (final: prev: {
# inherit (pkgs-dda3dcd3f)
# linux-firmware
# ;
# })
# ];
}

View File

@ -47,7 +47,7 @@
(lib.mkIf (!config.me.optimizations.enable) (
lib.mkMerge [
{
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_6_15;
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_6_16;
}
]
))
@ -94,7 +94,7 @@
HZ = lib.kernel.freeform "300";
HZ_300 = lib.kernel.yes;
HZ_1000 = lib.kernel.no;
} prev.linux_6_15;
} prev.linux_6_16;
}
)
(final: prev: {
@ -126,6 +126,15 @@
}
);
})
# (final: prev: {
# pythonPackagesOverlays = prev.pythonPackagesOverlays.extend (
# final': prev': {
# inherit (pkgs-unoptimized.pythonPackagesOverlays)
# coverage
# ;
# }
# );
# })
(final: prev: {
inherit (pkgs-unoptimized)
gsl
@ -133,6 +142,7 @@
valkey
nix-serve-ng
rapidjson
assimp
;
})
];