TODO describe how to use mach-nix at system level and project level.
TODO describe how to use Jupyter. DOCUMENT WHY YOU OVERRIDE PACKAGES. This makes it easy to know when you can remove them.There are several simple steps for adding a package from a different version of nixpkgs. This works on new packages (i.e. not available in the main nixpkgs flake) and different versions of existing packages, which override those in the main nixpkgs flake without requiring you to write an overlay.
First, add the repo + branch as an input and then add it to the function argument of outputs. Finally, add the package to the overridePkgs
attribute set. Here’s an example:
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/master";
home.url = "github:rycee/home-manager/bqv-flakes";
emacsOverlay.url = "github:nix-community/emacs-overlay";
# package overrides
sageNixpkgs.url = "github:nixos/nixpkgs/7866440f1223dc447f38cb23c00e10b44b4c98fe";
paraviewNixpkgs.url = "github:nixos/nixpkgs/72158c231ae46a34ec16b8134d2a8598506acd9c";
anystyleNixpkgs.url = "github:SCOTT-HAMILTON/nixpkgs/4cf6c95cb021b62e78e769af7ba64280b340b666";
vivadoNixpkgs.url = "github:matthuszagh/nixpkgs/vivado";
};
outputs =
{ self
, nixpkgs
, home
, emacsOverlay
, sageNixpkgs
, paraviewNixpkgs
, anystyleNixpkgs
, vivadoNixpkgs
}:
let
inherit (builtins) attrNames attrValues readDir;
inherit (nixpkgs) lib;
inherit (lib) recursiveUpdate genAttrs mapAttrs' nameValuePair;
inherit (utils) pathsToImportedAttrs;
utils = import ./lib/utils.nix { inherit lib; };
system = "x86_64-linux";
externalOverlays = [
emacsOverlay.overlay
];
pkgImport = pkgs: import pkgs {
inherit system;
# Order is significant. First incorporate external overlays. We
# can then use and override these in custom packages (defined
# in `self.overlay`). Finally overlays in ./overlays can
# override everything else.
overlays = externalOverlays
++ [ self.overlay ]
++ (attrValues self.overlays);
config = { allowUnfree = true; };
};
overridePkgs = {
sageWithDoc = (pkgImport sageNixpkgs).sageWithDoc;
paraview = (pkgImport paraviewNixpkgs).paraview;
anystyle-cli = (pkgImport anystyleNixpkgs).anystyle-cli;
vivado = (pkgImport vivadoNixpkgs).vivado;
};
pkgs = (pkgImport nixpkgs) // overridePkgs;
[...]
git subtree push --prefix=users/profiles/emacs/emacs emacs master
services.xserver.dpi
correctly based on the actual DPI of a screen. Instead, I’ve decided to set it correctly for the typical viewing distance of a desktop monitor (around 2ft), and then scale it accordingly for laptops that are closer. All applications (emacs, firefox, etc.) seem to use this setting when displaying graphics, so doing this will scale everything down proportionally. This looks nice even if it doesn’t keep objects specified to be 1mm as 1mm. I think it is enough to target dimensional accuracy on a desktop and favor nice appearance on laptops and other displays.
ID gen top level path
– — --------- ----
258 1222851 5 nixos
259 1222869 258 var
260 1222869 258 home
261 1222867 258 tmp
262 1222765 258 .snapshots
789 187108 259 var/lib/machines
829 186803 258 .backup
1331 191641 258 srv
1332 191641 259 var/lib/portables
11616 1222869 260 home/matt/.cache