Compare commits

...

32 commits

Author SHA1 Message Date
Benson Chu
c509714b3d Gimme drift 2026-04-30 15:56:55 -05:00
e2ff84273f Apparently this will make fonts available 2026-04-20 05:51:17 -05:00
5400818042 Welp, switching to offlineimap means I don't need this
This reverts commit 03a630d9a4.
This reverts commit 54bec4ac8e.
2026-04-19 20:09:21 -05:00
e35d3be57b Alright, we're switching to offlineimap 2026-04-19 20:07:25 -05:00
13dd1664ac Easier to debug? 2026-04-19 17:27:09 -05:00
54bec4ac8e Let me install mu into the system packages as well 2026-04-19 17:26:54 -05:00
03a630d9a4 Wow, I am shocked at how easy that was. Patch mu to not update dups 2026-04-19 14:28:31 -05:00
edab4272b7 Enable wake-on-lan 2026-04-12 22:02:39 -05:00
d2f4d99855 What is a dev machine without cmatrix 2026-04-12 17:53:48 -05:00
574426e767 Make wezterm's config separate 2026-04-12 17:52:58 -05:00
1eb2dd350e Use i3wm for the second vnc server 2026-04-12 17:51:56 -05:00
9bdda09cc2 Let me ssh from nixframe via tailscale 2026-04-12 17:12:47 -05:00
e0aa9ee807 Alright, this is annoying 2026-04-12 17:08:23 -05:00
8ee072e3bd Did I need this? 2026-04-12 16:51:27 -05:00
35a7d33dde Full integration 2026-04-12 16:44:16 -05:00
042030359b These overlays are in the flake 2026-04-12 16:44:09 -05:00
2a86e83223 Always restart 2026-04-12 16:44:09 -05:00
e41b1b0211 Gimme claude I guess 2026-04-12 16:44:09 -05:00
acc7191785 Ohhh, no more default shell 2026-04-12 16:44:09 -05:00
ecf15a0b13 More precise 2026-04-12 16:44:09 -05:00
e847261779 Overlays in one place 2026-04-12 16:44:09 -05:00
Benson Chu
2638a6bc62 Port work home-manager to 25.11 2026-04-12 16:44:09 -05:00
Benson Chu
c569df345c overlays fixup 2026-04-12 16:44:09 -05:00
Benson Chu
80f2451e6b Update inputs 2026-04-12 16:44:09 -05:00
Benson Chu
aba5201aac Overlays in one place 2026-04-12 16:44:09 -05:00
Benson Chu
841a96fcde After isync invoke emacs to update mu4e 2026-04-12 16:44:09 -05:00
Benson Chu
65845c5e45 Disable this for now 2026-04-12 16:44:09 -05:00
db1ec622ae Parameterize vnc configuration 2026-04-12 16:44:09 -05:00
f0e5bc698a Integration 2026-04-12 16:22:02 -05:00
5a9ddd08ce indentation 2026-04-12 16:07:14 -05:00
ff183e281f Ythotha enters the mix 2026-04-12 15:57:23 -05:00
1c7ea2868c Okay, now we can interface with kwalletd 2026-03-10 14:40:49 -05:00
17 changed files with 353 additions and 48 deletions

View file

@ -60,7 +60,9 @@
zip
(python311.withPackages (pythonPackages: with pythonPackages; [
mupdf
(python3.withPackages (pythonPackages: with pythonPackages; [
pymupdf
pip
colorama
@ -84,6 +86,10 @@
prawcore
ofxclient
sympy
virtualenv
]))
chromaprint

View file

@ -39,8 +39,6 @@ in
});
});
})
] ++ import ./overlays.nix inputs ++ [
inputs.emacs-overlay.overlays.default
];
nix = {
@ -104,9 +102,6 @@ in
services.tailscale.enable = true;
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;

View file

@ -0,0 +1,25 @@
pkgs: user: display: port: xstartup:
{
enable = true;
environment = {
PATH = pkgs.lib.mkForce "/run/wrappers/bin:/home/${user}/.nix-profile/bin:/nix/profile/bin:/home/${user}/.local/state/nix/profile/bin:/etc/profiles/per-user/user/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin";
};
unitConfig = {
Description = "Remote desktop service (VNC)";
After = "syslog.target network.target";
};
serviceConfig = {
Type = "simple";
User = "${user}";
WorkingDirectory = "/home/${user}";
Restart = "always";
ExecStartPre = "${pkgs.bash}/bin/bash -c '${pkgs.tigervnc}/bin/vncserver -kill ${display} > /dev/null 2>&1 || :'";
ExecStart = "${pkgs.xorg.xinit}/bin/xinit /home/${user}/.vnc/${xstartup} -- ${pkgs.tigervnc}/bin/Xvnc ${display} -rfbauth /home/${user}/.vnc/passwd -rfbport ${port}";
ExecStop = "${pkgs.tigervnc}/bin/vncserver -kill ${display}";
};
wantedBy = ["multi-user.target"];
}

View file

@ -11,6 +11,8 @@
windowManager.session = [{
name = "my-exwm";
start = ''
systemctl --user import-environment PATH DISPLAY XAUTHORITY DESKTOP_SESSION XDG_CONFIG_DIRS XDG_DATA_DIRS XDG_RUNTIME_DIR XDG_SESSION_ID DBUS_SESSION_BUS_ADDRESS || true
dbus-update-activation-environment --systemd --all || true
${pkgs.myEmacs}/bin/emacs -l /home/benson/.emacs.d/init.el
'';
}];

View file

@ -23,6 +23,12 @@
X11Forwarding yes
PasswordAuthentication yes
ChallengeResponseAuthentication yes
Match Address 100.121.66.46
X11UseLocalhost yes
X11Forwarding yes
PasswordAuthentication yes
ChallengeResponseAuthentication yes
'';
};

View file

@ -1,5 +1,7 @@
inputs:
inputs: system:
[
inputs.emacs-overlay.overlays.default
(final: prev: {
mps-debug = prev.mps.overrideAttrs (old: {
pname = old.pname + "-debug";
@ -19,5 +21,34 @@ inputs:
treesit-grammars.with-all-grammars
mu4e
]));
})
})
(final: prev: {
unstable = import inputs.unstable {
inherit system;
config.allowUnfree = true;
};
})
(final: prev: {
update = import inputs.update {
inherit system;
config.allowUnfree = true;
};
})
# https://discourse.nixos.org/t/dolphin-does-not-have-mime-associations/48985/14
# https://github.com/rumboon/dolphin-overlay/blob/main/default.nix
(final: prev: {
kdePackages = prev.kdePackages.overrideScope (kfinal: kprev: {
dolphin = kprev.dolphin.overrideAttrs (oldAttrs: {
nativeBuildInputs = (oldAttrs.nativeBuildInputs or []) ++ [ prev.makeWrapper ];
postInstall = (oldAttrs.postInstall or "") + ''
wrapProgram $out/bin/dolphin \
--set XDG_CONFIG_DIRS "${prev.libsForQt5.kservice}/etc/xdg:$XDG_CONFIG_DIRS" \
--run "${kprev.kservice}/bin/kbuildsycoca6 --noincremental ${prev.libsForQt5.kservice}/etc/xdg/menus/applications.menu"
'';
});
});
})
]

View file

@ -8,11 +8,11 @@
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1770053181,
"narHash": "sha256-YxLkG+tzWSX98pRt+4frXkZHPrHpu7afZXe9gCJ+aEo=",
"lastModified": 1774889817,
"narHash": "sha256-jTTsnHmkpP6Nls+zAeTkcXHYH5MQTwp9j0XojfhyRn4=",
"owner": "nix-community",
"repo": "emacs-overlay",
"rev": "a4a3e2816dc1adff3fa15fcf01dd95bf556ec96f",
"rev": "4627a115d6169feff1518ed0b243734f6cce717d",
"type": "github"
},
"original": {
@ -133,16 +133,16 @@
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1767313136,
"narHash": "sha256-16KkgfdYqjaeRGBaYsNrhPRRENs0qzkQVUooNHtoy2w=",
"lastModified": 1774388614,
"narHash": "sha256-tFwzTI0DdDzovdE9+Ras6CUss0yn8P9XV4Ja6RjA+nU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ac62194c3917d5f474c1a844b6fd6da2db95077d",
"rev": "1073dad219cb244572b74da2b20c7fe39cb3fa9e",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-25.05",
"ref": "nixos-25.11",
"repo": "nixpkgs",
"type": "github"
}
@ -176,11 +176,11 @@
},
"unstable": {
"locked": {
"lastModified": 1763966396,
"narHash": "sha256-6eeL1YPcY1MV3DDStIDIdy/zZCDKgHdkCmsrLJFiZf0=",
"lastModified": 1770197578,
"narHash": "sha256-AYqlWrX09+HvGs8zM6ebZ1pwUqjkfpnv8mewYwAo+iM=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "5ae3b07d8d6527c42f17c876e404993199144b6a",
"rev": "00c21e4c93d963c50d4c0c89bfa84ed6e0694df2",
"type": "github"
},
"original": {

View file

@ -19,20 +19,29 @@
url = "github:nix-community/NixOS-WSL/main";
inputs.nixpkgs.follows = "nixpkgs";
};
# drift = {
# url = "github:phlx0/drift";
# inputs = {
# nixpkgs.follows = "nixpkgs";
# flake-utils.follows = "flake-utils";
# };
# };
};
outputs = { self, nixpkgs, update, unstable, home-manager, nixos-hardware, emacs-overlay, ... }@inputs:
let
system = "x86_64-linux";
overlays =
[emacs-overlay.overlays.default] ++
(import ./common/overlays.nix inputs system);
pkgs = import nixpkgs {
inherit system;
overlays =
[emacs-overlay.overlays.default] ++
(import ./common/overlays.nix inputs);
inherit system overlays;
config.allowUnfree = true;
};
mkSystem = h: {
"${h}" = nixpkgs.lib.nixosSystem {
inherit system;
inherit system pkgs;
specialArgs = { inherit inputs; };
modules = [
(./. + "/hosts/${h}/configuration.nix")
@ -50,7 +59,7 @@
nixosConfigurations =
(pkgs.lib.foldr (a: b: a // b) {}
(map mkSystem ["NixDawn" "NixFrame"]))
(map mkSystem ["NixDawn" "NixFrame" "Ythotha"]))
// {
NixWSL = nixpkgs.lib.nixosSystem {
@ -62,7 +71,7 @@
];
};
NixGate = pkgs.lib.nixosSystem {
NixGate = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit inputs; };
modules = [
@ -71,7 +80,7 @@
];
};
NixSentinel = pkgs.lib.nixosSystem {
NixSentinel = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit inputs; };
modules = [
@ -88,17 +97,32 @@
packages."${system}" = {
mps-debug = pkgs.mps-debug;
my-mu = pkgs.mu;
};
devShells."${system}" = {
devShells."${system}" = rec {
emacs-min = pkgs.mkShell {
packages = with pkgs; [
emacs
myEmacs
git
libtool
cmake gcc gnumake
roboto-mono ripgrep
ripgrep
fontconfig
commit-mono
roboto-mono
];
shellHook = ''
export FONTCONFIG_FILE="${
pkgs.makeFontsConf {
fontDirectories = with pkgs; [
commit-mono
roboto-mono
];
}}"
'';
};
emacs-devel = pkgs.mkShell {
@ -123,6 +147,8 @@
'';
};
default = emacs-devel;
pymupdf = pkgs.mkShell {
venvDir = "./venv";
buildInputs = with pkgs.python312Packages; [
@ -148,6 +174,11 @@
extraSpecialArgs = { inherit inputs; };
modules = [
./home/users/work.nix
{
home.packages = [
(pkgs.callPackage ./packages/drift.nix {})
];
}
];
};
};

View file

@ -0,0 +1,52 @@
{ config, lib, pkgs, ... }:
{
home.packages = [ pkgs.offlineimap ];
systemd.user.services.offlineimap = {
Unit = {
Description = "OfflineIMAP - mail synchronization";
After = [ "network-online.target" ];
Wants = [ "network-online.target" ];
};
Service = {
Type = "oneshot";
ExecStart = "${pkgs.offlineimap}/bin/offlineimap -u quiet";
# Restart on failure with a delay
Restart = "on-failure";
RestartSec = 30;
# Timeout for long syncs
TimeoutStartSec = 300;
# Environment (optional, e.g. for GPG/pass-based passwords)
Environment = [
"PATH=${lib.makeBinPath [ pkgs.gnupg pkgs.pass ]}"
];
ExecStartPost = ''
${pkgs.myEmacs}/bin/emacsclient -e \
"(mu4e-update-mail-and-index mu4e-index-update-in-background)"
'';
};
Install = {
WantedBy = [ "default.target" ];
};
};
# Timer to run periodically
systemd.user.timers.offlineimap = {
Unit = {
Description = "Run OfflineIMAP periodically";
};
Timer = {
OnBootSec = "2min";
OnUnitActiveSec = "5min";
Unit = "offlineimap.service";
};
Install = {
WantedBy = [ "timers.target" ];
};
};
}

View file

@ -37,10 +37,10 @@ in
source ${bash-drv}/bashrc.sh
# Need to figure out how to conditionally generate this
if [[ -n $(which kubectl) ]]; then
alias k=kubectl
source <(kubectl completion bash | sed s/kubectl/k/g)
fi
# if [[ -n $(which kubectl) ]]; then
# alias k=kubectl
# source <(kubectl completion bash | sed s/kubectl/k/g)
# fi
'';
};
};

View file

@ -3,6 +3,7 @@
imports = [
../modules
../../submodules
../common/offlineimap.nix
];
nixpkgs.overlays = (lib.mkIf (!config.submoduleSupport.enable) [
@ -11,6 +12,8 @@
my.beets-config.enable = true;
my.tmux-config.enable = true;
my.bash-config.enable = true;
my.wezterm-config.enable = true;
my.flakeLocation = if (builtins.hasAttr "osConfig" args)
then args.osConfig.my.flakeLocation
@ -29,8 +32,6 @@
registry.nixpkgs.flake = inputs.nixpkgs;
});
my.bash-config.enable = true;
# This value determines the Home Manager release that your configuration is
# compatible with. This helps avoid breakage when a new Home Manager release
# introduces backwards incompatible changes.
@ -55,6 +56,7 @@
git
cmake gnumake libtool gcc
claude-code
];
# Home Manager is pretty good at managing dotfiles. The primary way to manage
@ -142,11 +144,5 @@
services = {
kdeconnect.enable = true;
mbsync = {
enable = true;
frequency = "*:0/10";
verbose = true;
postExec = "${pkgs.mu}/bin/mu index";
};
};
}

View file

@ -23,7 +23,7 @@
nix = (lib.mkIf (!config.submoduleSupport.enable) {
package = pkgs.nix;
settings.experimental-features = "nix-command flakes";
registry.nixpkgs.flake = inputs.nixpkgs;
# registry.nixpkgs.flake = inputs.nixpkgs;
});
# This value determines the Home Manager release that your configuration is
@ -67,6 +67,14 @@
tmux
mold
aider-chat
rr
unstable.isync
mu
];
# Home Manager is pretty good at managing dotfiles. The primary way to manage
@ -108,9 +116,11 @@
home-manager.enable = true;
git = {
enable = true;
userName = "Benson Chu";
userEmail = "b-chu1@ti.com";
extraConfig = {
settings = {
user = {
name = "Benson Chu";
email = "b-chu1@ti.com";
};
core = {
editor = "emacsclient";
};
@ -128,8 +138,13 @@
services = {
mbsync = {
enable = true;
frequency = "*:0/10";
frequency = "*:0/5";
verbose = true;
package = pkgs.isync;
postExec = ''
${pkgs.myEmacs}/bin/emacsclient -e \
"(mu4e-update-mail-and-index mu4e-index-update-in-background)"
'';
};
};
}

View file

@ -0,0 +1,69 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }:
{
imports = [
../../common/configuration.nix
../../common/user-facing.nix
../../common/development-machine.nix
../../common/moms-house
../../common/flake-location.nix
./hardware-configuration.nix
];
my.flakeLocation = "/home/benson/nixos-config/";
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
services.xserver.windowManager.i3.enable = true;
# Make a VNC server available
systemd.services.vncserver_emacs = (import ../../common/exprs/make-vncserver.nix pkgs "benson" ":1" "5901" "xstartup");
systemd.services.vncserver_i3 = (import ../../common/exprs/make-vncserver.nix pkgs "benson" ":2" "5902" "i3");
networking = {
hostName = "Ythotha";
interfaces = {
eno2 = {
wakeOnLan.enable = true;
};
};
firewall = {
# VNC Servers
allowedTCPPorts = [ 5901 5902 ];
# Wake-On-LAN
allowedUDPPorts = [ 9 ];
};
};
# Define a user account. Don't forget to set a password with passwd.
users.users.benson = {
isNormalUser = true;
description = "Benson Chu";
extraGroups = [ "networkmanager" "wheel" ];
packages = with pkgs; [
];
};
# Install firefox.
programs.firefox.enable = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
cmatrix
];
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.11"; # Did you read the comment?
}

View file

@ -0,0 +1,41 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/0dc5588c-97af-478a-8a6c-66ef8a99b699";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/3789-E85B";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices =
[ { device = "/dev/disk/by-uuid/35c500a7-5b1e-4ba6-a1ad-1397b8c6d79a"; }
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
# networking.interfaces.eno2.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

34
packages/drift.nix Normal file
View file

@ -0,0 +1,34 @@
{
pkgs,
fetchFromGitHub
}:
pkgs.buildGoModule rec {
pname = "drift";
version = "dev";
src = fetchFromGitHub {
owner = "phlx0";
repo = "drift";
rev = "main";
hash = "sha256-QfxT7fhYeu70ZJnbJ3/LaBPgBzHbjwhQ0bPIMeR46/o=";
};
vendorHash = "sha256-FsNa9qp2MnPk1onv/O13mFi+82yP7D4LdILZsNzHs+4=";
# CGO_ENABLED = 0;
ldflags = [
"-s"
"-w"
"-X main.version=${version}"
"-X main.commit=none"
"-X main.date=unknown"
];
meta = with pkgs.lib; {
description = "Terminal screensaver and ambient visualiser";
homepage = "https://github.com/phlx0/drift";
license = licenses.mit;
maintainers = [ ];
mainProgram = "drift";
};
}

@ -1 +1 @@
Subproject commit 2c8225b986dfd503cc3e5ce82d8105ccd2a57131
Subproject commit e576ce1278aacdaa3d0307e30128ef56c20ae67e

View file

@ -3,6 +3,7 @@ let
beets-cfg = config.my.beets-config;
tmux-cfg = config.my.tmux-config;
work-bash-cfg = config.my.work-bash-config;
wezterm-cfg = config.my.wezterm-config;
mkIfFlakeLoc = condition: errorMsg: value:
(lib.mkIf (condition &&
!(config.my.flakeLocation == null &&
@ -18,6 +19,7 @@ in
type = lib.types.nullOr lib.types.path;
};
my.beets-config.enable = lib.mkEnableOption "Enable beets configuration file";
my.wezterm-config.enable = lib.mkEnableOption "Enable wezterm configuration file";
my.tmux-config.enable = lib.mkEnableOption "Enable tmux configuration file";
my.work-bash-config.enable = lib.mkEnableOption "Enable work bash configurations";
};
@ -66,7 +68,7 @@ in
"${flakeSubmodules}/tmux-config/tmux.conf";
});
"wezterm/" = (mkIfFlakeLoc beets-cfg.enable
"wezterm/" = (mkIfFlakeLoc wezterm-cfg.enable
"I won't symlink wezterm config folder into place"
{
source = config.lib.file.mkOutOfStoreSymlink