From 168c36042b1a70c406e4d195d34c20c482a3cde3 Mon Sep 17 00:00:00 2001 From: clover caruso Date: Wed, 24 Sep 2025 11:59:26 -0700 Subject: [PATCH] clover: setup work environment switch command gets some new features to account for the fact my work device hostname contains info about the company i work for. --- .gitignore | 3 ++- flake.nix | 6 ++++++ switch | 21 ++++++++++++++++----- users/clover/home.nix | 12 ++---------- users/clover/paperback/home.nix | 4 ---- users/clover/work/home.nix | 23 +++++++++++++++++++++++ 6 files changed, 49 insertions(+), 20 deletions(-) create mode 100644 users/clover/work/home.nix diff --git a/.gitignore b/.gitignore index b12e90ad5ad4ae77215e74cdf66de71da19ef3cc..fd9d1ca548f88694b09655ec42567e08161475b9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ -flake.lock .DS_STORE +.hostname +flake.lock result result-* diff --git a/flake.nix b/flake.nix index 28101b0755d19ad6d382be93307cd255f30fc903..cebe693a0da4cbaf4b7f067231349b803ff3d5b3 100644 --- a/flake.nix +++ b/flake.nix @@ -133,6 +133,12 @@ host = "paperback"; system = "aarch64-darwin"; }; + # clover's work macbook pro + darwinConfigurations.clover-work-mac = mkSystem "clover-work-mac" { + user = "clover"; + host = "work"; + system = "aarch64-darwin"; + }; # fish's cattop nixosConfigurations.cattop = mkSystem "cattop" { diff --git a/switch b/switch index 3c267596a89ce1a79011f5431c6d73cc4e2a25ec..bf5697d655d9362730c9db9854db34b7950154fc 100755 --- a/switch +++ b/switch @@ -1,12 +1,23 @@ #!/bin/sh nh_subcommand="os" fallback_command="nixos-rebuild" -if [ "$(uname -o)" = "darwin" ]; then - nh_subcommand="darwin" - fallback_command="nix run .#darwin-rebuild" +hostname_file="$(dirname "$0")/.hostname" +if [ -n "$1" ]; then + hostname="$1" +elif [ -f "$hostname_file" ]; then + hostname=$(cat "$hostname_file") +fi +if [ -z "$hostname" ]; then + hostname="$(hostname)" +fi +printf "%s" "$hostname" >"$hostname_file" +if [ "$(uname -o)" = "Darwin" ]; then + nh_subcommand="darwin" + fallback_command="nix run .#darwin-rebuild" + hostname="darwinConfigurations.$hostname" fi if command -v nh >/dev/null; then - nh $nh_subcommand switch . + nh $nh_subcommand switch '.#'"$hostname" else - $fallback_command -- switch --flake . + $fallback_command -- switch --flake '.#'"$hostname" fi diff --git a/users/clover/home.nix b/users/clover/home.nix index d8674c7e5fa8fa528ad15e36ffdd837513f16db1..8ac1b46d4bddc71134455dbb08b2264fb8be802a 100644 --- a/users/clover/home.nix +++ b/users/clover/home.nix @@ -10,9 +10,7 @@ in let # packages to always install all = [ - (ffmpeg.override { - withSvtav1 = true; - }) + ffmpeg-full ripgrep uv nh @@ -22,6 +20,7 @@ in desktop = [ git-town lazygit + jjui ]; # packages to install on all servers server = [ ]; @@ -278,12 +277,5 @@ in "nas.paperclover.net" = zenith; }; }; - neovide = { - enable = !hostServer; - settings = { - font.normal = "AT Name Mono"; - font.size = 13; - }; - }; }; } diff --git a/users/clover/paperback/home.nix b/users/clover/paperback/home.nix index 711130f295df837f03f7c41ca2efc7cc64491798..47d88a2034872f1efc7c06355eef2e3b004436b3 100644 --- a/users/clover/paperback/home.nix +++ b/users/clover/paperback/home.nix @@ -3,7 +3,6 @@ # these programs are not globally installed to reduce distractions. # most of these are needed for my work environment. programs = { - bun.enable = true; zsh.profileExtra = '' _bun() { local context state line @@ -12,7 +11,6 @@ ''; }; home.packages = with pkgs; [ - doppler deno nodejs_22 rustup @@ -22,7 +20,5 @@ yt-dlp spotdl zig - ssm-session-manager-plugin - awscli ]; } diff --git a/users/clover/work/home.nix b/users/clover/work/home.nix new file mode 100644 index 0000000000000000000000000000000000000000..5407bdbbc9bd19929d875a24a72da914e4233d31 --- /dev/null +++ b/users/clover/work/home.nix @@ -0,0 +1,23 @@ +{ pkgs, ... }: +{ + programs = { + zsh.profileExtra = '' + _bun() { + local context state line + _arguments -C '*:file:_files' + } + ''; + }; + home.packages = with pkgs; [ + (bun.overrideAttrs (_: { + version = "1.1.17"; # blocked on bugs + })) + doppler + deno + nodejs_24 + rustup + typescript + ssm-session-manager-plugin + awscli + ]; +} -- 2.54.0