organise all options into modules

This commit is contained in:
atagen 2024-05-08 15:05:43 +10:00
parent c7c6606d14
commit 3192b6ca09
43 changed files with 518 additions and 423 deletions

16
home/programs/atuin.nix Normal file
View file

@ -0,0 +1,16 @@
{...}:
{
programs.atuin = {
enable = true;
enableZshIntegration = true;
settings = {
inline_height = 20;
show_preview = true;
show_help = false;
enter_accept = false;
keymap_mode = "vim-normal";
style = "compact";
};
};
}

18
home/programs/cli.nix Normal file
View file

@ -0,0 +1,18 @@
{pkgs, ...}: {
imports = [
./kitty.nix
./zsh.nix
./xresources.nix
./helix.nix
./atuin.nix
];
home.packages = with pkgs; [
btop
bat
ripgrep
fd
lazygit
zoxide
zellij
];
}

View file

@ -0,0 +1,7 @@
{...}: {
flatpaks = [
"ar.com.tuxguitar.TuxGuitar"
"org.inkscape.Inkscape"
"com.github.PintaProject.Pinta"
];
}

17
home/programs/desktop.nix Normal file
View file

@ -0,0 +1,17 @@
{pkgs, ...}: {
imports = [
./media-players.nix
./firefox.nix
./flatpak.nix
./webapps.nix
./vscode.nix
./documents.nix
./creative.nix
];
home.packages = with pkgs; [
gnome.file-roller
gnome.nautilus
thunderbird
keepassxc
];
}

22
home/programs/dev.nix Normal file
View file

@ -0,0 +1,22 @@
{pkgs, ...}: {
home.packages = with pkgs; [
git-credential-keepassxc
direnv
];
programs.direnv = {
enable = true;
nix-direnv = {
enable = true;
};
};
programs.git = {
enable = true;
userName = "atagen";
userEmail = "atagen@boss.co";
extraConfig = {
credential.helper = "keepassxc";
};
};
}

View file

@ -0,0 +1,15 @@
{...}: {
flatpaks = [
{
name = "md.obsidian.Obsidian";
overrides = {
Environment = {
OBSIDIAN_DISABLE_GPU = "1";
};
};
}
# "org.onlyoffice.desktopeditors"
"org.libreoffice.LibreOffice"
"com.jgraph.drawio.desktop"
];
}

View file

@ -16,7 +16,7 @@
Status = "locked";
};
in {
config.programs.firefox = {
programs.firefox = {
enable = true;
policies = {

63
home/programs/flatpak.nix Normal file
View file

@ -0,0 +1,63 @@
{
config,
lib,
...
}: let
inherit (lib) mkOption;
inherit (builtins) typeOf listToAttrs;
in {
options.flatpaks = mkOption {
default = [];
type = with lib.types;
listOf (either str (submodule {
options = {
name = mkOption {
type = str;
};
overrides = mkOption {
type = attrsOf (attrsOf (either str (listOf str)));
default = {};
};
};
}));
};
config.services.flatpak = let
userOverrides = listToAttrs (
map (
fp:
if (typeOf fp == "string")
then {
name = fp;
value = {};
}
else {
inherit (fp) name;
value = fp.overrides;
}
)
config.flatpaks
);
in {
enable = true;
uninstallUnmanaged = true;
update.auto.enable = true;
packages =
map (
fp:
if (typeOf fp == "set")
then fp.name
else fp
)
config.flatpaks;
overrides =
userOverrides
// {
global = {
Context.sockets = ["wayland"];
Environment = {
ELECTRON_OZONE_PLATFORM_HINT = "auto";
};
};
};
};
}

View file

@ -7,7 +7,7 @@
palette-hex = pkgs.lib.nix-rice.palette.toRgbHex pkgs.rice.palette;
palette-shex = pkgs.lib.nix-rice.palette.toRGBShortHex pkgs.rice.palette;
in {
config.programs.helix = {
programs.helix = {
enable = true;
themes = with palette-hex; {
nix-rice = {

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

View file

@ -0,0 +1,10 @@
{pkgs, ...}: {
home.packages = with pkgs; [
mpv
imv
strawberry
zathura
# libnotify
playerctl
];
}

35
home/programs/ollama.nix Normal file
View file

@ -0,0 +1,35 @@
{
lib,
pkgs,
...
}: let
inherit (lib) getExe;
inherit (builtins) toString;
inherit (pkgs) writeShellScript;
in {
localWebApps = {
openwebui = rec {
name = "Ollama (OpenWebUI)";
genericName = "Ollama";
icon = ./icons/openwebui.png;
id = 6;
port = 3021;
service = let
docker = getExe pkgs.docker;
in {
Type = "exec";
ExecStartPre = "${writeShellScript "openwebui-check" ''
set -euo pipefail
echo Checking for container existence..
if [[ $(${docker} inspect openwebui &> /dev/null; printf $?) -ne 0 ]]; then
echo Not found. Creating OpenWebUI/Ollama container..
${docker} create -e PORT=${toString port} --network host --gpus all -v ollama:/root/.ollama -v open-webui:/app/backend/data --name openwebui --restart always ghcr.io/open-webui/open-webui:ollama
fi
echo Check complete.
''}";
ExecStart = "${docker} start -a openwebui";
ExecStop = "${docker} stop openwebui";
};
};
};
}

View file

@ -0,0 +1,23 @@
{
lib,
pkgs,
config,
...
}: let
inherit (lib) getExe;
inherit (config.home) homeDirectory;
in {
localWebApps = {
stable-diffusion = {
name = "Stable Diffusion (ComfyUI)";
genericName = "Stable Diffusion";
icon = ./icons/comfyui.png;
id = 5;
port = 7860;
service = {
WorkingDirectory = "${homeDirectory}/code/etc/stable-diffusion-webui-docker";
ExecStart = "${getExe pkgs.docker} compose --profile comfy up --build";
};
};
};
}

30
home/programs/theming.nix Normal file
View file

@ -0,0 +1,30 @@
{pkgs, ...}: {
home.packages = with pkgs; [
gtk-engine-murrine
];
fonts.fontconfig.enable = true;
qt = {
enable = true;
style.name = "adwaita-dark";
platformTheme.name = "adwaita";
};
gtk = with pkgs;
with rice; {
enable = true;
# theme = with gtk-theme; {
# inherit package name;
# };
theme = {
name = "adw-gtk3-dark";
package = adw-gtk3; # cosmic
};
iconTheme = with icons; {
inherit package name;
};
font = with fonts.sans; {
inherit name size package;
};
};
}

26
home/programs/vscode.nix Normal file
View file

@ -0,0 +1,26 @@
{pkgs, ...}: {
programs.vscode = {
enable = true;
extensions = with pkgs.vscode-extensions; [
rust-lang.rust-analyzer
serayuzgur.crates
jnoortheen.nix-ide
arrterian.nix-env-selector
mkhl.direnv
# silverquark.dancehelix
# gregoire.dance
];
mutableExtensionsDir = true;
userSettings = {
"window.titleBarStyle" = "custom";
"editor.fontFamily" = "${pkgs.rice.fonts.monospace.name}";
"editor.fontSize" = 12;
"workbench.colorTheme" = "KanagawaTheme";
"rust-analyzer.check.overrideCommand" = "clippy";
"rust-analyzer.debug.engine" = "vadimcn.vscode-lldb";
"rust-analyzer.inlayHints.chainingHints.enable" = false;
"rust-analyzer.inlayHints.parameterHints.enable" = false;
"rust-analyzer.inlayHints.typeHints.enable" = false;
};
};
}

35
home/programs/webapps.nix Normal file
View file

@ -0,0 +1,35 @@
{config, ...}: {
imports = [
../util/firefox-webapp.nix
];
programs.firefox.webapps = {
"Microsoft-Teams" = {
url = "https://teams.microsoft.com";
id = 1;
extraSettings = config.programs.firefox.profiles.default.settings;
name = "Microsoft Teams";
icon = ./icons/ms_teams.png;
};
"Facebook-Messenger" = {
url = "https://www.messenger.com";
id = 2;
extraSettings = config.programs.firefox.profiles.default.settings;
name = "Facebook Messenger";
icon = ./icons/fb_msg.png;
};
"Syncthing" = {
url = "http://127.0.0.1:8384";
id = 3;
extraSettings = config.programs.firefox.profiles.default.settings;
name = "Syncthing";
icon = ./icons/syncthing.png;
};
"StudyTAFE" = {
url = "https://www.studytafensw.edu.au";
id = 4;
extraSettings = config.programs.firefox.profiles.default.settings;
name = "TAFE Study";
icon = ./icons/tafe.jpg;
};
};
}

View file

@ -7,7 +7,7 @@
palette-hex = pkgs.lib.nix-rice.palette.toRgbHex pkgs.rice.palette;
palette-shex = pkgs.lib.nix-rice.palette.toRGBShortHex pkgs.rice.palette;
in {
config.programs.wlogout = {
programs.wlogout = {
enable = true;
layout = builtins.fromJSON (builtins.readFile ../dots/wlogout/layout);
style = with palette-hex; (builtins.replaceStrings

View file

@ -0,0 +1,41 @@
{
pkgs,
lib,
config,
...
}: let
inherit (lib) getExe;
inherit (config.home) homeDirectory;
palette-hex = pkgs.lib.nix-rice.palette.toRgbHex pkgs.rice.palette;
in {
ezOneShots = with pkgs; {
xrdb = "${getExe xorg.xrdb} -load ${homeDirectory}/.Xresources";
};
home.packages = with pkgs; [
xorg.xrdb
culr
];
xresources.properties = with palette-hex; {
"*.foreground" = util.fg;
"*.background" = util.bg;
"*.cursorColor" = util.cursor;
"*.selection_foreground" = util.fg_sel;
"*.selection_background" = util.bg_sel;
"*.color0" = normal.black;
"*.color1" = normal.red;
"*.color2" = normal.green;
"*.color3" = normal.yellow;
"*.color4" = normal.blue;
"*.color5" = normal.magenta;
"*.color6" = normal.cyan;
"*.color7" = normal.white;
"*.color8" = bright.black;
"*.color9" = bright.red;
"*.color10" = bright.green;
"*.color11" = bright.yellow;
"*.color12" = bright.blue;
"*.color13" = bright.magenta;
"*.color14" = bright.cyan;
"*.color15" = bright.white;
};
}