4 Commits

Author SHA1 Message Date
4207b320c9 working? plus cleanup and fallbacks 2025-11-17 12:12:17 -05:00
6561e37119 wip: still broken 2025-11-06 17:14:39 -05:00
717e8c452d wip: broken, still working on it' 2025-10-31 17:07:59 -04:00
8fd3ca8c9a wip: modularizing? 2025-10-30 17:34:55 -04:00
15 changed files with 203 additions and 103 deletions

View File

View File

@@ -50,7 +50,7 @@
specialArgs = {
inherit userName userEmail ghostty;
hostname = "sephiroth";
role = "devel";
role = "workstation";
};
modules = [
myOverlays
@@ -61,7 +61,8 @@
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = extraSpecialArgs;
home-manager.extraSpecialArgs = extraSpecialArgs // { isNixOS = false; };
# home-manager.extraSpecialArgs = extraSpecialArgs;
home-manager.backupFileExtension = "bak";
home-manager.users.${userName} = import ./home;
}
@@ -74,7 +75,7 @@
specialArgs = {
inherit userName userEmail ghostty;
hostname = "cloud";
role = "devel";
role = "workstation";
};
modules = [
myOverlays
@@ -150,5 +151,28 @@
# }
# ];
};
# generic non-NixOS Linux machine
homeConfigurations."generic" = let
hostname = builtins.getEnv "HOSTNAME";
system = "x86_64-linux";
in home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.${system};
extraSpecialArgs = {
inherit userName userEmail hostname ghostty;
isNixOS = false;
role = "workstation";
};
modules = [
{
nixpkgs.overlays = [
rust-overlay.overlays.default
self.common.overlays
];
}
./home
];
};
};
}

View File

@@ -1,6 +1,7 @@
{
pkgs,
lib,
isNixOS ? true,
...
}: {
programs.firefox = {
@@ -9,7 +10,7 @@
};
programs.chromium = {
enable = pkgs.stdenv.isLinux;
enable = pkgs.stdenv.isLinux && isNixOS;
package = pkgs.ungoogled-chromium.override {
enableWideVine = true;
commandLineArgs = [

View File

@@ -1,64 +1,58 @@
{
lib,
pkgs,
userName,
userEmail,
ghostty,
...
}: let
# Have a file sturcture that holds all the configuration files that can't be configured by Nix
# or maybe I'm too lazy to do anything about it? I dunno
{ lib
, pkgs
, userName
, isNixOS ? true
, ...
}:
let
# TODO: Have a file structure that holds all the configuration files that can't be configured by Nix (or I haven't found the time to do so)
dirs = {
defaults = ../defaults;
};
in {
in
{
_module.args = {
inherit dirs;
};
# Import sub modules
imports = map (module: import module {inherit lib pkgs dirs userName userEmail ghostty;}) [
./atuin.nix
./shell.nix
imports = [
./packages
./git.nix
./starship.nix
./eza.nix
./neovim.nix
./direnv.nix
./sway.nix
./terminal.nix
./browser.nix
./zellij.nix
./bat.nix
./lazygit.nix
];
# Home Manager needs a bit of information about you and the
# paths it should manage.
home = {
username = userName;
homeDirectory =
if pkgs.stdenv.isDarwin
then "/Users/${userName}"
else "/home/${userName}";
home = lib.mkMerge [
{
username = userName;
homeDirectory =
if pkgs.stdenv.isDarwin
then "/Users/${userName}"
else "/home/${userName}";
sessionVariables = {
XDG_CURRENT_DESKTOP = "sway";
XDG_SESSION_TYPE = "wayland";
XDG_SESSION_DESKTOP="sway";
XDG_CONFIG_HOME = "$HOME/.config";
XDG_CACHE_HOME = "$HOME/.cache";
XDG_DATA_HOME = "$HOME/.local/share";
XDG_STATE_HOME = "$HOME/.local/state";
NIXOS_OZONE_WL = "1";
};
stateVersion = "24.11";
}
pointerCursor = lib.mkIf pkgs.stdenv.isLinux {
gtk.enable = true;
package = pkgs.catppuccin-cursors.mochaDark;
name = "catppuccin-mocha-dark-cursors";
size = 22;
};
(lib.mkIf isNixOS {
sessionVariables = {
XDG_CURRENT_DESKTOP = "sway";
XDG_SESSION_TYPE = "wayland";
XDG_SESSION_DESKTOP = "sway";
XDG_CONFIG_HOME = "$HOME/.config";
XDG_CACHE_HOME = "$HOME/.cache";
XDG_DATA_HOME = "$HOME/.local/share";
XDG_STATE_HOME = "$HOME/.local/state";
NIXOS_OZONE_WL = "1";
};
})
stateVersion = "24.11";
};
(lib.mkIf pkgs.stdenv.isLinux {
pointerCursor = {
gtk.enable = true;
package = pkgs.catppuccin-cursors.mochaDark;
name = "catppuccin-mocha-dark-cursors";
size = 22;
};
})
];
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;

32
home/k9s.nix Normal file
View File

@@ -0,0 +1,32 @@
{ pkgs, ... }: {
programs.k9s = {
enable = true;
package = pkgs.k9sLatest;
settings.k9s = {
refreshRate = "2s";
liveViewAutoRefresh = false;
apiServerTimeout = "30s";
maxConnRetry = 5;
readOnly = true;
noExitOnCtrlC = false;
portForwardAddress = "localhost";
skipLatestRevCheck = false;
skin = {
catppuccin-mocha = ./defaults/k9s/catppuccin-mocha.yml;
};
ui = {
skin = "catppuccin-mocha";
enableMouse = true;
headless = false;
logoless = true;
crumbsless = false;
splashless = true;
reactive = false;
noIcons = false;
defaultsToFullscreen = false;
};
};
};
}

12
home/krew.nix Normal file
View File

@@ -0,0 +1,12 @@
{ pkgs, lib, ... }:
with pkgs;
let
plugins = writeText "plugins" ''
krew
oidc-login
'';
in {
home.activation.krew = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
$DRY_RUN_CMD ${krewfile}/bin/krewfile -command ${krew}/bin/krew -file ${plugins}
'';
}

View File

@@ -2,9 +2,19 @@
pkgs,
...
}: {
home.packages = with pkgs; [
yazi # terminal file manager
imports = [
../atuin.nix
../shell.nix
../git.nix
../starship.nix
../eza.nix
../neovim.nix
../bat.nix
];
nixpkgs.config.allowUnfree = true;
home.packages = with pkgs; [
# archives
zip
xz
@@ -12,39 +22,22 @@
p7zip
# utils
yazi
tmux
bottom
ripgrep
jq
yq-go
fzf
fh
aria2
yt-dlp
obsidian
vscode
weechat
gnupg
inetutils
# misc
cowsay
file
which
tree
gnutar
gnupg
zoxide
babelfish
# language-specific package managers
nodejs
cargo
python3
# nix specific stuff
nixd
deadnix
alejandra
statix
];
}

View File

@@ -1,10 +1,7 @@
{
pkgs,
lib,
...
}: {
home.packages = lib.mkIf pkgs.stdenv.isDarwin (with pkgs; [
{ lib, pkgs, ... }:
lib.mkIf pkgs.stdenv.isDarwin {
home.packages = with pkgs; [
discord
ollama
]);
];
}

View File

@@ -1,11 +1,11 @@
{ lib, role, ... }:
{
pkgs,
lib,
...
}: {
imports = [
./common.nix
./darwin.nix
./linux.nix
];
imports =
[
./common.nix
./darwin.nix
./linux.nix
]
++ lib.optional (role == "workstation") ./workstation.nix
++ lib.optional (role == "server") ./server.nix;
}

View File

@@ -1,20 +1,16 @@
{
pkgs,
lib,
...
}: {
home.packages = lib.mkIf pkgs.stdenv.isLinux (with pkgs; [
{ lib, pkgs, isNixOS ? true, ... }:
lib.mkIf pkgs.stdenv.isLinux {
home.packages = with pkgs; [
imv
xdg-utils
] ++ lib.optional isNixOS [
betterdiscordctl
vesktop
xdg-utils
mcrcon
xfce.thunar
pavucontrol
godot
aseprite
gpu-screen-recorder
gpu-screen-recorder-gtk
# ungoogled-chromium
]);
];
}

View File

@@ -0,0 +1,4 @@
{ pkgs, ... }: {
home.packages = [
];
}

View File

@@ -0,0 +1,33 @@
{
lib,
pkgs,
isNixOS ? true,
...
}: {
imports = [
../terminal.nix
../browser.nix
../zellij.nix
../lazygit.nix
../k9s.nix
../krew.nix
../direnv.nix
] ++ lib.optional isNixOS ../sway.nix;
home.packages = with pkgs; [
fh
kubectl # kube config is deliberately not included
kubectx
obsidian
vscode
yt-dlp
weechat
nodejs
cargo
python3
nixd
deadnix
alejandra
statix
];
}

View File

@@ -1,4 +1,4 @@
{ lib, pkgs, ghostty, ... }: {
{ pkgs, ghostty, ... }: {
programs.alacritty = {
enable = pkgs.stdenv.isLinux;
settings = {

0
lib/checkSystem.nix Normal file
View File

View File

@@ -47,4 +47,18 @@ in {
mkdir -p "$XDG_CONFIG_HOME" "$XDG_DATA_HOME" "$XDG_STATE_HOME"
'';
});
k9sLatest = prev.k9s.overrideAttrs (oldAttrs: rec {
version = "0.30.16";
src = prev.fetchFromGitHub {
owner = "derailed";
repo = "k9s";
rev = "v${version}";
hash = "sha256-1z6r6v3n1p6vd2q6n4pl5q3f7q3q7q1p7j5j1k3l4m5n6o7p8q9r";
};
ldflags = [
"-X github.com/derailed/k9s/version.Version=${version}"
"-X github.com/derailed/k9s/version.BuildSource=nix"
];
});
}