matthuszagh / nixos

Personal nixos dotfiles

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

linux-gpib

I’ve added linux-gpib support to nixpkgs (not yet upstream) and it appears to work. In order to get this working on my machine before pulling the latest nixpkgs I’ve added the kernel module under pkgs (included as a kernel module in ryzen3950.nix). I’ve also added a flake input and set the linux-gpib package. This is then installed under electronics subdirectory. I also use hpdrive patches. These are designed for 4.3.3, but work with 4.3.4. Finally, I’ve updated the nixpkgs input of mach-nix to allow it to find the python-linux-gpib package.

languages

Python

I use mach-nix for creating declarative and reproducible Python environments. This is used both at the system level (for a system-wide installation of Python and packages) and at the project level.

TODO describe how to use mach-nix at system level and project level.

Jupyter

TODO describe how to use Jupyter.

Rust

installation on a new machine

virtual machine

incorporating packages from different branches of nixpkgs

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;
      [...]

emacs subtree

To push changes up to the Emacs subtree, run
git subtree push --prefix=users/profiles/emacs/emacs emacs master

host DPI

Normally, it would seem to make sense to set 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.

subvolume hierarchy

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

About

Personal nixos dotfiles

License:MIT License


Languages

Language:Nix 77.4%Language:TeX 11.8%Language:Shell 5.4%Language:Sage 4.0%Language:Common Lisp 1.0%Language:Makefile 0.3%