Skip to content

Commit

Permalink
nix: Setup home-manager
Browse files Browse the repository at this point in the history
Profiles added for:
- Generic `qutrc` user on ARM64 machines
- `qutrc@big-brain`: ARM64
- `qutrc@medium-brain`: ARM64
- `qutrc@gcs`: x86-64
  • Loading branch information
RandomSpaceship authored and DingoOz committed Jan 6, 2025
1 parent 5ce16cc commit 88af433
Show file tree
Hide file tree
Showing 26 changed files with 3,990 additions and 2 deletions.
21 changes: 21 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
Expand All @@ -45,7 +49,7 @@
pyproject-build-systems,
treefmt-nix,
...
}:
}@inputs:
nix-ros-overlay.inputs.flake-utils.lib.eachDefaultSystem (
system:
let
Expand Down Expand Up @@ -247,7 +251,10 @@
# formatting = treefmtEval.config.build.check self;
};
}
);
)
// {
homeConfigurations = (import ./software/home-manager/default.nix) inputs;
};
nixConfig = {
# note from James Nichol - I set up a custom cache at https://qutrc-roar.cachix.org
# Currently I'm compiling for x86-64 and aarch64 on my machine and pushing to it whenever I make changes
Expand Down
18 changes: 18 additions & 0 deletions software/home-manager/cli-programs/bat.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{ pkgs, ... }:
{
programs.bat = {
enable = true;
package = pkgs.unstable.bat;
extraPackages = with pkgs.bat-extras; [
batdiff
batman
batgrep
prettybat
];
};
home.shellAliases = {
# bat extra tools
man = "batman";
bgrp = "batgrep";
};
}
16 changes: 16 additions & 0 deletions software/home-manager/cli-programs/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{ ... }:
{
imports = [
./editors
./search-tools

./bat.nix
./direnv.nix
./eza.nix
./git.nix
./misc-utils.nix
./nix.nix
./term-multiplexing.nix
./zoxide.nix
];
}
17 changes: 17 additions & 0 deletions software/home-manager/cli-programs/direnv.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{ pkgs, ... }:
{
programs.direnv = {
enable = true;
nix-direnv.enable = true;
config = {
global = {
hide_env_diff = true;
};
};
};
programs.zsh.oh-my-zsh = {
plugins = [
"direnv"
];
};
}
10 changes: 10 additions & 0 deletions software/home-manager/cli-programs/editors/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{ pkgs, ... }:
{
imports = [
./neovim.nix
];
home.packages = with pkgs; [
nano
vim
];
}
14 changes: 14 additions & 0 deletions software/home-manager/cli-programs/editors/neovim.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{ ... }:
{
programs.neovim = {
enable = true;
};

home.sessionVariables = {
EDITOR = "nvim";
};

home.shellAliases = {
n = "nvim";
};
}
14 changes: 14 additions & 0 deletions software/home-manager/cli-programs/eza.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{ ... }:
{
programs.eza = {
enable = true;
};
home.shellAliases = {
# ls -> eza
ls = "eza --icons=auto";
la = "eza -a --icons=auto";
ll = "eza -al --icons=auto";
lt = "eza -RT --icons=auto --git-ignore";
llt = "eza -alRT --icons=auto --git-ignore";
};
}
31 changes: 31 additions & 0 deletions software/home-manager/cli-programs/git.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{ pkgs, ... }:
{
programs.git = {
enable = true;
delta = {
enable = true;
options = {
# https://dandavison.github.io/delta/hyperlinks.html
hyperlinks = true;
hyperlinks-file-link-format = "vscode://file/{path}:{line}";
navigate = true;
side-by-side = true;
line-numbers = true;
true-color = "always";
};
};
extraConfig = {
diff = {
color-moved = "default";
};
merge = {
# https://dandavison.github.io/delta/merge-conflicts.html
conflict-style = "zdiff3";
};
};
};
programs.gh = {
enable = true;
package = pkgs.unstable.gh;
};
}
16 changes: 16 additions & 0 deletions software/home-manager/cli-programs/misc-utils.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
wishlist
tldr
iperf3
];

programs.btop = {
enable = true;
settings = {
update_ms = 200;
cpu_graph_lower = "user";
};
};
}
19 changes: 19 additions & 0 deletions software/home-manager/cli-programs/nix.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{ pkgs, username, ... }:
{
programs.nh = {
enable = true;
flake = "/home/${username}/perseus-v2";
};
home.packages = with pkgs; [
nix-output-monitor
nixd
];

home.shellAliases = {
and = "nom develop";
nds = "nom develop -c $SHELL";
nb = "nom build";
nfc = "nix flake check --impure .";
nhs = "nh home switch";
};
}
8 changes: 8 additions & 0 deletions software/home-manager/cli-programs/search-tools/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{ ... }:
{
imports = [
./fzf.nix
];
programs.fd.enable = true;
programs.ripgrep.enable = true;
}
9 changes: 9 additions & 0 deletions software/home-manager/cli-programs/search-tools/fzf.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{ ... }:
{
programs.fzf.enable = true;
programs.zsh.oh-my-zsh = {
plugins = [
"fzf"
];
};
}
44 changes: 44 additions & 0 deletions software/home-manager/cli-programs/term-multiplexing.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
pkgs,
lib,
config,
...
}:
{
options = {
programs.tmux.bg-color = lib.mkOption {
type = lib.types.str;
default = "color32"; # default to a nice blue
};
};
config = {
programs.tmux = {
shortcut = "space";
clock24 = true;
terminal = "tmux-256color";
extraConfig = ''
set -g status-bg ${config.programs.tmux.bg-color}
'';
tmuxinator.enable = config.programs.tmux.enable;
tmuxp.enable = config.programs.tmux.enable;
};
programs.zsh = {
oh-my-zsh = lib.mkIf config.programs.tmux.enable {
plugins = [
"tmux"
];
};
initExtra = lib.mkIf config.programs.zellij.enable ''
eval "$(zellij setup --generate-auto-start=zsh)"
'';
};

programs.zellij = {
enable = true;
package = pkgs.unstable.zellij;
enableBashIntegration = config.programs.bash.enable;
enableZshIntegration = config.programs.zsh.enable;
settings = { };
};
};
}
32 changes: 32 additions & 0 deletions software/home-manager/cli-programs/tmux.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
lib,
options,
config,
...
}:
{
options = {
programs.tmux.bg-color = lib.mkOption {
type = lib.types.str;
default = "color32"; # default to a nice teal
};
};
config = {
programs.tmux = {
enable = true;
shortcut = "space";
clock24 = true;
terminal = "tmux-256color";
extraConfig = ''
set -g status-bg ${config.programs.tmux.bg-color}
'';
tmuxinator.enable = true;
tmuxp.enable = true;
};
programs.zsh.oh-my-zsh = {
plugins = [
"tmux"
];
};
};
}
9 changes: 9 additions & 0 deletions software/home-manager/cli-programs/zoxide.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{ ... }:
{
programs.zoxide.enable = true;
home.shellAliases = {
# cd -> zoxide
cd = "z";
".." = "z ..";
};
}
Loading

0 comments on commit 88af433

Please sign in to comment.