Compare commits

...

4 Commits

Author SHA1 Message Date
a79c2c2489 feat: matugen stuff 2024-04-24 20:46:49 +02:00
c5629f1aa0 feat: better xdg compliance 2024-04-24 16:24:15 +02:00
5196b2bab7 feat: cleanup 2024-04-24 16:05:34 +02:00
101b89f378 feat: test stuff 2024-04-24 11:23:26 +02:00
12 changed files with 241 additions and 42 deletions

35
flake.lock generated
View File

@@ -135,7 +135,7 @@
},
"flake-utils": {
"inputs": {
"systems": "systems_2"
"systems": "systems_3"
},
"locked": {
"lastModified": 1701680307,
@@ -153,7 +153,7 @@
},
"flake-utils_2": {
"inputs": {
"systems": "systems_3"
"systems": "systems_4"
},
"locked": {
"lastModified": 1710146030,
@@ -337,18 +337,20 @@
},
"matugen": {
"inputs": {
"nixpkgs": "nixpkgs_3"
"nixpkgs": "nixpkgs_3",
"systems": "systems_2"
},
"locked": {
"lastModified": 1711657889,
"narHash": "sha256-4VX7Rt+ftEH8nwg59eT7TsvHYUf8/euUmwh/JLc4rLc=",
"owner": "InioX",
"lastModified": 1713978374,
"narHash": "sha256-6hsDcW5Ke1429SFjRgDNhmaOhdxDLteMeHXdz0Petqo=",
"owner": "Theaninova",
"repo": "matugen",
"rev": "566277529dadc2b149a8bd8b9859ea791ecdef26",
"rev": "c50741a6432ac5ed1719737fc96051d2da878057",
"type": "github"
},
"original": {
"owner": "InioX",
"owner": "Theaninova",
"ref": "custom-color-support",
"repo": "matugen",
"type": "github"
}
@@ -535,6 +537,21 @@
}
},
"systems_2": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"owner": "nix-systems",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default-linux",
"type": "github"
}
},
"systems_3": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
@@ -549,7 +566,7 @@
"type": "github"
}
},
"systems_3": {
"systems_4": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",

View File

@@ -6,7 +6,7 @@
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
matugen.url = "github:InioX/matugen";
matugen.url = "github:Theaninova/matugen/custom-color-support";
ags.url = "github:Aylur/ags";
nixvim = {
url = "github:nix-community/nixvim";

View File

@@ -36,6 +36,8 @@
supportedFilesystems = [ "ntfs" ];
};
xdg.forced-compliance.enable = true;
usecases = {
gaming.enable = true;
"3d-printing".enable = true;
@@ -47,6 +49,7 @@
};
};
theming.matugen.enable = true;
desktops = {
hyprland.enable = true;
# gamescope.enable = true;

View File

@@ -1,29 +0,0 @@
{ config, ... }:
{
xdg.enable = true;
xdg.userDirs.enable = true;
home.sessionVariables = {
HISTFILE = "${config.xdg.stateHome}/bash/history";
NPM_CONFIG_USERCONFIG = "${config.xdg.configHome}/npm/config";
NPM_CONFIG_CACHE = "${config.xdg.cacheHome}/npm";
NPM_CONFIG_TMP = "${config.xdg.stateHome}/npm";
WINEPREFIX = "${config.xdg.configHome}/wineprefixes/default";
_JAVA_OPTGRADLE_USER_HOMEIONS = ''-Djava.util.prefs.userRoot="${config.xdg.configHome}"/java'';
GRADLE_USER_HOME = "${config.xdg.configHome}/gradle";
DVDCSS_CACHE = "${config.xdg.cacheHome}/dvdcss";
DOCKER_CONFIG = "${config.xdg.configHome}/docker";
PYTHON_HISTORY = "${config.xdg.stateHome}/python/history";
PYTHONCACHEPREFIX = "${config.xdg.cacheHome}/python";
PYTHONUSERBASE = "${config.xdg.dataHome}/python";
WGETRC = "${config.xdg.configHome}/wgetrc";
XCOMPOSEFILE = "${config.xdg.configHome}/X11/xcompose";
XCOMPOSECACHE = "${config.xdg.cacheHome}/X11/xcompose";
};
gtk.gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
programs.gpg.homedir = "${config.xdg.configHome}/gnupg";
programs.zsh.dotDir = ".config/zsh";
programs.zsh.history.path = "${config.xdg.stateHome}/zsh/history";
xdg.configFile.wgetrc.text = ''
hsts-file="${config.xdg.cacheHome}/wget-hsts"
'';
}

View File

@@ -15,7 +15,6 @@
inputs.nixvim.homeManagerModules.nixvim
inputs.anyrun.homeManagerModules.default
./shell/asztal.nix
./clean-home-dir.nix
./programs/neovide.nix
# ./default-apps.nix
./packages

View File

@@ -6,8 +6,6 @@
symbol_map U+23FB-U+23FE,U+2665,U+26A1,U+2B58,U+E000-U+E00A,U+E0A0-U+E0A3,U+E0B0-U+E0D4,U+E200-U+E2A9,U+E300-U+E3E3,U+E5FA-U+E6AA,U+E700-U+E7C5,U+EA60-U+EBEB,U+F000-U+F2E0,U+F300-U+F32F,U+F400-U+F4A9,U+F500-U+F8FF,U+F0001-U+F1AF0 Symbols Nerd Font Mono
font_size 13
include ./current-theme.conf
'';
settings = {
background_opacity = "0.8";

View File

@@ -7,6 +7,8 @@
lorri
vulnix
matugen # TODO
# browsers
chromium
brave

View File

@@ -22,10 +22,14 @@
./locales/theaninova.nix
./theming/matugen.nix
./usecases/gaming.nix
./usecases/3d-printing.nix
./usecases/development.nix
./services/airprint.nix
./xdg/forced-compliance.nix
];
}

View File

@@ -0,0 +1,28 @@
background {{colors.surface.default.hex}}
foreground {{colors.on_surface.default.hex}}
selection_background {{colors.primary.default.hex}}
selection_foreground {{colors.on_primary.default.hex}}
url_color {{colors.tertiary.default.hex}}
cursor {{colors.on_surface.default.hex}}
# normal
color0 {{colors.surface.default.hex}}
color1 {{colors.red.default.hex}}
color2 {{colors.green.default.hex}}
color3 {{colors.yellow.default.hex}}
color4 {{colors.blue.default.hex}}
color5 {{colors.magenta.default.hex}}
color6 {{colors.cyan.default.hex}}
color7 {{colors.on_surface.default.hex}}
# bright
color8 {{colors.outline_variant.default.hex}}
color9 {{colors.red.default.hex}}
color10 {{colors.green.default.hex}}
color11 {{colors.yellow.default.hex}}
color12 {{colors.blue.default.hex}}
color13 {{colors.magenta.default.hex}}
color14 {{colors.cyan.default.hex}}
color15 {{colors.on_surface_variant.default.hex}}

View File

@@ -0,0 +1,62 @@
{
pkgs,
lib,
config,
username,
...
}:
with lib;
let
cfg = config.theming.matugen;
homeCfg = config.home-manager.users.${username};
in
{
options.theming.matugen = {
enable = mkEnableOption "Enable dynamic theming through matugen";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
matugen
swww
];
home-manager.users.${username} = {
programs.kitty.extraConfig = ''
include ${homeCfg.xdg.configHome}/kitty/theme.conf
'';
xdg.configFile."matugen/config.toml".source = (pkgs.formats.toml { }).generate "matugen" {
config = {
reload_apps = true;
reload_apps_list = {
kitty = true;
gtk_theme = false;
waybar = false;
dunst = false;
};
set_wallpaper = true;
wallpaper_tool = "Swww";
custom_colors = {
red = "#ff0000";
green = "#00ff00";
yellow = "#ffff00";
blue = "#0000ff";
magenta = "#ff00ff";
cyan = "#00ffff";
};
};
templates = {
kitty = {
input_path = ./kitty.conf;
output_path = "${homeCfg.xdg.configHome}/kitty/theme.conf";
};
};
};
};
};
}

View File

@@ -0,0 +1,111 @@
{
config,
lib,
username,
...
}:
let
cfg = config.xdg.forced-compliance;
itgr = cfg.integrations;
homeConfig = config.home-manager.users.${username};
xdgConfig = homeConfig.xdg;
mkIntegrationOption =
name:
lib.mkOption {
default = true;
example = false;
description = "Whether to enable ${name} integration.";
type = lib.types.bool;
};
in
{
options.xdg.forced-compliance = {
enable = lib.mkEnableOption ''
a best-effort attempt to get everything to comply with the xdg spec.
Has a chance of breaking some programs with hard-coded paths
'';
integrations = {
android = mkIntegrationOption "android";
bash = mkIntegrationOption "bash";
cargo = mkIntegrationOption "cargo";
cuda = mkIntegrationOption "cuda";
docker = mkIntegrationOption "docker";
dvdcss = mkIntegrationOption "dvdcss";
gpg = mkIntegrationOption "gpg";
gradle = mkIntegrationOption "gradle";
gtk2 = mkIntegrationOption "gtk2";
home-cursor = mkIntegrationOption "home-cursor";
ionic-cli = mkIntegrationOption "ionic-cli";
java = mkIntegrationOption "java"; # some apps just won't respect this
# TODO: `.mozilla` (unsupported)
nix = mkIntegrationOption "nix";
npm = mkIntegrationOption "npm";
# TODO: `.pki`
# Technically this is supporte out of the box, but some programs just
# create it out of nowhere https://bugzilla.mozilla.org/show_bug.cgi?id=818686#c11
python = mkIntegrationOption "python";
# TODO: `.ssh` (unsupported)
# TODO: `steam` (unsupported)
wget = mkIntegrationOption "wget";
wine = mkIntegrationOption "wine";
xcompose = mkIntegrationOption "xcompose";
zsh = mkIntegrationOption "zsh";
};
};
config = lib.mkIf cfg.enable {
nix.extraOptions = ''
use-xdg-base-directories = true
'';
environment.etc."zshenv".text = lib.mkIf itgr.zsh ''
source ${xdgConfig.configHome}/zsh/.zshenv
'';
home-manager.users.${username} = {
xdg = {
enable = true;
userDirs.enable = true;
configFile.wgetrc.text = lib.mkIf itgr.wget ''
hsts-file="${xdgConfig.cacheHome}/wget-hsts"
'';
};
home.sessionVariables = {
_JAVA_OPTGRADLE_USER_HOMEIONS = lib.mkIf itgr.java ''-Djava.util.prefs.userRoot="${xdgConfig.configHome}"/java'';
ANDROID_USER_HOME = lib.mkIf itgr.android "${xdgConfig.dataHome}/android";
CARGO_HOME = lib.mkIf itgr.cargo "${xdgConfig.dataHome}/cargo";
CUDA_CACHE_PATH = lib.mkIf itgr.cuda "${xdgConfig.cacheHome}/cuda";
DOCKER_CONFIG = lib.mkIf itgr.docker "${xdgConfig.configHome}/docker";
DVDCSS_CACHE = lib.mkIf itgr.dvdcss "${xdgConfig.cacheHome}/dvdcss";
GRADLE_USER_HOME = lib.mkIf itgr.gradle "${xdgConfig.configHome}/gradle";
NPM_CONFIG_CACHE = lib.mkIf itgr.npm "${xdgConfig.cacheHome}/npm";
NPM_CONFIG_TMP = lib.mkIf itgr.npm "${xdgConfig.stateHome}/npm";
NPM_CONFIG_USERCONFIG = lib.mkIf itgr.npm "${xdgConfig.configHome}/npm/config";
PYTHON_HISTORY = lib.mkIf itgr.python "${xdgConfig.stateHome}/python/history";
PYTHONCACHEPREFIX = lib.mkIf itgr.python "${xdgConfig.cacheHome}/python";
PYTHONUSERBASE = lib.mkIf itgr.python "${xdgConfig.dataHome}/python";
WGETRC = lib.mkIf itgr.wget "${xdgConfig.configHome}/wgetrc";
WINEPREFIX = lib.mkIf itgr.wine "${xdgConfig.dataHome}/wine";
XCOMPOSECACHE = lib.mkIf itgr.xcompose "${xdgConfig.cacheHome}/X11/xcompose";
XCOMPOSEFILE = lib.mkIf itgr.xcompose "${xdgConfig.configHome}/X11/xcompose";
};
home.file = {
".zshenv".enable = lib.mkIf itgr.zsh false;
# This might break some stuff, see
# https://github.com/nix-community/home-manager/blob/bfa7c06436771e3a0c666ccc6ee01e815d4c33aa/modules/config/home-cursor.nix#L152
".icons/default/index.theme".enable = lib.mkIf itgr.home-cursor false;
".icons/${homeConfig.home.pointerCursor.name}".enable = lib.mkIf itgr.home-cursor false;
};
gtk.gtk2.configLocation = lib.mkIf itgr.gtk2 "${xdgConfig.configHome}/gtk-2.0/gtkrc";
programs = {
gpg.homedir = lib.mkIf itgr.gpg "${xdgConfig.configHome}/gnupg";
bash.historyFile = lib.mkIf itgr.bash "${xdgConfig.stateHome}/bash/history";
zsh = lib.mkIf itgr.zsh {
dotDir = ".config/zsh";
history.path = "${xdgConfig.stateHome}/zsh/history";
};
};
};
};
}

View File

@@ -0,0 +1,4 @@
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
buildInputs = with pkgs; [ nodejs_18 nodePackages.pnpm ];
}