From a62bbcf6ea62c10123bab3906f0e65fe4c638f89 Mon Sep 17 00:00:00 2001 From: FileMagic Date: Thu, 16 Jul 2026 23:16:36 +0000 Subject: [PATCH] modules/bash.nix: extract shared bash config from thick-black-cannon - Create modules/bash.nix with aliases using Projects/tangled/nix path - Import in shared home.nix for both hosts - Remove duplicate bash config from thick-black-cannon/home.nix --- flake.lock | 16 +++++++++------- home.nix | 5 ++++- modules/bash.nix | 37 +++++++++++++++++++++++++++++++++++++ thick-black-cannon/home.nix | 13 ------------- 4 file(s) changed, 50 insertion(s)(+), 21 deletion(s)(-) diff --git a/flake.lock b/flake.lock --- a/flake.lock +++ b/flake.lock @@ -2,14 +2,16 @@ { "nodes": { "home-manager": { "inputs": { - "nixpkgs": ["nixpkgs"] + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { - "lastModified": 1783744526, - "narHash": "sha256-yYVxW+uIbCx0Nt870fbErQbz+b2+3Gwpppe+JbIU+Co=", + "lastModified": 1784129366, + "narHash": "sha256-N5JiyICSeQF14x+OQebNyPpYowOT9Rs1iKyeCylSzOA=", "owner": "nix-community", "repo": "home-manager", - "rev": "2afec152df4e284d264f8489d16004c264aebf4c", + "rev": "165228b0efefc3e635e5174020c40ea64271dc25", "type": "github" }, "original": { @@ -20,11 +22,11 @@ } }, "nixpkgs": { "locked": { - "lastModified": 1783522502, - "narHash": "sha256-iffAls3iaNTyJC2faYcUXSI+Gp02cDjYl+MygxKl2GI=", + "lastModified": 1784120854, + "narHash": "sha256-KesHgItiZPgGX740axSiQLcIQ8D24MDqNpkKYWIek8k=", "owner": "nixos", "repo": "nixpkgs", - "rev": "0bb7ec54c8483066ec9d7720e780a5caa71f8612", + "rev": "753cc8a3a87467296ddd1fa93f0cc3e81120ee46", "type": "github" }, "original": { diff --git a/home.nix b/home.nix --- a/home.nix +++ b/home.nix @@ -5,7 +5,10 @@ lib, ... }: { - imports = [ ./modules/firefox.nix ]; + imports = [ + ./modules/firefox.nix + ./modules/bash.nix + ]; xdg = { configFile."mimeapps.list".force = true; diff --git a/modules/bash.nix b/modules/bash.nix new file mode 100644 --- /dev/null +++ b/modules/bash.nix @@ -0,0 +1,37 @@ +{ + config, + pkgs, + lib, + ... +}: +let + homeDir = config.home.homeDirectory; +in +{ + programs.bash = { + enable = true; + shellAliases = { + config = "sudo nixos-rebuild switch --flake ${homeDir}/Projects/tangled/nix"; + update = '' + sudo fwupdmgr update + sudo nix-channel --update + nix flake update + sudo nixos-rebuild switch --upgrade --flake ${homeDir}/Projects/tangled/nix + nix-channel --update + ''; + start-virtual-camera = '' + gphoto2 --stdout --capture-movie \ + | gst-launch-1.0 fdsrc fd=0 \ + ! jpegparse \ + ! jpegdec \ + ! videoconvert \ + ! video/x-raw,format=YUY2 \ + ! pipewiresink mode=provide \ + stream-properties='properties,media.class=Video/Source,media.role=Camera' \ + client-name='DSLR Virtual Camera' + ''; + k8s-build = "nix build ${homeDir}/Projects/tangled/nix/kubernetes#images && ls -lh ${homeDir}/Projects/tangled/nix/kubernetes/result/"; + }; + + }; +} diff --git a/thick-black-cannon/home.nix b/thick-black-cannon/home.nix --- a/thick-black-cannon/home.nix +++ b/thick-black-cannon/home.nix @@ -94,19 +94,6 @@ }; }; programs = { - bash = { - enable = true; - shellAliases = { - "config" = - "sudo nixos-rebuild switch --flake ${config.home.homeDirectory}/Projects/github/dotfiles"; - "update" = - "sudo fwupdmgr update; sudo nix-channel --update; nix flake update; sudo nixos-rebuild switch --upgrade --flake ${config.home.homeDirectory}/Projects/github/dotfiles; nix-channel --update;"; - "start-virtual-camera" = - "gphoto2 --stdout --capture-movie | gst-launch-1.0 fdsrc fd=0 ! jpegparse ! jpegdec ! videoconvert ! video/x-raw,format=YUY2 ! pipewiresink mode=provide stream-properties='properties,media.class=Video/Source,media.role=Camera' client-name='DSLR Virtual Camera'"; - "k8s-build" = - "nix build ${config.home.homeDirectory}/Projects/github/dotfiles/kubernetes#images && ls -lh ${config.home.homeDirectory}/Projects/github/dotfiles/kubernetes/result/"; - }; - }; git = { enable = true; settings = { -- tangled.sh