aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCollin Williams <96917990+bluedragon1221@users.noreply.github.com>2025-07-08 14:55:31 +0000
committerCollin Williams <96917990+bluedragon1221@users.noreply.github.com>2025-07-08 14:55:31 +0000
commitfabc1603e42673afddde37ef121e0b8935559086 (patch)
treee09834122fb348d6253d9ab48549bf559c043dfd
parentc31425298f3de9fff78d38a36ccc2d8e14c580ee (diff)
move stuff to their own files; system update
-rw-r--r--flake.lock134
-rw-r--r--flake.nix4
-rw-r--r--hosts/mercury/config.nix5
-rw-r--r--modules/terminal/options.nix4
-rw-r--r--modules/terminal/system/default.nix19
-rw-r--r--modules/terminal/system/programs/bat.nix18
-rw-r--r--modules/terminal/system/programs/broot.nix4
-rw-r--r--modules/terminal/system/programs/eza.nix18
-rw-r--r--modules/terminal/system/programs/fish.nix18
-rw-r--r--modules/terminal/system/programs/fzf.nix18
-rw-r--r--modules/terminal/system/programs/nh.nix14
-rw-r--r--modules/terminal/system/programs/starship.nix8
-rw-r--r--modules/terminal/system/programs/tmux.nix34
13 files changed, 214 insertions, 84 deletions
diff --git a/flake.lock b/flake.lock
index 2b32d1b..23231b4 100644
--- a/flake.lock
+++ b/flake.lock
@@ -2,11 +2,11 @@
"nodes": {
"crane": {
"locked": {
- "lastModified": 1746291859,
- "narHash": "sha256-DdWJLA+D5tcmrRSg5Y7tp/qWaD05ATI4Z7h22gd1h7Q=",
+ "lastModified": 1750266157,
+ "narHash": "sha256-tL42YoNg9y30u7zAqtoGDNdTyXTi8EALDeCB13FtbQA=",
"owner": "ipetkov",
"repo": "crane",
- "rev": "dfd9a8dfd09db9aad544c4d3b6c47b12562544a5",
+ "rev": "e37c943371b73ed87faf33f7583860f81f1d5a48",
"type": "github"
},
"original": {
@@ -22,11 +22,11 @@
]
},
"locked": {
- "lastModified": 1747274630,
- "narHash": "sha256-87RJwXbfOHyzTB9LYagAQ6vOZhszCvd8Gvudu+gf3qo=",
+ "lastModified": 1751854533,
+ "narHash": "sha256-U/OQFplExOR1jazZY4KkaQkJqOl59xlh21HP9mI79Vc=",
"owner": "nix-community",
"repo": "disko",
- "rev": "ec7c109a4f794fce09aad87239eab7f66540b888",
+ "rev": "16b74a1e304197248a1bc663280f2548dbfcae3c",
"type": "github"
},
"original": {
@@ -38,11 +38,11 @@
"flake-compat": {
"flake": false,
"locked": {
- "lastModified": 1733328505,
- "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
+ "lastModified": 1747046372,
+ "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
"owner": "edolstra",
"repo": "flake-compat",
- "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
+ "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
"type": "github"
},
"original": {
@@ -59,11 +59,11 @@
]
},
"locked": {
- "lastModified": 1743550720,
- "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=",
+ "lastModified": 1749398372,
+ "narHash": "sha256-tYBdgS56eXYaWVW3fsnPQ/nFlgWi/Z2Ymhyu21zVM98=",
"owner": "hercules-ci",
"repo": "flake-parts",
- "rev": "c621e8422220273271f52058f618c94e405bb0f5",
+ "rev": "9305fe4e5c2a6fcf5ba6a3ff155720fbe4076569",
"type": "github"
},
"original": {
@@ -98,14 +98,15 @@
"inputs": {
"nixpkgs": [
"nixpkgs"
- ]
+ ],
+ "smfh": "smfh"
},
"locked": {
- "lastModified": 1747038076,
- "narHash": "sha256-vy+My+8yRRu0OG6XBEPDR8ebfrPS4iuruyQ1ZUyHq6s=",
+ "lastModified": 1751728847,
+ "narHash": "sha256-KU2NiDsR067mCOrkR/29fX7E4PmjfmXIETTicx3CfwA=",
"owner": "feel-co",
"repo": "hjem",
- "rev": "7d674eaded6586554910e62baed5eadad6496315",
+ "rev": "a1a2680af8038c4b85c6078e44fc3e422c81e04b",
"type": "github"
},
"original": {
@@ -121,16 +122,15 @@
]
},
"locked": {
- "lastModified": 1747556831,
- "narHash": "sha256-Qb84nbYFFk0DzFeqVoHltS2RodAYY5/HZQKE8WnBDsc=",
+ "lastModified": 1751824240,
+ "narHash": "sha256-aDDC0CHTlL7QDKWWhdbEgVPK6KwWt+ca0QkmHYZxMzI=",
"owner": "nix-community",
"repo": "home-manager",
- "rev": "d0bbd221482c2713cccb80220f3c9d16a6e20a33",
+ "rev": "fd9e55f5fac45a26f6169310afca64d56b681935",
"type": "github"
},
"original": {
"owner": "nix-community",
- "ref": "release-25.05",
"repo": "home-manager",
"type": "github"
}
@@ -144,14 +144,14 @@
"nixpkgs"
],
"pre-commit-hooks-nix": "pre-commit-hooks-nix",
- "rust-overlay": "rust-overlay"
+ "rust-overlay": "rust-overlay_2"
},
"locked": {
- "lastModified": 1747056319,
- "narHash": "sha256-qSKcBaISBozadtPq6BomnD+wIYTZIkiua3UuHLaD52c=",
+ "lastModified": 1751381593,
+ "narHash": "sha256-js1XwtJpYhvQrrTaVzViybpztkHJVZ63aXOlFAcTENM=",
"owner": "nix-community",
"repo": "lanzaboote",
- "rev": "2e425f3da6ce7f5b34fa6eaf7a2a7f78dbabcc85",
+ "rev": "f4eb75540307c2b33521322c04b7fea74e48a66f",
"type": "github"
},
"original": {
@@ -162,11 +162,11 @@
},
"nixos-facter-modules": {
"locked": {
- "lastModified": 1743671943,
- "narHash": "sha256-7sYig0+RcrR3sOL5M+2spbpFUHyEP7cnUvCaqFOBjyU=",
+ "lastModified": 1750412875,
+ "narHash": "sha256-uP9Xxw5XcFwjX9lNoYRpybOnIIe1BHfZu5vJnnPg3Jc=",
"owner": "numtide",
"repo": "nixos-facter-modules",
- "rev": "58ad9691670d293a15221d4a78818e0088d2e086",
+ "rev": "14df13c84552a7d1f33c1cd18336128fbc43f920",
"type": "github"
},
"original": {
@@ -177,16 +177,16 @@
},
"nixpkgs": {
"locked": {
- "lastModified": 1747428706,
- "narHash": "sha256-XVds9FkRrY59xRNNq14FNsFGqDiexXX/mlHcX4hPyyk=",
+ "lastModified": 1751792365,
+ "narHash": "sha256-J1kI6oAj25IG4EdVlg2hQz8NZTBNYvIS0l4wpr9KcUo=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "2e1496bf8652ff4af4e4d4737277f71e4a4f5cb2",
+ "rev": "1fd8bada0b6117e6c7eb54aad5813023eed37ccb",
"type": "github"
},
"original": {
"owner": "NixOS",
- "ref": "nixos-25.05",
+ "ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
@@ -204,11 +204,11 @@
]
},
"locked": {
- "lastModified": 1746537231,
- "narHash": "sha256-Wb2xeSyOsCoTCTj7LOoD6cdKLEROyFAArnYoS+noCWo=",
+ "lastModified": 1750779888,
+ "narHash": "sha256-wibppH3g/E2lxU43ZQHC5yA/7kIKLGxVEnsnVK1BtRg=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
- "rev": "fa466640195d38ec97cf0493d6d6882bc4d14969",
+ "rev": "16ec914f6fb6f599ce988427d9d94efddf25fe6d",
"type": "github"
},
"original": {
@@ -230,16 +230,38 @@
"rust-overlay": {
"inputs": {
"nixpkgs": [
+ "hjem",
+ "smfh",
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1747622321,
+ "narHash": "sha256-W0dYIWgsUu6rvOJRtKLhKskkv0VhQhJYGNIq+gGUc8g=",
+ "owner": "oxalica",
+ "repo": "rust-overlay",
+ "rev": "bd030fd9983f7fddf87be1c64aa3064c8afa24c4",
+ "type": "github"
+ },
+ "original": {
+ "owner": "oxalica",
+ "repo": "rust-overlay",
+ "type": "github"
+ }
+ },
+ "rust-overlay_2": {
+ "inputs": {
+ "nixpkgs": [
"lanzaboote",
"nixpkgs"
]
},
"locked": {
- "lastModified": 1747017456,
- "narHash": "sha256-C/U12fcO+HEF071b5mK65lt4XtAIZyJSSJAg9hdlvTk=",
+ "lastModified": 1751165203,
+ "narHash": "sha256-3QhlpAk2yn+ExwvRLtaixWsVW1q3OX3KXXe0l8VMLl4=",
"owner": "oxalica",
"repo": "rust-overlay",
- "rev": "5b07506ae89b025b14de91f697eba23b48654c52",
+ "rev": "90f547b90e73d3c6025e66c5b742d6db51c418c3",
"type": "github"
},
"original": {
@@ -247,6 +269,44 @@
"repo": "rust-overlay",
"type": "github"
}
+ },
+ "smfh": {
+ "inputs": {
+ "nixpkgs": [
+ "hjem",
+ "nixpkgs"
+ ],
+ "rust-overlay": "rust-overlay",
+ "systems": "systems"
+ },
+ "locked": {
+ "lastModified": 1749906619,
+ "narHash": "sha256-/9Ww10kYopxfCNNnNDwENTubs7Wzqlw+O6PJAHNOYQw=",
+ "owner": "feel-co",
+ "repo": "smfh",
+ "rev": "39f5c06153f63100376bc607b1465850b6df77fd",
+ "type": "github"
+ },
+ "original": {
+ "owner": "feel-co",
+ "repo": "smfh",
+ "type": "github"
+ }
+ },
+ "systems": {
+ "locked": {
+ "lastModified": 1681028828,
+ "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+ "owner": "nix-systems",
+ "repo": "default",
+ "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-systems",
+ "repo": "default",
+ "type": "github"
+ }
}
},
"root": "root",
diff --git a/flake.nix b/flake.nix
index 12cbf52..5a5c2b7 100644
--- a/flake.nix
+++ b/flake.nix
@@ -1,6 +1,6 @@
{
inputs = {
- nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
+ nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
disko = {
url = "github:nix-community/disko";
@@ -15,7 +15,7 @@
};
home-manager = {
- url = "github:nix-community/home-manager/release-25.05";
+ url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
diff --git a/hosts/mercury/config.nix b/hosts/mercury/config.nix
index 6cd002f..f18c772 100644
--- a/hosts/mercury/config.nix
+++ b/hosts/mercury/config.nix
@@ -47,6 +47,10 @@
lazygit.enable = true;
starship.enable = true;
+ fzf.enable = true;
+ bat.enable = true;
+ eza.enable = true;
+
git = {
enable = true;
userName = "Collin Williams";
@@ -54,6 +58,7 @@
};
cmus.enable = true;
+ nh.enable = true;
helix = {
enable = true;
diff --git a/modules/terminal/options.nix b/modules/terminal/options.nix
index 9bfcc58..f7510d0 100644
--- a/modules/terminal/options.nix
+++ b/modules/terminal/options.nix
@@ -39,6 +39,7 @@ in {
lazygit.enable = mkEnableOption "lazygit";
cmus = mkProgramOption "cmus";
+ nh.enable = mkEnableOption "nh nix helper";
git = {
enable = mkEnableOption "git";
@@ -60,6 +61,9 @@ in {
};
tmux = mkProgramOption "tmux terminal multiplexer";
+ fzf = mkProgramOption "fzf fuzzy finder";
+ bat = mkProgramOption "bat cat replacement";
+ eza = mkProgramOption "eza ls replacement";
};
};
};
diff --git a/modules/terminal/system/default.nix b/modules/terminal/system/default.nix
index 9268a1a..d113944 100644
--- a/modules/terminal/system/default.nix
+++ b/modules/terminal/system/default.nix
@@ -1,19 +1,19 @@
-{
- config,
- pkgs,
- ...
-}: let
+{config, ...}: let
cfg = config.collinux.terminal.shells;
in {
imports = [
- ./programs/cmus.nix
- ./programs/fish.nix
- ./programs/git.nix
- ./programs/helix.nix
+ ./programs/fzf.nix
+ ./programs/bat.nix
+ ./programs/nh.nix
./programs/lazygit.nix
+ ./programs/eza.nix
./programs/starship.nix
+ ./programs/git.nix
./programs/tmux.nix
./programs/broot.nix
+ ./programs/cmus.nix
+ ./programs/helix.nix
+ ./programs/fish.nix
];
programs.command-not-found.enable = false; # broken without nix-channels
@@ -21,6 +21,5 @@ in {
users.users."${config.collinux.user.name}" = {
shell = cfg.defaultShell;
ignoreShellProgramCheck = true;
- packages = [pkgs.nh]; # Couldn't figure out where else to put this
};
}
diff --git a/modules/terminal/system/programs/bat.nix b/modules/terminal/system/programs/bat.nix
new file mode 100644
index 0000000..6f53dd7
--- /dev/null
+++ b/modules/terminal/system/programs/bat.nix
@@ -0,0 +1,18 @@
+{
+ pkgs,
+ config,
+ lib,
+ ...
+}: let
+ cfg = config.collinux.terminal.programs.bat;
+in
+ lib.mkIf cfg.enable {
+ hjem.users."${config.collinux.user.name}" = {
+ files.".config/fish/conf.d/bat.fish".text = ''
+ alias cat bat
+ set -gx BAT_THEME "base16"
+ '';
+
+ packages = [pkgs.bat];
+ };
+ }
diff --git a/modules/terminal/system/programs/broot.nix b/modules/terminal/system/programs/broot.nix
index 4a15063..585e07a 100644
--- a/modules/terminal/system/programs/broot.nix
+++ b/modules/terminal/system/programs/broot.nix
@@ -25,9 +25,7 @@ in
".config/broot/conf.toml".source = conf;
".config/fish/conf.d/broot.fish".text = lib.mkIf config.collinux.terminal.shells.fish.enable ''
- if status is-interactive
- ${pkgs.broot}/bin/broot --print-shell-function fish | source
- end
+ ${pkgs.broot}/bin/broot --print-shell-function fish | source
'';
};
diff --git a/modules/terminal/system/programs/eza.nix b/modules/terminal/system/programs/eza.nix
new file mode 100644
index 0000000..52c290d
--- /dev/null
+++ b/modules/terminal/system/programs/eza.nix
@@ -0,0 +1,18 @@
+{
+ pkgs,
+ lib,
+ config,
+ ...
+}: let
+ cfg = config.collinux.terminal.programs.eza;
+in
+ lib.mkIf cfg.enable {
+ hjem.users."${config.collinux.user.name}" = {
+ files.".config/fish/conf.d/eza.fish".text = ''
+ alias ls "eza -A -w 80 --group-directories-first -I '.git*'"
+ alias tree "eza -T"
+ '';
+
+ packages = [pkgs.eza];
+ };
+ }
diff --git a/modules/terminal/system/programs/fish.nix b/modules/terminal/system/programs/fish.nix
index 204a048..55e15a0 100644
--- a/modules/terminal/system/programs/fish.nix
+++ b/modules/terminal/system/programs/fish.nix
@@ -9,20 +9,7 @@
init = ''
set fish_greeting
- if status is-interactive
- alias cat bat
- set -x BAT_THEME "base16"
-
- alias ls "${pkgs.eza}/bin/eza -A -w 80 --group-directories-first -I '.git*'"
- alias tree "${pkgs.eza}/bin/eza -T"
-
- ${pkgs.fzf}/bin/fzf --fish | source
- set -x FZF_DEFAULT_OPTS "--color bg:#1E1E2E,bg+:#313244,border:#313244,fg:#CDD6F4,fg+:#CDD6F4,header:#F38BA8,hl:#F38BA8,hl+:#F38BA8,info:#CBA6F7,label:#CDD6F4,marker:#B4BEFE,pointer:#F5E0DC,prompt:#CBA6F7,selected-bg:#45475A,spinner:#F5E0DC"
-
- ${pkgs.pay-respects}/bin/pay-respects fish --alias | source
-
- set -x NH_FLAKE "$HOME/nixos"
- end
+ pay-respects fish --alias | source
'';
in
lib.mkIf cfg.enable {
@@ -33,9 +20,6 @@ in
packages = with pkgs; [
fish
- bat
- eza
- fzf
ripgrep
fd
moreutils
diff --git a/modules/terminal/system/programs/fzf.nix b/modules/terminal/system/programs/fzf.nix
new file mode 100644
index 0000000..486d4e2
--- /dev/null
+++ b/modules/terminal/system/programs/fzf.nix
@@ -0,0 +1,18 @@
+{
+ pkgs,
+ config,
+ lib,
+ ...
+}: let
+ cfg = config.collinux.terminal.programs.fzf;
+in
+ lib.mkIf cfg.enable {
+ hjem.users."${config.collinux.user.name}" = {
+ files.".config/fish/conf.d/fzf.fish".text = ''
+ ${pkgs.fzf}/bin/fzf --fish | source
+ set -gx FZF_DEFAULT_OPTS "--color bg:#1E1E2E,bg+:#313244,border:#313244,fg:#CDD6F4,fg+:#CDD6F4,header:#F38BA8,hl:#F38BA8,hl+:#F38BA8,info:#CBA6F7,label:#CDD6F4,marker:#B4BEFE,pointer:#F5E0DC,prompt:#CBA6F7,selected-bg:#45475A,spinner:#F5E0DC"
+ '';
+
+ packages = [pkgs.fzf];
+ };
+ }
diff --git a/modules/terminal/system/programs/nh.nix b/modules/terminal/system/programs/nh.nix
new file mode 100644
index 0000000..2fcd674
--- /dev/null
+++ b/modules/terminal/system/programs/nh.nix
@@ -0,0 +1,14 @@
+{
+ config,
+ lib,
+ ...
+}: let
+ cfg = config.collinux.terminal.programs.nh;
+in
+ lib.mkIf cfg.enable {
+ programs.nh = {
+ enable = true;
+ flake = "/home/collin/nixos";
+ clean.enable = true;
+ };
+ }
diff --git a/modules/terminal/system/programs/starship.nix b/modules/terminal/system/programs/starship.nix
index fdd7965..748c94e 100644
--- a/modules/terminal/system/programs/starship.nix
+++ b/modules/terminal/system/programs/starship.nix
@@ -41,13 +41,11 @@ in
".config/starship.toml".source = settings;
".config/fish/conf.d/starship.fish".text = lib.mkIf config.collinux.terminal.shells.fish.enable ''
function starship_transient_prompt_func
- ${pkgs.starship}/bin/starship module character
+ starship module character
end
- if status is-interactive
- ${pkgs.starship}/bin/starship init fish | source
- enable_transience
- end
+ starship init fish | source
+ enable_transience
'';
};
diff --git a/modules/terminal/system/programs/tmux.nix b/modules/terminal/system/programs/tmux.nix
index fc68450..63b9296 100644
--- a/modules/terminal/system/programs/tmux.nix
+++ b/modules/terminal/system/programs/tmux.nix
@@ -6,14 +6,16 @@
}: let
cfg = config.collinux.terminal.programs.tmux;
- scripts.bat = pkgs.writeShellScriptBin "battery.sh" ''
+ scriptsDir = "~/.config/tmux/scripts";
+
+ scripts.battery = ''
energy_now=$(cat /sys/class/power_supply/BAT0/energy_now)
energy_full=$(cat /sys/class/power_supply/BAT0/energy_full)
percentage=$((energy_now * 100 / energy_full))
printf "%.0f%%" "$percentage"
'';
- scripts.primeProjects = pkgs.writeShellScriptBin "projects.sh" ''
+ scripts.sessionizer = ''
FZF_DEFAULT_OPTS="--color bg:#1E1E2E,bg+:#313244,border:#313244,fg:#CDD6F4,fg+:#CDD6F4,header:#F38BA8,hl:#F38BA8,hl+:#F38BA8,info:#CBA6F7,label:#CDD6F4,marker:#B4BEFE,pointer:#F5E0DC,prompt:#CBA6F7,selected-bg:#45475A,spinner:#F5E0DC"
projects="
@@ -42,7 +44,7 @@
fi
'';
- scripts.cleanSessions = pkgs.writeShellScriptBin "clean-sessions.sh" ''
+ scripts.cleanSessions = ''
current="$(tmux display-message -p '#S')"
tmux list-sessions -F '#S' | while read -r line; do
@@ -52,7 +54,7 @@
done
'';
- scripts.bar = pkgs.writeShellScriptBin "bar.sh" ''
+ scripts.bar = ''
text="#c6d0f5"
text_dark="#7F849C"
blue="#b3befe"
@@ -81,7 +83,7 @@
tset window-status-separator " "
tset status-right-style fg=$red
- tset status-right "#(${scripts.bat}/bin/battery.sh)"
+ tset status-right "#(${scriptsDir}/battery.sh)"
## pane borders
tset pane-border-style fg=$bg_dark,bg=$bg_dark
@@ -130,20 +132,32 @@
set-hook -g window-linked 'if -F "#{==:#{session_windows},1}" { set status off } { set status on }'
set-hook -g window-unlinked 'if -F "#{==:#{session_windows},1}" { set status off } { set status on }'
- run-shell "${scripts.bar}/bin/bar.sh"
+ run-shell "${scriptsDir}/bar.sh"
# Sessions
- set-hook -ag client-detached 'run-shell ${scripts.cleanSessions}/bin/clean-sessions.sh'
- set-hook -ag client-session-changed 'run-shell ${scripts.cleanSessions}/bin/clean-sessions.sh'
+ set-hook -ag client-detached 'run-shell ${scriptsDir}/clean-sessions.sh'
+ set-hook -ag client-session-changed 'run-shell ${scriptsDir}/clean-sessions.sh'
- bind-key -n C-f run-shell "${scripts.primeProjects}/bin/projects.sh"
+ bind-key -n C-f run-shell "${scriptsDir}/sessionizer.sh"
bind-key -n C-g display-popup -E -w 80% -h 80% -x C -y C -d "#{pane_current_path}" "${pkgs.lazygit}/bin/lazygit"
'';
in
lib.mkIf cfg.enable {
hjem.users."${config.collinux.user.name}" = {
- files.".config/tmux/tmux.conf".text = tmux-conf;
+ files = let
+ e = text: {
+ inherit text;
+ executable = true;
+ };
+ in {
+ ".config/tmux/scripts/battery.sh" = e scripts.battery;
+ ".config/tmux/scripts/sessionizer.sh" = e scripts.sessionizer;
+ ".config/tmux/scripts/clean-sessions.sh" = e scripts.cleanSessions;
+ ".config/tmux/scripts/bar.sh" = e scripts.bar;
+
+ ".config/tmux/tmux.conf".text = tmux-conf;
+ };
packages = [pkgs.tmux];
};