Refactor: home-manager cross-platform + WGU software
- Split home config: sscoble.nix (shared macOS+NixOS) + desktop.nix (Hyprland) - Added homeConfigurations.sscoble for work Mac (aarch64-darwin) - Added home/wgu.nix: Zotero, Brave, Obsidian, VSCode, Typst, Bitwarden - Mac: home-manager switch --flake .#sscoble - NixOS: nixos-rebuild switch --flake .#laptop
This commit is contained in:
parent
9b433d41be
commit
20fbee59da
4 changed files with 544 additions and 666 deletions
67
flake.nix
67
flake.nix
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
description = "Scobleclaw laptop — NixOS configuration reproducing MacBook software capabilities on x86_64";
|
||||
description = "Scobleclaw — NixOS + home-manager configuration for personal laptop (x86_64) and work Mac (aarch64)";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
|
|
@ -14,27 +14,26 @@
|
|||
};
|
||||
|
||||
outputs = { self, nixpkgs, home-manager, pi-mono, ... }@inputs: let
|
||||
# System we're targeting (x86_64 NixOS laptop)
|
||||
system = "x86_64-linux";
|
||||
linuxSystem = "x86_64-linux";
|
||||
darwinSystem = "aarch64-darwin";
|
||||
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
# Linux pkgs with overlay (pi, qmd)
|
||||
linuxPkgs = import nixpkgs {
|
||||
system = linuxSystem;
|
||||
overlays = [ self.overlays.default ];
|
||||
};
|
||||
in {
|
||||
# Overlay — add pi and qmd to nixpkgs
|
||||
# === Overlay: pi + qmd (Linux only) ===
|
||||
overlays.default = final: prev: {
|
||||
# pi coding agent — built from Forgejo mirror of pi-mono
|
||||
pi-coding-agent = final.buildNpmPackage {
|
||||
pname = "pi-coding-agent";
|
||||
version = "0.73.0";
|
||||
src = pi-mono;
|
||||
npmDepsHash = ""; # Set after first build: nix-build outputs the correct hash
|
||||
npmDepsHash = ""; # Fill after first build
|
||||
npmWorkspace = "packages/coding-agent";
|
||||
npmFlags = [ "--legacy-peer-deps" ];
|
||||
dontNpmBuild = true;
|
||||
preConfigure = ''
|
||||
# Build dependencies first (monorepo workspace order)
|
||||
cd packages/ai && npm run build && cd ../..
|
||||
cd packages/agent && npm run build && cd ../..
|
||||
cd packages/tui && npm run build && cd ../..
|
||||
|
|
@ -55,38 +54,51 @@
|
|||
'';
|
||||
};
|
||||
|
||||
# qmd — vault search tool, wraps npm package via bun
|
||||
qmd = final.writeShellScriptBin "qmd" ''
|
||||
exec ${final.bun}/bin/bunx --bun @tobilu/qmd "$@"
|
||||
'';
|
||||
|
||||
# Pi config directory structure (without secrets)
|
||||
pi-config-dir = final.runCommand "pi-config-dir" {} ''
|
||||
mkdir -p $out
|
||||
# Placeholder — real config should be restored from backup
|
||||
echo "# Pi agent configuration" > $out/README.md
|
||||
echo "# Defaults" > $out/settings.json
|
||||
'';
|
||||
};
|
||||
|
||||
# NixOS configuration for the laptop
|
||||
# === NixOS: full system + desktop ===
|
||||
nixosConfigurations.laptop = nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
system = linuxSystem;
|
||||
modules = [
|
||||
home-manager.nixosModules.home-manager
|
||||
./modules/laptop.nix
|
||||
./modules/hyprland.nix
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.users.sscoble = import ./home/sscoble.nix;
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
users.sscoble = {
|
||||
imports = [
|
||||
./home/sscoble.nix
|
||||
./home/desktop.nix
|
||||
./home/wgu.nix
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# Standalone dev shell for trying things out
|
||||
devShells.${system}.default = pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
# === macOS: home-manager standalone (no desktop, no Hyprland) ===
|
||||
homeConfigurations.sscoble = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = nixpkgs.legacyPackages.${darwinSystem};
|
||||
modules = [
|
||||
./home/sscoble.nix
|
||||
./home/wgu.nix
|
||||
{
|
||||
# macOS-specific overrides
|
||||
home.homeDirectory = "/Users/sscoble";
|
||||
# pi/qmd come from homebrew, not nixpkgs
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# === Dev shell (Linux) ===
|
||||
devShells.${linuxSystem}.default = linuxPkgs.mkShell {
|
||||
buildInputs = with linuxPkgs; [
|
||||
pi-coding-agent
|
||||
qmd
|
||||
nodejs
|
||||
|
|
@ -95,12 +107,11 @@
|
|||
zsh
|
||||
];
|
||||
shellHook = ''
|
||||
echo "🦞 Scobleclaw laptop dev shell"
|
||||
echo "🦞 Scobleclaw dev shell"
|
||||
echo " pi: $(which pi)"
|
||||
echo " qmd: $(which qmd)"
|
||||
echo " node: $(node --version)"
|
||||
echo " bun: $(bun --version)"
|
||||
echo " git: $(git --version)"
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue