Compare commits

...

4 Commits

12 changed files with 611 additions and 1167 deletions

6
.envrc
View File

@@ -1,11 +1,7 @@
# -*- mode: sh; -*- # -*- mode: sh; -*-
if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs="
fi
watch_file flake.nix watch_file flake.nix
watch_file flake.lock watch_file flake.lock
if ! use flake . --no-pure-eval if ! use flake . --no-pure-eval
then then
echo "devenv could not be built. The devenv environment was not loaded. Make the necessary changes to devenv.nix and hit enter to try again." >&2 echo "dev shell could not be built. The environment was not loaded. Make the necessary changes to flake.nix and hit enter to try again." >&2
fi fi

894
flake.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -3,11 +3,7 @@
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
devenv = {
url = "github:cachix/devenv";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = { home-manager = {
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
@@ -82,42 +78,22 @@
outputs = { outputs = {
self, self,
nixpkgs, nixpkgs,
flake-utils,
home-manager, home-manager,
devenv,
srvos, srvos,
... ...
} @ inputs: let } @ inputs:
flake-utils.lib.eachDefaultSystem (
system: let
inherit (self) outputs; inherit (self) outputs;
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
in { in {
formatter.${system} = pkgs.alejandra; formatter = pkgs.alejandra;
devShells.default = pkgs.mkShell {
packages.${system} = { buildInputs = [pkgs.nh];
devenv-up = self.devShells.${system}.default.config.procfileScript;
devenv-test = self.devShells.${system}.default.config.test;
};
devShells.${system}.default = devenv.lib.mkShell {
inherit inputs pkgs;
modules = [
(
{pkgs, ...}: {
packages = [pkgs.nh];
git-hooks.hooks = {
alejandra.enable = true;
commitizen.enable = true;
detect-private-keys.enable = true;
end-of-file-fixer.enable = true;
deadnix.enable = true;
ripsecrets.enable = true;
statix.enable = true;
};
}
)
];
}; };
packages = {
homeConfigurations = let homeConfigurations = let
extraSpecialArgs = {inherit inputs outputs system;}; extraSpecialArgs = {inherit inputs outputs system;};
pkgs = nixpkgs.legacyPackages.x86_64-linux; pkgs = nixpkgs.legacyPackages.x86_64-linux;
@@ -197,4 +173,6 @@
}; };
}; };
}; };
}
);
} }

View File

@@ -9,6 +9,7 @@ in {
imports = [ imports = [
./caelestia.nix ./caelestia.nix
./eww.nix ./eww.nix
./firefox.nix
./hyprland.nix ./hyprland.nix
./kdeconnect.nix ./kdeconnect.nix
./kitty.nix ./kitty.nix
@@ -18,6 +19,7 @@ in {
./swaync.nix ./swaync.nix
./theme.nix ./theme.nix
./waybar.nix ./waybar.nix
./wl-kbptr.nix
./wlr-which-key.nix ./wlr-which-key.nix
./wlsunset.nix ./wlsunset.nix
]; ];
@@ -25,6 +27,7 @@ in {
options.home.desktop.fullDesktop = mkEnableOption "Enable options for graphical environments"; options.home.desktop.fullDesktop = mkEnableOption "Enable options for graphical environments";
config.home.desktop = { config.home.desktop = {
eww.enable = mkDefault cfg.fullDesktop; eww.enable = mkDefault cfg.fullDesktop;
firefox.enable = mkDefault cfg.fullDesktop;
hyprland.enable = mkDefault cfg.fullDesktop; hyprland.enable = mkDefault cfg.fullDesktop;
kdeconnect.enable = mkDefault cfg.fullDesktop; kdeconnect.enable = mkDefault cfg.fullDesktop;
kitty.enable = mkDefault cfg.fullDesktop; kitty.enable = mkDefault cfg.fullDesktop;

View File

@@ -0,0 +1,70 @@
{
config,
lib,
inputs,
pkgs,
...
}:
with lib; let
cfg = config.home.desktop.firefox;
inherit (pkgs.stdenv.hostPlatform) system;
zen = inputs.zen-browser.packages.${system}.default;
settingsToLines = settings:
concatStringsSep "\n" (mapAttrsToList (name: value: "set ${name} ${toString value}") settings);
in {
options.home.desktop.firefox = {
enable = mkEnableOption "enable Firefox";
useZen = mkEnableOption "use Zen instead of Firefox";
tridactyl = {
enable = mkEnableOption "enable Tridactyl";
preConfig = mkOption {
description = "Lines to add to the beginning of tridactylrc";
type = types.lines;
default = "";
};
config = mkOption {
type = with types;
attrsOf (oneOf [
int
str
bool
]);
description = "Tridactyl settings (converted to 'set key value' lines)";
default = {};
example = {
smoothscroll = true;
history = 1000;
};
};
extraConfig = mkOption {
description = "Extra lines to add to tridactylrc (for bindings, autocmds, etc)";
type = types.lines;
default = "";
};
};
};
config = mkIf cfg.enable {
programs.firefox = {
inherit (cfg) enable;
package =
if cfg.useZen
then zen
else pkgs.firefox;
nativeMessagingHosts = lists.optional cfg.tridactyl.enable pkgs.tridactyl-native;
};
xdg.configFile."tridactyl/tridactylrc" = mkIf cfg.tridactyl.enable {
text = concatStringsSep "\n" (filter (s: s != "") [
cfg.tridactyl.preConfig
(settingsToLines (cfg.tridactyl.config
// {
browser =
if cfg.useZen
then "zen"
else "firefox";
}))
cfg.tridactyl.extraConfig
]);
};
};
}

View File

@@ -0,0 +1,37 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
configDir = config.xdg.configHome;
cfg = config.home.desktop.wl-kbptr;
iniFormat = pkgs.formats.ini {};
in {
options.home.desktop.wl-kbptr = {
enable = mkEnableOption "enable wl-kbptr";
config = mkOption {
inherit (iniFormat) type;
default = {};
description = ''
Options to add to the {file}`config` file. See
<https://github.com/moverest/wl-kbptr/blob/main/config.example>
for options.
'';
example = {
general = {
home_row_keys = "abcd";
};
};
};
};
config = mkIf cfg.enable {
home = {
packages = [pkgs.wl-kbptr];
file."${configDir}/wl-kbptr/config" = mkIf (cfg.config != {}) {
source = iniFormat.generate "wl-kbptr-config" cfg.config;
};
};
};
}

View File

@@ -6,16 +6,23 @@
}: }:
with lib; let with lib; let
cfg = config.home.dev.ai.claude; cfg = config.home.dev.ai.claude;
jsonFormat = pkgs.formats.json {};
in { in {
options.home.dev.ai.claude.enable = mkEnableOption "Enables Claude-related packages"; options.home.dev.ai.claude = {
enable = mkEnableOption "Enables Claude-related packages";
mcpServers = mkOption {
inherit (jsonFormat) type;
default = {};
};
};
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = let home.packages = let
claude-jj = pkgs.writeShellScriptBin "claude-jj" '' claude-jj = pkgs.writeShellScriptBin "claude-jj" ''
${pkgs.claude-code}/bin/claude --append-system-prompt 'CRITICAL: This repository uses Jujutsu (jj), NOT git. Never use git commands. Use jj equivalents. See CLAUDE.md.' "$@" ${pkgs.claude-code}/bin/claude --append-system-prompt 'CRITICAL: This repository uses Jujutsu (jj), NOT git. Never use git commands. Use jj equivalents.' "$@"
''; '';
in [claude-jj]; in [claude-jj pkgs.sox];
programs.claude-code = { programs.claude-code = {
inherit (cfg) enable; inherit (cfg) enable mcpServers;
}; };
}; };
} }

View File

@@ -6,18 +6,34 @@
}: }:
with lib; let with lib; let
cfg = config.home.dev.ai; cfg = config.home.dev.ai;
jsonFormat = pkgs.formats.json {};
in { in {
imports = [ imports = [
./claude.nix ./claude.nix
./ollama.nix ./ollama.nix
]; ];
options.home.dev.ai.enable = mkEnableOption "Enables AI features"; options.home.dev.ai = {
config.home = mkIf cfg.enable { enable = mkEnableOption "Enables AI features";
mcpServers = mkOption {
inherit (jsonFormat) type;
default = {};
};
};
config = {
home = mkIf cfg.enable {
dev.ai = { dev.ai = {
claude.enable = mkDefault cfg.enable; claude = {
enable = mkDefault cfg.enable;
mcpServers = mkDefault cfg.mcpServers;
};
ollama.enable = mkDefault cfg.enable; ollama.enable = mkDefault cfg.enable;
}; };
packages = [pkgs.lmstudio]; packages = [pkgs.lmstudio];
}; };
programs.mcp = mkIf (cfg.mcpServers != {}) {
enable = true;
servers = cfg.mcpServers;
};
};
} }

View File

@@ -128,7 +128,10 @@ in {
"dist/" "dist/"
]; ];
signing = { signing = {
format = if cfg.publicKeyFile != null then "ssh" else "openpgp"; format =
if cfg.publicKeyFile != null
then "ssh"
else "openpgp";
key = cfg.publicKeyFile; key = cfg.publicKeyFile;
signByDefault = true; signByDefault = true;
}; };

View File

@@ -65,10 +65,91 @@
}; };
desktop = { desktop = {
caelestia.enable = true; caelestia.enable = true;
firefox = {
enable = true;
useZen = true;
tridactyl = {
enable = true;
preConfig = "sanitise tridactyllocal tridactylsync";
config = {
editorcmd = "emacsclient -c";
keyboardlayoutbase = "bepo";
keyboardlayoutforce = "true";
hintchars = "auiectsr";
smothscroll = "true";
};
extraConfig = ''
unbind h
unbind j
unbind k
unbind l
unbind c
unbind t
unbind s
unbind r
unbind H
unbind J
unbind K
unbind L
unbind C
unbind T
unbind S
unbind R
" === Bépo layout scrolling (ctsr = hjkl) ===
bind c scrollpx -300 0
bind t scrollline 5
bind s scrollline -5
bind r scrollpx 300 0
" Half/full page scroll (replacing C-f/C-b/C-d/C-u)
bind <C-t> scrollpage 0.5
bind <C-s> scrollpage -0.5
" === History navigation (C/R = H/L) ===
bind C back
bind R forward
" === Tab navigation (T/S = J/K) ===
bind T tabprev
bind S tabnext
" === Displaced commands ===
" reload was on r move to h (bépo's 'replace' position)
bind h reload
bind H reloadhard
" tabopen was on t move to j (bépo's 'find char to' position)
bind j fillcmdline tabopen
unbind ^http(s?)://youtube\.com f
unbind ^http(s?)://youtube\.com t
unbind ^http(s?)://youtube\.com l
unbind ^http(s?)://youtube\.com j
unbind ^http(s?)://twitch\.tv f
bind < urlincrement -1
bind > urlincrement 1
bind ypv js tri.native.run(`mpv --ytdl-format="[height >=? 480]" --ontop --fs "''${document.location.href}"`)
bind ypm hint -JF e => tri.native.run(`mpv --ytdl-format="[height >=? 480]" --ontop --fs "''${e.href}"`)
'';
};
};
spotify = { spotify = {
enable = true; enable = true;
spicetify.enable = true; spicetify.enable = true;
}; };
wl-kbptr = {
enable = true;
config = {
general = {
# first eight chars to select areas, last three chars
# for left, right, middle click
home_row_keys = "auiectsrtsr";
modes = "tile,bisect";
};
};
};
}; };
dev = { dev = {
ai.claude.enable = true; ai.claude.enable = true;

View File

@@ -9,7 +9,6 @@ with lib; let
handy = pkgs.callPackage ../../packages/handy.nix {}; handy = pkgs.callPackage ../../packages/handy.nix {};
inkdrop = pkgs.callPackage ../../packages/inkdrop.nix {}; inkdrop = pkgs.callPackage ../../packages/inkdrop.nix {};
pumo-system-info = inputs.pumo-system-info.packages.${system}.default; pumo-system-info = inputs.pumo-system-info.packages.${system}.default;
zen = inputs.zen-browser.packages.${system}.default;
in { in {
programs.bun.enable = true; programs.bun.enable = true;
home.packages = with pkgs; [ home.packages = with pkgs; [
@@ -52,7 +51,6 @@ in {
scrcpy scrcpy
syncthing syncthing
watchmate watchmate
zen
# Games # Games
atlauncher atlauncher

View File

@@ -1,6 +1,7 @@
{ {
config, config,
pkgs, pkgs,
lib,
... ...
}: { }: {
config.home.desktop.wlr-which-key.settings = { config.home.desktop.wlr-which-key.settings = {
@@ -27,7 +28,8 @@
logout = import ./logout.nix {inherit pkgs;}; logout = import ./logout.nix {inherit pkgs;};
ytplay = import ../../modules/cli/scripts/ytplay.nix {inherit pkgs;}; ytplay = import ../../modules/cli/scripts/ytplay.nix {inherit pkgs;};
plock = import ../../modules/cli/scripts/plock.nix {inherit pkgs;}; plock = import ../../modules/cli/scripts/plock.nix {inherit pkgs;};
in [ in
[
{ {
key = "a"; key = "a";
desc = "Apps"; desc = "Apps";
@@ -238,6 +240,11 @@
} }
]; ];
} }
]; ]
++ lib.lists.optional config.home.desktop.wl-kbptr.enable {
key = "m";
desc = "Mouse Warp";
cmd = "wl-kbptr";
};
}; };
} }