mwahahahaha, have the orome config building! on to manwe

This commit is contained in:
Chris Kruining 2025-03-18 21:06:40 +01:00
parent 3a2f52f45e
commit af58cfb4ab
30 changed files with 259 additions and 199 deletions

View file

@ -22,23 +22,17 @@ in
(mkIf (cfg.default != null) {
users.defaultUserShell = pkgs."${cfg.default}";
modules.shell.toolset.gnupg.enable = true;
# modules.${user}.shell.toolset.gnupg.enable = true;
})
(mkIf cfg.corePkgs.enable {
modules.shell.toolset = {
modules.${user}.shell.toolset = {
btop.enable = true;
fzf.enable = true;
starship.enable = true;
tmux.enable = true;
};
home-manager.users.${user}.programs.direnv = {
enable = true;
nix-direnv.enable = true;
config.whitelist.prefix = ["/home"];
};
user.packages = attrValues {
inherit (pkgs) any-nix-shell pwgen yt-dlp ripdrag yazi;
inherit (pkgs) bat fd zoxide;
@ -47,6 +41,12 @@ in
};
home-manager.users.${user}.programs = {
direnv = {
enable = true;
nix-direnv.enable = true;
config.whitelist.prefix = ["/home"];
};
bat.enable = true;
eza.enable = true;
fzf.enable = true;

View file

@ -1,4 +1,4 @@
{ config, options, lib, pkgs, ... }:
{ config, options, lib, pkgs, user, ... }:
let
inherit (lib.attrsets) optionalAttrs;
inherit (lib.modules) mkIf;
@ -10,7 +10,7 @@ in
config = mkIf config.modules.${user}.shell.toolset.fzf.enable {
home-manager.users.${user}.programs.fzf = let
defShell = config.modules.shell.default;
defShell = config.modules.${user}.shell.default;
in {
enable = true;
enableBashIntegration = true;

View file

@ -14,7 +14,7 @@ in
inherit (pkgs) act dura lazygit;
inherit (pkgs.gitAndTools) gh git-open;
}
// optionalAttrs config.modules.shell.toolset.gnupg.enable {
// optionalAttrs config.modules.${user}.shell.toolset.gnupg.enable {
inherit (pkgs.gitAndTools) git-crypt;
});

View file

@ -1,4 +1,4 @@
{ config, options, lib, pkgs, ... }:
{ config, options, lib, pkgs, user, ... }:
let
inherit (builtins) getEnv;
inherit (lib.modules) mkIf;
@ -8,23 +8,31 @@ in
{
options.modules.${user}.shell.toolset.gnupg = let
inherit (lib.options) mkEnableOption;
in { enable = mkEnableOption "cryptographic suite"; };
in {
enable = mkEnableOption "cryptographic suite";
};
config = mkIf cfg.enable {
user.package = with pkgs; [ gnupg ];
config = mkIf config.modules.shell.toolset.gnupg.enable {
environment.variables.GNUPGHOME = "$XDG_CONFIG_HOME/gnupg";
home-manager.users.${user}.programs.gnupg.agent = {
home-manager.users.${user}.programs.gnupg = {
enable = true;
enableSSHSupport = true;
pinentryPackage = pkgs.pinentry-gnome3;
settings = let
cacheTTL = 86400;
in {
default-cache-ttl = cacheTTL;
default-cache-ttl-ssh = cacheTTL;
max-cache-ttl = cacheTTL;
max-cache-ttl-ssh = cacheTTL;
agent = {
enable = true;
enableSSHSupport = true;
pinentryPackage = pkgs.pinentry-gnome3;
settings = let
cacheTTL = 86400;
in {
default-cache-ttl = cacheTTL;
default-cache-ttl-ssh = cacheTTL;
max-cache-ttl = cacheTTL;
max-cache-ttl-ssh = cacheTTL;
};
};
};
};

View file

@ -1,99 +1,104 @@
{ config, options, pkgs, lib, ... }:
{ config, options, pkgs, lib, user, ... }:
let
inherit (lib.attrsets) mapAttrsToList;
inherit (lib.modules) mkIf;
inherit (lib.strings) concatStrings escapeNixString;
cfg = config.modules.shell;
cfg = config.modules.${user}.shell;
in
{
config = mkIf (cfg.default == "zsh") {
modules.shell = {
corePkgs.enable = true;
toolset = {
starship.enable = true;
};
};
modules.shell.zsh.enable = true;
home-manager.users.${user}.programs.starship.enableZshIntegration = true;
modules.${user}.shell = {
corePkgs.enable = true;
};
# Enable completion for sys-packages:
environment.pathsToLink = ["/share/zsh"];
home-manager.users.${user}.programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
history = {
size = 10000;
path = "$XDG_CONFIG_HOME/zsh/history";
home-manager.users.${user} = {
xdg.configFile."zsh-abbreviations" = {
target = "zsh/abbreviations";
text = let
abbrevs = {
ls = "eza -al";
};
in ''
${concatStrings (mapAttrsToList
(k: v: "abbr ${k}=${escapeNixString v}")
abbrevs
)}
'';
};
oh-my-zsh = {
enable = true;
plugins = ["git" "docker-compose" "zoxide"];
};
programs = {
starship.enableZshIntegration = true;
plugins = let
mkZshPlugin = {
pkg,
file ? "${pkg.pname}.plugin.zsh",
}: {
name = pkg.pname;
src = pkg.src;
inherit file;
zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
history = {
size = 10000;
path = "$XDG_CONFIG_HOME/zsh/history";
};
oh-my-zsh = {
enable = true;
plugins = ["git" "docker-compose" "zoxide"];
};
plugins = let
mkZshPlugin = {
pkg,
file ? "${pkg.pname}.plugin.zsh",
}: {
name = pkg.pname;
src = pkg.src;
inherit file;
};
in
with pkgs; [
(mkZshPlugin {pkg = zsh-abbr;})
(mkZshPlugin {pkg = zsh-autopair;})
(mkZshPlugin {pkg = zsh-you-should-use;})
(mkZshPlugin {
pkg = zsh-nix-shell;
file = "nix-shell.plugin.zsh";
})
{
name = "zsh-autosuggestion";
src = pkgs.fetchFromGitHub {
owner = "zsh-users";
repo = "zsh-autosuggestions";
rev = "v0.7.0";
sha256 = "1g3pij5qn2j7v7jjac2a63lxd97mcsgw6xq6k5p7835q9fjiid98";
};
}
{
name = "zsh-completions";
src = pkgs.fetchFromGitHub {
owner = "zsh-users";
repo = "zsh-completions";
rev = "0.34.0";
sha256 = "0jjgvzj3v31yibjmq50s80s3sqi4d91yin45pvn3fpnihcrinam9";
};
}
{
name = "zsh-syntax-highlighting";
src = pkgs.fetchFromGitHub {
owner = "zsh-users";
repo = "zsh-syntax-highlighting";
rev = "0.7.0";
sha256 = "0s1z3whzwli5452h2yzjzzj27pf1hd45g223yv0v6hgrip9f853r";
};
}
];
};
in
with pkgs; [
(mkZshPlugin {pkg = zsh-abbr;})
(mkZshPlugin {pkg = zsh-autopair;})
(mkZshPlugin {pkg = zsh-you-should-use;})
(mkZshPlugin {
pkg = zsh-nix-shell;
file = "nix-shell.plugin.zsh";
})
{
name = "zsh-autosuggestion";
src = pkgs.fetchFromGitHub {
owner = "zsh-users";
repo = "zsh-autosuggestions";
rev = "v0.7.0";
sha256 = "1g3pij5qn2j7v7jjac2a63lxd97mcsgw6xq6k5p7835q9fjiid98";
};
}
{
name = "zsh-completions";
src = pkgs.fetchFromGitHub {
owner = "zsh-users";
repo = "zsh-completions";
rev = "0.34.0";
sha256 = "0jjgvzj3v31yibjmq50s80s3sqi4d91yin45pvn3fpnihcrinam9";
};
}
{
name = "zsh-syntax-highlighting";
src = pkgs.fetchFromGitHub {
owner = "zsh-users";
repo = "zsh-syntax-highlighting";
rev = "0.7.0";
sha256 = "0s1z3whzwli5452h2yzjzzj27pf1hd45g223yv0v6hgrip9f853r";
};
}
];
};
home-manager.users.${user}.xdg.configFile."zsh-abbreviations" = {
target = "zsh/abbreviations";
text = let
abbrevs = import "${config.sneeuwvlok.configDir}/shell-abbr";
in ''
${concatStrings (mapAttrsToList
(k: v: "abbr ${k}=${escapeNixString v}")
abbrevs
)}
'';
};
};
};
}