From 1071288f6ef0d069e266475df894ebae2f85b869 Mon Sep 17 00:00:00 2001 From: Kat Inskip Date: Wed, 22 Oct 2025 17:07:43 -0700 Subject: [PATCH] feat: work on laptop and shell stuff --- flake.lock | 36 ++++++++++++++++++++++++++++ flake.nix | 1 + home/profiles/graphical/gpg.nix | 9 ++++++- home/profiles/shell/bottom.nix | 6 +++++ home/profiles/shell/data.nix | 19 +++++++++++++++ home/profiles/shell/htop.nix | 5 ++++ home/profiles/shell/packages.nix | 24 ++++++++++++++++--- home/profiles/shell/ripgrep.nix | 10 ++++++++ home/profiles/shell/xplr.nix | 5 ++++ home/profiles/shell/z.nix | 23 ++++-------------- home/profiles/shell/zsh.nix | 3 ++- nixos/hardware/amd.nix | 8 +++++++ nixos/hardware/framework/boot.nix | 10 +++++++- nixos/hardware/framework/general.nix | 4 ++++ nixos/hardware/framework/imports.nix | 3 +++ nixos/profiles/dev/packages.nix | 5 ++++ nixos/profiles/graphical/obs.nix | 9 ++++++- nixos/profiles/graphical/upower.nix | 8 +++++++ systems/goliath.nix | 3 --- systems/koishi.nix | 11 ++------- tree.nix | 1 + 21 files changed, 165 insertions(+), 38 deletions(-) create mode 100644 home/profiles/shell/bottom.nix create mode 100644 home/profiles/shell/data.nix create mode 100644 home/profiles/shell/htop.nix create mode 100644 home/profiles/shell/ripgrep.nix create mode 100644 home/profiles/shell/xplr.nix create mode 100644 nixos/hardware/amd.nix create mode 100644 nixos/hardware/framework/general.nix create mode 100644 nixos/profiles/graphical/upower.nix diff --git a/flake.lock b/flake.lock index 80995bfe..88f6660d 100644 --- a/flake.lock +++ b/flake.lock @@ -223,6 +223,23 @@ "type": "github" } }, + "cpu-microcodes": { + "flake": false, + "locked": { + "lastModified": 1759588812, + "narHash": "sha256-HMq/XjTY/Dmjzufho8dw8bL/2iMlcIZEUcJI84o6/no=", + "owner": "platomav", + "repo": "CPUMicrocodes", + "rev": "ae2c33ecd7a5855a743b360a05bc984911d16957", + "type": "github" + }, + "original": { + "owner": "platomav", + "repo": "CPUMicrocodes", + "rev": "ae2c33ecd7a5855a743b360a05bc984911d16957", + "type": "github" + } + }, "crane": { "locked": { "lastModified": 1731098351, @@ -1575,6 +1592,7 @@ "systems": "systems_3", "tree": "tree", "treefmt-nix": "treefmt-nix", + "ucodenix": "ucodenix", "wezterm": "wezterm" } }, @@ -2012,6 +2030,24 @@ "type": "github" } }, + "ucodenix": { + "inputs": { + "cpu-microcodes": "cpu-microcodes" + }, + "locked": { + "lastModified": 1759935526, + "narHash": "sha256-ul9G+RlFA1OdfNY2s/qD2ANOagXktbvKpjtWaH8SiVk=", + "owner": "e-tho", + "repo": "ucodenix", + "rev": "ae546711cdd5dbbd284fe9a47bd4f6ae9bbc7449", + "type": "github" + }, + "original": { + "owner": "e-tho", + "repo": "ucodenix", + "type": "github" + } + }, "wezterm": { "inputs": { "flake-utils": [ diff --git a/flake.nix b/flake.nix index 39332caa..5cc9bfed 100644 --- a/flake.nix +++ b/flake.nix @@ -161,6 +161,7 @@ flake-compat.follows = "flake-compat"; }; }; + ucodenix.url = "github:e-tho/ucodenix"; nh = { url = "github:nix-community/nh"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/home/profiles/graphical/gpg.nix b/home/profiles/graphical/gpg.nix index cd501db4..fc7b7d14 100644 --- a/home/profiles/graphical/gpg.nix +++ b/home/profiles/graphical/gpg.nix @@ -1,6 +1,13 @@ -{lib, ...}: let +{ + pkgs, + lib, + ... +}: let inherit (lib.modules) mkDefault mkMerge; in { + home.packages = [ + pkgs.gpg-tui + ]; services.gpg-agent = { enable = mkDefault true; enableExtraSocket = true; diff --git a/home/profiles/shell/bottom.nix b/home/profiles/shell/bottom.nix new file mode 100644 index 00000000..d816e708 --- /dev/null +++ b/home/profiles/shell/bottom.nix @@ -0,0 +1,6 @@ +{pkgs, ...}: { + programs.bottom = { + enable = true; + package = pkgs.bottom; + }; +} diff --git a/home/profiles/shell/data.nix b/home/profiles/shell/data.nix new file mode 100644 index 00000000..37d0b93d --- /dev/null +++ b/home/profiles/shell/data.nix @@ -0,0 +1,19 @@ +{pkgs, ...}: { + programs.jq = { + enable = true; + }; + programs.jqp = { + enable = true; + }; + home.packages = with pkgs; [ + htmlq # JQ for HTML + gron # Make JSON greppable + jless # Command-line JSON viewer + jo # Interface for creating JSON objects in shell + jc # Turn output of common/popular packages into JSON + dasel # JSON, YAML, TOML, XML, and CSV multitool + yj # Convert between YAML, TOML, JSON, and HCL. Preserves map order. + csview # CSV viewer + glow # Markdown viewer + ]; +} diff --git a/home/profiles/shell/htop.nix b/home/profiles/shell/htop.nix new file mode 100644 index 00000000..1a2f7a1f --- /dev/null +++ b/home/profiles/shell/htop.nix @@ -0,0 +1,5 @@ +_: { + programs.htop = { + enable = true; + }; +} diff --git a/home/profiles/shell/packages.nix b/home/profiles/shell/packages.nix index fe391231..cd12ed64 100644 --- a/home/profiles/shell/packages.nix +++ b/home/profiles/shell/packages.nix @@ -1,8 +1,6 @@ {pkgs, ...}: { home.packages = with pkgs; [ watchexec - htop - btop gdu nixpkgs-fmt file @@ -10,7 +8,6 @@ sd sops fd - ripgrep rename tmate socat @@ -21,5 +18,26 @@ hyperfine poop nix-search-cli + pandoc + slides + sc-im + asciinema + bandwhich + pciutils + bingrep + chafa + dust + eva + gfold + kmon + lemmeknow + lnav + pastel + pipe-rename + procs + tz + tre + tmpmail + wikit ]; } diff --git a/home/profiles/shell/ripgrep.nix b/home/profiles/shell/ripgrep.nix new file mode 100644 index 00000000..520120ac --- /dev/null +++ b/home/profiles/shell/ripgrep.nix @@ -0,0 +1,10 @@ +_: { + programs = { + ripgrep = { + enable = true; + }; + ripgrep-all = { + enable = true; + }; + }; +} diff --git a/home/profiles/shell/xplr.nix b/home/profiles/shell/xplr.nix new file mode 100644 index 00000000..a0ded139 --- /dev/null +++ b/home/profiles/shell/xplr.nix @@ -0,0 +1,5 @@ +_: { + programs.xplr = { + enable = true; + }; +} diff --git a/home/profiles/shell/z.nix b/home/profiles/shell/z.nix index c65b7235..32ffebce 100644 --- a/home/profiles/shell/z.nix +++ b/home/profiles/shell/z.nix @@ -1,21 +1,6 @@ -{ - config, - pkgs, - ... -}: { - # ensure .local/share/z is created - xdg.dataFile."z/.keep".text = ""; - - programs.zsh = { - localVariables = { - _Z_DATA = "${config.xdg.dataHome}/z/data"; - }; - plugins = - map (plugin: (with pkgs.${plugin}; { - name = pname; - inherit src; - })) [ - "zsh-z" - ]; +_: { + programs.zoxide = { + enable = true; + enableZshIntegration = true; }; } diff --git a/home/profiles/shell/zsh.nix b/home/profiles/shell/zsh.nix index 22f0e9c0..88f2c11b 100644 --- a/home/profiles/shell/zsh.nix +++ b/home/profiles/shell/zsh.nix @@ -90,7 +90,8 @@ in { ''; shellAliases = mkMerge [ { - nixdirfmt = "nixpkgs-fmt $(fd -e nix)"; + cat = "bat"; + top = "btm"; dmesg = "dmesg -HP"; hg = "history 0 | rg"; } diff --git a/nixos/hardware/amd.nix b/nixos/hardware/amd.nix new file mode 100644 index 00000000..8eb8ac9f --- /dev/null +++ b/nixos/hardware/amd.nix @@ -0,0 +1,8 @@ +{config, ...}: { + boot = { + blacklistedKernelModules = ["k10temp"]; + extraModulePackages = [config.boot.kernelPackages.zenpower]; + kernelModules = ["zenpower"]; + }; + services.ucodenix.enable = true; +} diff --git a/nixos/hardware/framework/boot.nix b/nixos/hardware/framework/boot.nix index f0d44abf..dd4acc11 100644 --- a/nixos/hardware/framework/boot.nix +++ b/nixos/hardware/framework/boot.nix @@ -1,7 +1,15 @@ -_: { +{config, ...}: { + # https://github.com/NixOS/nixos-hardware/issues/1581 + hardware.framework.enableKmod = false; + boot = { initrd = { availableKernelModules = ["nvme" "xhci_pci" "thunderbolt" "usb_storage" "sd_mod"]; }; + kernelModules = ["cros_ec" "cros_ec_lpcs"]; + extraModprobeConfig = "options snd_hda_intel power_save=0"; + extraModulePackages = with config.boot.kernelPackages; [ + framework-laptop-kmod + ]; }; } diff --git a/nixos/hardware/framework/general.nix b/nixos/hardware/framework/general.nix new file mode 100644 index 00000000..c21290c0 --- /dev/null +++ b/nixos/hardware/framework/general.nix @@ -0,0 +1,4 @@ +_: { + hardware.framework.laptop13.audioEnhancement.enable = true; + services.ucodenix.cpuModelId = "00A70F41"; +} diff --git a/nixos/hardware/framework/imports.nix b/nixos/hardware/framework/imports.nix index 6e1d0270..67a1715c 100644 --- a/nixos/hardware/framework/imports.nix +++ b/nixos/hardware/framework/imports.nix @@ -7,6 +7,9 @@ (with tree.nixos.profiles; [ uefi ]) + ++ (with tree.nixos.hardware; [ + amd + ]) ++ [ inputs.nixos-hardware.outputs.nixosModules.framework-13-7040-amd ]; diff --git a/nixos/profiles/dev/packages.nix b/nixos/profiles/dev/packages.nix index abc96534..b4dc4c69 100644 --- a/nixos/profiles/dev/packages.nix +++ b/nixos/profiles/dev/packages.nix @@ -2,5 +2,10 @@ environment.systemPackages = with pkgs; [ ida-pro-kat android-studio + bingrep + hexyl + jwt-cli + silicon + tokei ]; } diff --git a/nixos/profiles/graphical/obs.nix b/nixos/profiles/graphical/obs.nix index 8d24d868..934d17e1 100644 --- a/nixos/profiles/graphical/obs.nix +++ b/nixos/profiles/graphical/obs.nix @@ -1,4 +1,11 @@ -{pkgs, ...}: { +{ + config, + pkgs, + ... +}: { + boot.extraModulePackages = with config.boot.kernelPackages; [ + v4l2loopback + ]; programs.obs-studio = { enable = true; enableVirtualCamera = true; diff --git a/nixos/profiles/graphical/upower.nix b/nixos/profiles/graphical/upower.nix new file mode 100644 index 00000000..b8a7e0fe --- /dev/null +++ b/nixos/profiles/graphical/upower.nix @@ -0,0 +1,8 @@ +{pkgs, ...}: { + services.upower = { + enable = true; + }; + environment.systemPackages = [ + pkgs.acpi + ]; +} diff --git a/systems/goliath.nix b/systems/goliath.nix index e7cd4ba5..c23aa5cf 100644 --- a/systems/goliath.nix +++ b/systems/goliath.nix @@ -184,9 +184,6 @@ _: let }; boot = { - extraModulePackages = with config.boot.kernelPackages; [ - config.boot.kernelPackages.v4l2loopback.out - ]; loader = { systemd-boot.enable = true; efi.canTouchEfiVariables = true; diff --git a/systems/koishi.nix b/systems/koishi.nix index 2bdda11a..91833027 100644 --- a/systems/koishi.nix +++ b/systems/koishi.nix @@ -2,7 +2,6 @@ _: let hostConfig = { tree, lib, - config, ... }: let inherit (lib.attrsets) nameValuePair listToAttrs; @@ -97,23 +96,17 @@ _: let powerManagement.enable = true; - hardware.framework.enableKmod = false; - boot = { loader = { grub.useOSProber = true; - systemd-boot.enable = lib.mkForce false; + #systemd-boot.enable = lib.mkForce false; + systemd-boot.enable = true; }; zfs = { forceImportRoot = false; allowHibernation = true; }; kernelModules = ["cros_ec" "cros_ec_lpcs"]; - extraModprobeConfig = "options snd_hda_intel power_save=0"; - extraModulePackages = with config.boot.kernelPackages; [ - config.boot.kernelPackages.v4l2loopback.out - framework-laptop-kmod - ]; }; # optional, useful when the builder has a faster internet connection than yours diff --git a/tree.nix b/tree.nix index 3c3dd281..bc65a279 100644 --- a/tree.nix +++ b/tree.nix @@ -94,6 +94,7 @@ microvm.nixosModules.host mewtris.nixosModules.mewtris noctalia.nixosModules.default + ucodenix.nixosModules.default ]; }; };