Add custom impermanence module
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
{
|
||||
username ? throw "username argument is required",
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{
|
||||
config,
|
||||
@@ -9,16 +10,15 @@
|
||||
...
|
||||
}:
|
||||
let
|
||||
hmConfig = config.home-manager.users.${username};
|
||||
agsConfig = import ./config { inherit pkgs; };
|
||||
in
|
||||
{
|
||||
home-manager.users.${username} = {
|
||||
home-manager.users.${user} = {
|
||||
imports = [ inputs.ags.homeManagerModules.default ];
|
||||
|
||||
programs.ags.enable = true;
|
||||
xdg.configFile."ags/config.js".source = "${agsConfig}/share/config.js";
|
||||
theme.templates."${hmConfig.xdg.configHome}/ags/theme.sass".source = ./theme.sass;
|
||||
theme.templates."${home}/.config/ags/theme.sass".source = ./theme.sass;
|
||||
|
||||
systemd.user = {
|
||||
targets.tray.Unit = {
|
||||
|
@@ -1,5 +1,6 @@
|
||||
{
|
||||
username ? throw "username argument is required",
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{
|
||||
config,
|
||||
@@ -10,7 +11,7 @@
|
||||
{
|
||||
services.blueman.enable = true;
|
||||
|
||||
home-manager.users.${username} = {
|
||||
home-manager.users.${user} = {
|
||||
services.blueman-applet.enable = true;
|
||||
systemd.user.services.blueman-applet.Unit.After = [ "graphical-session.target" ];
|
||||
};
|
||||
|
@@ -1,14 +1,15 @@
|
||||
{
|
||||
username ? throw "username argument is required",
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{ lib, pkgs, ... }:
|
||||
{
|
||||
users.users.${username}.extraGroups = [
|
||||
users.users.${user}.extraGroups = [
|
||||
"video"
|
||||
"inputs"
|
||||
];
|
||||
|
||||
home-manager.users.${username}.wayland.windowManager.hyprland.settings.bindle =
|
||||
home-manager.users.${user}.wayland.windowManager.hyprland.settings.bindle =
|
||||
let
|
||||
brightnessctl = lib.meta.getExe pkgs.brightnessctl;
|
||||
in
|
||||
|
@@ -1,5 +1,6 @@
|
||||
{
|
||||
username ? throw "username argument is required",
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{
|
||||
config,
|
||||
@@ -7,15 +8,12 @@
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
hmConfig = config.home-manager.users.${username};
|
||||
in
|
||||
{
|
||||
home-manager.users.${username} = {
|
||||
home-manager.users.${user} = {
|
||||
programs.btop.settings.color_theme = "matugen";
|
||||
|
||||
theme = {
|
||||
templates."${hmConfig.xdg.configHome}/btop/themes/matugen.theme".source = ./theme.theme;
|
||||
templates."${home}/.config/btop/themes/matugen.theme".source = ./theme.theme;
|
||||
|
||||
extraConfig = "${
|
||||
lib.meta.getExe (
|
||||
|
@@ -1,5 +1,6 @@
|
||||
{
|
||||
username ? throw "username argument is required",
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{
|
||||
config,
|
||||
@@ -8,7 +9,7 @@
|
||||
...
|
||||
}:
|
||||
{
|
||||
home-manager.users.${username} = {
|
||||
home-manager.users.${user} = {
|
||||
services.cbatticon = {
|
||||
enable = true;
|
||||
lowLevelPercent = 20;
|
||||
|
@@ -1,10 +1,8 @@
|
||||
{
|
||||
username ? throw "username argument is required",
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{ config, ... }:
|
||||
let
|
||||
hmConfig = config.home-manager.users.${username};
|
||||
in
|
||||
{
|
||||
programs.chromium = {
|
||||
enable = true;
|
||||
@@ -22,11 +20,11 @@ in
|
||||
};
|
||||
|
||||
environment.persistence = {
|
||||
"/persist".users.${username}.directories = [ "${hmConfig.xdg.relativeConfigHome}/chromium" ];
|
||||
"/cache".users.${username}.directories = [ "${hmConfig.xdg.relativeCacheHome}/chromium" ];
|
||||
"/persist"."${home}/.config/chromium" = { };
|
||||
"/cache"."${home}/.cache/chromium" = { };
|
||||
};
|
||||
|
||||
home-manager.users.${username} = {
|
||||
home-manager.users.${user} = {
|
||||
programs.chromium = {
|
||||
enable = true;
|
||||
|
||||
|
@@ -1,5 +1,6 @@
|
||||
{
|
||||
username ? throw "username argument is required",
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{
|
||||
config,
|
||||
@@ -7,15 +8,10 @@
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
hmConfig = config.home-manager.users.${username};
|
||||
in
|
||||
{
|
||||
environment.persistence."/cache".users.${username}.directories = [
|
||||
"${hmConfig.xdg.relativeCacheHome}/cliphist"
|
||||
];
|
||||
environment.persistence."/cache"."${home}/.cache/cliphist" = { };
|
||||
|
||||
home-manager.users.${username} = {
|
||||
home-manager.users.${user} = {
|
||||
home.packages = with pkgs; [
|
||||
wl-clipboard
|
||||
cliphist
|
||||
@@ -26,7 +22,10 @@ in
|
||||
Unit = {
|
||||
Description = "Clipboard manager";
|
||||
BindsTo = [ "graphical-session.target" ];
|
||||
After = [ "graphical-session.target" ];
|
||||
After = [
|
||||
"graphical-session.target"
|
||||
config.environment.persistence."/cache"."${home}/.cache/cliphist".mount
|
||||
];
|
||||
};
|
||||
|
||||
Service.ExecStart = lib.meta.getExe (
|
||||
@@ -47,7 +46,10 @@ in
|
||||
Unit = {
|
||||
Description = "Clipboard manager (images)";
|
||||
BindsTo = [ "graphical-session.target" ];
|
||||
After = [ "graphical-session.target" ];
|
||||
After = [
|
||||
"graphical-session.target"
|
||||
config.environment.persistence."/cache"."${home}/.cache/cliphist".mount
|
||||
];
|
||||
};
|
||||
|
||||
Service.ExecStart = lib.meta.getExe (
|
||||
@@ -72,8 +74,8 @@ in
|
||||
wl-copy = "${pkgs.wl-clipboard}/bin/wl-copy";
|
||||
in
|
||||
[
|
||||
"$mod, v, exec, ${cliphist} list | ${rofi} -cache-dir ${hmConfig.xdg.cacheHome}/rofi -dmenu -display-columns 2 | ${cliphist} decode | ${wl-copy}"
|
||||
"$mod_Ctrl, v, exec, ${cliphist} list | ${rofi} -cache-dir ${hmConfig.xdg.cacheHome}/rofi -dmenu -display-columns 2 | ${cliphist} delete"
|
||||
"$mod, v, exec, ${cliphist} list | ${rofi} -cache-dir ${home}/.cache/rofi -dmenu -display-columns 2 | ${cliphist} decode | ${wl-copy}"
|
||||
"$mod_Ctrl, v, exec, ${cliphist} list | ${rofi} -cache-dir ${home}/.cache/rofi -dmenu -display-columns 2 | ${cliphist} delete"
|
||||
"$mod_Ctrl_Shift, v, exec, ${cliphist} wipe"
|
||||
];
|
||||
};
|
||||
|
@@ -1,5 +1,6 @@
|
||||
{
|
||||
username ? throw "username argument is required",
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{
|
||||
config,
|
||||
@@ -7,16 +8,13 @@
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
hmConfig = config.home-manager.users.${username};
|
||||
in
|
||||
{
|
||||
environment.persistence = {
|
||||
"/persist".users.${username}.directories = [ ".mozilla" ];
|
||||
"/cache".users.${username}.directories = [ "${hmConfig.xdg.relativeCacheHome}/mozilla" ];
|
||||
"/persist"."${home}/.mozilla" = { };
|
||||
"/cache"."${home}/.cache/mozilla" = { };
|
||||
};
|
||||
|
||||
home-manager.users.${username} = {
|
||||
home-manager.users.${user} = {
|
||||
programs.firefox = {
|
||||
enable = true;
|
||||
|
||||
|
@@ -1,5 +1,6 @@
|
||||
{
|
||||
username ? throw "username argument is required",
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{
|
||||
config,
|
||||
@@ -8,10 +9,10 @@
|
||||
...
|
||||
}:
|
||||
let
|
||||
hmConfig = config.home-manager.users.${username};
|
||||
hmConfig = config.home-manager.users.${user};
|
||||
in
|
||||
{
|
||||
home-manager.users.${username} = {
|
||||
home-manager.users.${user} = {
|
||||
gtk = {
|
||||
enable = true;
|
||||
|
||||
@@ -31,7 +32,7 @@ in
|
||||
package = builtins.head hmConfig.theme.icon.packages;
|
||||
};
|
||||
|
||||
gtk2.configLocation = "${hmConfig.xdg.configHome}/gtk-2.0/gtkrc";
|
||||
gtk2.configLocation = "${home}/.config/gtk-2.0/gtkrc";
|
||||
gtk3.extraCss = "@import './theme.css';";
|
||||
gtk4.extraCss = "@import './theme.css';";
|
||||
};
|
||||
@@ -52,8 +53,8 @@ in
|
||||
};
|
||||
|
||||
theme.templates = {
|
||||
"${hmConfig.xdg.configHome}/gtk-3.0/theme.css".source = ./theme.css;
|
||||
"${hmConfig.xdg.configHome}/gtk-4.0/theme.css".source = ./theme.css;
|
||||
"${home}/.config/gtk-3.0/theme.css".source = ./theme.css;
|
||||
"${home}/.config/gtk-4.0/theme.css".source = ./theme.css;
|
||||
};
|
||||
|
||||
theme.extraConfig = "${
|
||||
|
@@ -1,5 +1,6 @@
|
||||
{
|
||||
username ? throw "username argument is required",
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{
|
||||
config,
|
||||
@@ -7,13 +8,10 @@
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
hmConfig = config.home-manager.users.${username};
|
||||
in
|
||||
{
|
||||
programs.hyprland.enable = true;
|
||||
|
||||
home-manager.users.${username} = {
|
||||
home-manager.users.${user} = {
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
@@ -138,7 +136,7 @@ in
|
||||
'';
|
||||
|
||||
theme = {
|
||||
templates."${hmConfig.xdg.configHome}/hypr/theme.conf".source = ./theme.conf;
|
||||
templates."${home}/.config/hypr/theme.conf".source = ./theme.conf;
|
||||
|
||||
extraConfig = "${
|
||||
lib.meta.getExe (
|
||||
|
@@ -1,5 +1,6 @@
|
||||
{
|
||||
username ? throw "username argument is required",
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{
|
||||
config,
|
||||
@@ -7,17 +8,14 @@
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
hmConfig = config.home-manager.users.${username};
|
||||
in
|
||||
{
|
||||
home-manager.users.${username} = {
|
||||
home-manager.users.${user} = {
|
||||
home = {
|
||||
packages = with pkgs; [
|
||||
hyprshot
|
||||
swappy
|
||||
];
|
||||
sessionVariables.HYPRSHOT_DIR = "${hmConfig.xdg.userDirs.pictures}/screenshots";
|
||||
sessionVariables.HYPRSHOT_DIR = "Pictures/screenshots";
|
||||
};
|
||||
|
||||
wayland.windowManager.hyprland.settings.bind =
|
||||
|
@@ -1,5 +1,6 @@
|
||||
{
|
||||
username ? throw "username argument is required",
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{
|
||||
config,
|
||||
@@ -8,14 +9,12 @@
|
||||
...
|
||||
}:
|
||||
let
|
||||
hmConfig = config.home-manager.users.${username};
|
||||
hmConfig = config.home-manager.users.${user};
|
||||
in
|
||||
{
|
||||
environment.persistence."/cache".users.${username}.directories = [
|
||||
"${hmConfig.xdg.relativeCacheHome}/kitty"
|
||||
];
|
||||
environment.persistence."/cache"."${home}/.cache/kitty" = { };
|
||||
|
||||
home-manager.users.${username} = {
|
||||
home-manager.users.${user} = {
|
||||
programs.kitty = {
|
||||
enable = true;
|
||||
|
||||
@@ -32,7 +31,7 @@ in
|
||||
};
|
||||
|
||||
theme = {
|
||||
templates."${hmConfig.xdg.configHome}/kitty/theme.conf".source = ./theme.conf;
|
||||
templates."${home}/.config/kitty/theme.conf".source = ./theme.conf;
|
||||
|
||||
extraConfig = "${
|
||||
lib.meta.getExe (
|
||||
|
@@ -1,5 +1,6 @@
|
||||
{
|
||||
username ? throw "username argument is required",
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{
|
||||
config,
|
||||
@@ -7,20 +8,13 @@
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
hmConfig = config.home-manager.users.${username};
|
||||
in
|
||||
{
|
||||
environment.persistence = {
|
||||
"/persist".users.${username}.directories = [
|
||||
"${hmConfig.xdg.relativeConfigHome}/libreoffice/4/user"
|
||||
];
|
||||
"/cache".users.${username}.directories = [
|
||||
"${hmConfig.xdg.relativeConfigHome}/libreoffice/4/cache"
|
||||
];
|
||||
"/persist"."${home}/.config/libreoffice/4/user" = { };
|
||||
"/cache"."${home}/.config/libreoffice/4/cache" = { };
|
||||
};
|
||||
|
||||
home-manager.users.${username} = {
|
||||
home-manager.users.${user} = {
|
||||
home.packages = with pkgs; [
|
||||
libreoffice-fresh
|
||||
hunspell
|
||||
|
@@ -1,9 +1,10 @@
|
||||
{
|
||||
username ? throw "username argument is required",
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{ ... }:
|
||||
{
|
||||
home-manager.users.${username} = {
|
||||
home-manager.users.${user} = {
|
||||
services.network-manager-applet.enable = true;
|
||||
systemd.user.services.network-manager-applet.Unit.After = [ "graphical-session.target" ];
|
||||
};
|
||||
|
@@ -1,5 +1,6 @@
|
||||
{
|
||||
username ? throw "username argument is required",
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{
|
||||
config,
|
||||
@@ -8,14 +9,12 @@
|
||||
...
|
||||
}:
|
||||
let
|
||||
hmConfig = config.home-manager.users.${username};
|
||||
hmConfig = config.home-manager.users.${user};
|
||||
in
|
||||
{
|
||||
environment.persistence."/cache".users.${username}.directories = [
|
||||
"${hmConfig.xdg.relativeConfigHome}/obsidian"
|
||||
];
|
||||
environment.persistence."/cache"."${home}/.config/obsidian" = { };
|
||||
|
||||
home-manager.users.${username} = {
|
||||
home-manager.users.${user} = {
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
programs.obsidian = {
|
||||
|
@@ -45,40 +45,6 @@ in
|
||||
with lib;
|
||||
with types;
|
||||
let
|
||||
checkCssPath = path: lib.filesystem.pathIsRegularFile path && lib.strings.hasSuffix ".css" path;
|
||||
|
||||
cssSnippetsOptions =
|
||||
{ config, ... }:
|
||||
{
|
||||
options = {
|
||||
enable = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Whether to enable the snippet.";
|
||||
};
|
||||
|
||||
name = mkOption {
|
||||
type = str;
|
||||
defaultText = literalExpression "lib.strings.removeSuffix \".css\" (builtins.baseNameOf source)";
|
||||
description = "Name of the snippet.";
|
||||
};
|
||||
|
||||
source = mkOption {
|
||||
type = nullOr (addCheck path checkCssPath);
|
||||
description = "Path of the source file.";
|
||||
default = null;
|
||||
};
|
||||
|
||||
text = mkOption {
|
||||
type = nullOr str;
|
||||
description = "Text of the file.";
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
|
||||
config.name = mkDefault (toCssName config.source);
|
||||
};
|
||||
|
||||
corePluginsOptions =
|
||||
{ config, ... }:
|
||||
{
|
||||
@@ -125,6 +91,40 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
checkCssPath = path: lib.filesystem.pathIsRegularFile path && lib.strings.hasSuffix ".css" path;
|
||||
|
||||
cssSnippetsOptions =
|
||||
{ config, ... }:
|
||||
{
|
||||
options = {
|
||||
enable = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Whether to enable the snippet.";
|
||||
};
|
||||
|
||||
name = mkOption {
|
||||
type = str;
|
||||
defaultText = literalExpression "lib.strings.removeSuffix \".css\" (builtins.baseNameOf source)";
|
||||
description = "Name of the snippet.";
|
||||
};
|
||||
|
||||
source = mkOption {
|
||||
type = nullOr (addCheck path checkCssPath);
|
||||
description = "Path of the source file.";
|
||||
default = null;
|
||||
};
|
||||
|
||||
text = mkOption {
|
||||
type = nullOr str;
|
||||
description = "Text of the file.";
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
|
||||
config.name = mkDefault (toCssName config.source);
|
||||
};
|
||||
|
||||
themesOptions =
|
||||
{ config, ... }:
|
||||
{
|
||||
@@ -292,25 +292,27 @@ in
|
||||
|
||||
corePlugins = mkOption {
|
||||
description = "Core plugins to activate.";
|
||||
type = listOf (either (enum corePlugins) (submodule corePluginsOptions));
|
||||
type = listOf (coercedTo (enum corePlugins) (p: { name = p; }) (submodule corePluginsOptions));
|
||||
default = cfg.sharedSettings.corePlugins;
|
||||
};
|
||||
|
||||
communityPlugins = mkOption {
|
||||
description = "Community plugins to install and activate.";
|
||||
type = listOf (either package (submodule communityPluginsOptions));
|
||||
type = listOf (coercedTo package (p: { pkg = p; }) (submodule communityPluginsOptions));
|
||||
default = cfg.sharedSettings.communityPlugins;
|
||||
};
|
||||
|
||||
cssSnippets = mkOption {
|
||||
description = "CSS snippets to install.";
|
||||
type = listOf (either (addCheck path checkCssPath) (submodule cssSnippetsOptions));
|
||||
type = listOf (
|
||||
coercedTo (addCheck path checkCssPath) (p: { source = p; }) (submodule cssSnippetsOptions)
|
||||
);
|
||||
default = cfg.sharedSettings.cssSnippets;
|
||||
};
|
||||
|
||||
themes = mkOption {
|
||||
description = "Themes to install.";
|
||||
type = listOf (either package (submodule themesOptions));
|
||||
type = listOf (coercedTo package (p: { pkg = p; }) (submodule themesOptions));
|
||||
default = cfg.sharedSettings.themes;
|
||||
};
|
||||
|
||||
@@ -339,15 +341,10 @@ in
|
||||
config =
|
||||
let
|
||||
vaults = builtins.filter (vault: vault.enable == true) (builtins.attrValues cfg.vaults);
|
||||
toName = item: if item ? name then item.name else item;
|
||||
toPkg = item: if item ? pkg then item.pkg else item;
|
||||
isEnabled = item: if item ? enable then item.enable else true;
|
||||
hasOptions = item: item ? options;
|
||||
getCssName = item: if builtins.isAttrs item then item.name else toCssName item;
|
||||
getManifest =
|
||||
item:
|
||||
let
|
||||
manifest = builtins.fromJSON (builtins.readFile "${toPkg item}/manifest.json");
|
||||
manifest = builtins.fromJSON (builtins.readFile "${item.pkg}/manifest.json");
|
||||
in
|
||||
manifest.id or manifest.name;
|
||||
in
|
||||
@@ -366,16 +363,16 @@ in
|
||||
name = "${vault.target}/.obsidian/appearance.json";
|
||||
value =
|
||||
let
|
||||
enabledCssSnippets = builtins.filter isEnabled vault.settings.cssSnippets;
|
||||
activeTheme =
|
||||
lib.lists.findSingle isEnabled null (throw "Only one theme can be enabled at a time.")
|
||||
vault.settings.themes;
|
||||
enabledCssSnippets = builtins.filter (snippet: snippet.enable) vault.settings.cssSnippets;
|
||||
activeTheme = lib.lists.findSingle (
|
||||
theme: theme.enable
|
||||
) null (throw "Only one theme can be enabled at a time.") vault.settings.themes;
|
||||
in
|
||||
{
|
||||
source = (pkgs.formats.json { }).generate "appearance.json" (
|
||||
vault.settings.appearance
|
||||
// {
|
||||
enabledCssSnippets = builtins.map getCssName enabledCssSnippets;
|
||||
enabledCssSnippets = builtins.map (snippet: snippet.name) enabledCssSnippets;
|
||||
}
|
||||
// lib.attrsets.optionalAttrs (activeTheme != null) { cssTheme = getManifest activeTheme; }
|
||||
);
|
||||
@@ -388,7 +385,7 @@ in
|
||||
{
|
||||
name = "${vault.target}/.obsidian/core-plugins.json";
|
||||
value.source = (pkgs.formats.json { }).generate "core-plugins.json" (
|
||||
builtins.map toName vault.settings.corePlugins
|
||||
builtins.map (plugin: plugin.name) vault.settings.corePlugins
|
||||
);
|
||||
}
|
||||
{
|
||||
@@ -397,9 +394,7 @@ in
|
||||
builtins.listToAttrs (
|
||||
builtins.map (name: {
|
||||
inherit name;
|
||||
value = builtins.any (
|
||||
plugin: name == (toName plugin) && isEnabled plugin
|
||||
) vault.settings.corePlugins;
|
||||
value = builtins.any (plugin: name == plugin.name && plugin.enable) vault.settings.corePlugins;
|
||||
}) corePlugins
|
||||
)
|
||||
);
|
||||
@@ -408,7 +403,7 @@ in
|
||||
++ builtins.map (plugin: {
|
||||
name = "${vault.target}/.obsidian/${plugin.name}.json";
|
||||
value.source = (pkgs.formats.json { }).generate "${plugin.name}.json" plugin.options;
|
||||
}) (builtins.filter hasOptions vault.settings.corePlugins);
|
||||
}) (builtins.filter (plugin: plugin.options != { }) vault.settings.corePlugins);
|
||||
|
||||
mkCommunityPlugins =
|
||||
vault:
|
||||
@@ -416,38 +411,35 @@ in
|
||||
{
|
||||
name = "${vault.target}/.obsidian/community-plugins.json";
|
||||
value.source = (pkgs.formats.json { }).generate "community-plugins.json" (
|
||||
builtins.map getManifest (builtins.filter isEnabled vault.settings.communityPlugins)
|
||||
builtins.map getManifest (builtins.filter (plugin: plugin.enable) vault.settings.communityPlugins)
|
||||
);
|
||||
}
|
||||
]
|
||||
++ builtins.map (plugin: {
|
||||
name = "${vault.target}/.obsidian/plugins/${getManifest plugin}";
|
||||
value = {
|
||||
source = toPkg plugin;
|
||||
source = plugin.pkg;
|
||||
recursive = true;
|
||||
};
|
||||
}) vault.settings.communityPlugins
|
||||
++ builtins.map (plugin: {
|
||||
name = "${vault.target}/.obsidian/plugins/${getManifest plugin}/data.json";
|
||||
value.source = (pkgs.formats.json { }).generate "data.json" plugin.options;
|
||||
}) (builtins.filter hasOptions vault.settings.communityPlugins);
|
||||
}) (builtins.filter (plugin: plugin.options != { }) vault.settings.communityPlugins);
|
||||
|
||||
mkCssSnippets =
|
||||
vault:
|
||||
builtins.map (snippet: {
|
||||
name = "${vault.target}/.obsidian/snippets/${getCssName snippet}.css";
|
||||
name = "${vault.target}/.obsidian/snippets/${snippet.name}.css";
|
||||
value =
|
||||
if snippet ? source || snippet ? text then
|
||||
if snippet.source != null then { inherit (snippet) source; } else { inherit (snippet) text; }
|
||||
else
|
||||
{ source = snippet; };
|
||||
if snippet.source != null then { inherit (snippet) source; } else { inherit (snippet) text; };
|
||||
}) vault.settings.cssSnippets;
|
||||
|
||||
mkThemes =
|
||||
vault:
|
||||
builtins.map (theme: {
|
||||
name = "${vault.target}/.obsidian/themes/${getManifest theme}";
|
||||
value.source = toPkg theme;
|
||||
value.source = theme.pkg;
|
||||
}) vault.settings.themes;
|
||||
|
||||
mkHotkeys = vault: {
|
||||
@@ -494,9 +486,7 @@ in
|
||||
{
|
||||
assertion = builtins.all (
|
||||
vault:
|
||||
builtins.all (
|
||||
snippet: (!snippet ? source && !snippet ? text) || (snippet.source == null || snippet.text == null)
|
||||
) vault.settings.cssSnippets
|
||||
builtins.all (snippet: snippet.source == null || snippet.text == null) vault.settings.cssSnippets
|
||||
) (builtins.attrValues cfg.vaults);
|
||||
message = "Only one of `source` and `text` must be set";
|
||||
}
|
||||
|
@@ -1,9 +1,10 @@
|
||||
{
|
||||
username ? throw "username argument is required",
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{ lib, pkgs, ... }:
|
||||
{
|
||||
home-manager.users.${username} = {
|
||||
home-manager.users.${user} = {
|
||||
home.packages = with pkgs; [ pavucontrol ];
|
||||
|
||||
wayland.windowManager.hyprland.settings =
|
||||
|
@@ -1,5 +1,6 @@
|
||||
{
|
||||
username ? throw "username argument is required",
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{
|
||||
lib,
|
||||
@@ -7,9 +8,6 @@
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
hmConfig = config.home-manager.users.${username};
|
||||
in
|
||||
{
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
@@ -19,11 +17,9 @@ in
|
||||
})
|
||||
];
|
||||
|
||||
environment.persistence."/cache".users.${username}.files = [
|
||||
"${hmConfig.xdg.relativeConfigHome}/qalculate/qalculate-gtk.history"
|
||||
];
|
||||
environment.persistence."/cache"."${home}/.config/qalculate/qalculate-gtk.history" = { };
|
||||
|
||||
home-manager.users.${username} = {
|
||||
home-manager.users.${user} = {
|
||||
home.packages = with pkgs; [ qalculate-gtk ];
|
||||
|
||||
xdg.configFile."qalculate/qalculate-gtk.cfg".source =
|
||||
|
@@ -1,5 +1,6 @@
|
||||
{
|
||||
username ? throw "username argument is required",
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{
|
||||
config,
|
||||
@@ -7,11 +8,8 @@
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
hmConfig = config.home-manager.users.${username};
|
||||
in
|
||||
{
|
||||
home-manager.users.${username} = {
|
||||
home-manager.users.${user} = {
|
||||
qt = {
|
||||
enable = true;
|
||||
platformTheme.name = "qtct";
|
||||
@@ -28,9 +26,9 @@ in
|
||||
|
||||
theme.templates = {
|
||||
# https://github.com/GabePoel/KvLibadwaita/blob/main/src/KvLibadwaita/KvLibadwaita.kvconfig
|
||||
"${hmConfig.xdg.configHome}/Kvantum/KvAdwQt/KvAdwQt.kvconfig".source = ./KvAdwQt/KvAdwQt.kvconfig;
|
||||
"${home}/.config/Kvantum/KvAdwQt/KvAdwQt.kvconfig".source = ./KvAdwQt/KvAdwQt.kvconfig;
|
||||
# https://github.com/GabePoel/KvLibadwaita/blob/main/src/KvLibadwaita/KvLibadwaita.svg
|
||||
"${hmConfig.xdg.configHome}/Kvantum/KvAdwQt/KvAdwQt.svg".source = ./KvAdwQt/KvAdwQt.svg;
|
||||
"${home}/.config/Kvantum/KvAdwQt/KvAdwQt.svg".source = ./KvAdwQt/KvAdwQt.svg;
|
||||
};
|
||||
|
||||
xdg.configFile =
|
||||
|
@@ -1,5 +1,6 @@
|
||||
{
|
||||
username ? throw "username argument is required",
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{
|
||||
config,
|
||||
@@ -8,14 +9,12 @@
|
||||
...
|
||||
}:
|
||||
let
|
||||
hmConfig = config.home-manager.users.${username};
|
||||
hmConfig = config.home-manager.users.${user};
|
||||
in
|
||||
{
|
||||
environment.persistence."/cache".users.${username}.directories = [
|
||||
"${hmConfig.xdg.relativeCacheHome}/rofi"
|
||||
];
|
||||
environment.persistence."/cache"."${home}/.cache/rofi" = { };
|
||||
|
||||
home-manager.users.${username} = {
|
||||
home-manager.users.${user} = {
|
||||
programs.rofi = {
|
||||
enable = true;
|
||||
package = pkgs.rofi-wayland;
|
||||
@@ -23,7 +22,7 @@ in
|
||||
};
|
||||
|
||||
wayland.windowManager.hyprland.settings.bind = [
|
||||
"$mod, r, exec, ${lib.meta.getExe pkgs.rofi-wayland} -cache-dir ${hmConfig.xdg.cacheHome}/rofi -show drun"
|
||||
"$mod, r, exec, ${lib.meta.getExe pkgs.rofi-wayland} -cache-dir ${home}/.cache/rofi -show drun"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
@@ -1,5 +1,6 @@
|
||||
{
|
||||
username ? throw "username argument is required",
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{
|
||||
config,
|
||||
@@ -7,9 +8,6 @@
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
hmConfig = config.home-manager.users.${username};
|
||||
in
|
||||
{
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [ 57621 ];
|
||||
@@ -17,11 +15,11 @@ in
|
||||
};
|
||||
|
||||
environment.persistence = {
|
||||
"/persist".users.${username}.directories = [ "${hmConfig.xdg.relativeConfigHome}/spotify" ];
|
||||
"/cache".users.${username}.directories = [ "${hmConfig.xdg.relativeCacheHome}/spotify" ];
|
||||
"/persist"."${home}/.config/spotify" = { };
|
||||
"/cache"."${home}/.cache/spotify" = { };
|
||||
};
|
||||
|
||||
home-manager.users.${username} = {
|
||||
home-manager.users.${user} = {
|
||||
imports = [ inputs.spicetify-nix.homeManagerModules.default ];
|
||||
|
||||
programs.spicetify =
|
||||
@@ -37,7 +35,7 @@ in
|
||||
|
||||
theme = spicePkgs.themes.sleek // {
|
||||
extraCommands = ''
|
||||
export COLORS_CSS_PATH="${hmConfig.xdg.configHome}/spotify/colors.css"
|
||||
export COLORS_CSS_PATH="${home}/.config/spotify/colors.css"
|
||||
'';
|
||||
|
||||
additionalCss = ''
|
||||
@@ -60,6 +58,6 @@ in
|
||||
];
|
||||
};
|
||||
|
||||
theme.templates."${hmConfig.xdg.configHome}/spotify/colors.css".source = ./colors.css;
|
||||
theme.templates."${home}/.config/spotify/colors.css".source = ./colors.css;
|
||||
};
|
||||
}
|
||||
|
@@ -1,14 +1,16 @@
|
||||
{
|
||||
username ? throw "username argument is required",
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
utils,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
hmConfig = config.home-manager.users.${username};
|
||||
hmConfig = config.home-manager.users.${user};
|
||||
themeSwww = lib.meta.getExe (
|
||||
pkgs.writeShellApplication {
|
||||
name = "theme-swww";
|
||||
@@ -21,18 +23,19 @@ let
|
||||
);
|
||||
in
|
||||
{
|
||||
environment.persistence."/cache".users.${username}.directories = [
|
||||
"${hmConfig.xdg.relativeCacheHome}/swww"
|
||||
];
|
||||
environment.persistence."/cache"."${home}/.cache/swww" = { };
|
||||
|
||||
home-manager.users.${username} = {
|
||||
home-manager.users.${user} = {
|
||||
home.packages = with pkgs; [ swww ];
|
||||
|
||||
systemd.user.services.swww = {
|
||||
Unit = {
|
||||
Description = "Wallpaper daemon";
|
||||
BindsTo = [ "graphical-session.target" ];
|
||||
After = [ "graphical-session.target" ];
|
||||
After = [
|
||||
"graphical-session.target"
|
||||
config.environment.persistence."/cache"."${home}/.cache/swww".mount
|
||||
];
|
||||
};
|
||||
|
||||
Service = {
|
||||
|
@@ -1,5 +1,6 @@
|
||||
{
|
||||
username ? throw "username argument is required",
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{
|
||||
config,
|
||||
@@ -9,15 +10,13 @@
|
||||
...
|
||||
}:
|
||||
let
|
||||
hmConfig = config.home-manager.users.${username};
|
||||
hmConfig = config.home-manager.users.${user};
|
||||
themeBin = lib.meta.getExe hmConfig.theme.pkg;
|
||||
in
|
||||
{
|
||||
environment.persistence."/persist".users.${username}.directories = [
|
||||
"${hmConfig.xdg.relativeConfigHome}/theme"
|
||||
];
|
||||
environment.persistence."/persist"."${home}/.config/theme" = { };
|
||||
|
||||
home-manager.users.${username} = {
|
||||
home-manager.users.${user} = {
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
theme.enable = true;
|
||||
|
@@ -1,5 +1,6 @@
|
||||
{
|
||||
username ? throw "username argument is required",
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{
|
||||
config,
|
||||
@@ -8,28 +9,28 @@
|
||||
...
|
||||
}:
|
||||
let
|
||||
hmConfig = config.home-manager.users.${username};
|
||||
hmConfig = config.home-manager.users.${user};
|
||||
in
|
||||
{
|
||||
environment.persistence = {
|
||||
"/persist".users.${username}.directories = [ "${hmConfig.xdg.relativeConfigHome}/Code" ];
|
||||
"/persist"."${home}/.config/Code" = { };
|
||||
# Bastard: https://github.com/microsoft/vscode/issues/3884
|
||||
"/cache".users.${username}.directories = [
|
||||
"${hmConfig.xdg.relativeConfigHome}/Code/Cache"
|
||||
"${hmConfig.xdg.relativeConfigHome}/Code/CachedConfigurations"
|
||||
"${hmConfig.xdg.relativeConfigHome}/Code/CachedData"
|
||||
"${hmConfig.xdg.relativeConfigHome}/Code/CachedExtensionVSIXs"
|
||||
"${hmConfig.xdg.relativeConfigHome}/Code/CachedExtensions"
|
||||
"${hmConfig.xdg.relativeConfigHome}/Code/CachedProfilesData"
|
||||
"${hmConfig.xdg.relativeConfigHome}/Code/Code Cache"
|
||||
"${hmConfig.xdg.relativeConfigHome}/Code/DawnCache"
|
||||
"${hmConfig.xdg.relativeConfigHome}/Code/GPUCache"
|
||||
"${hmConfig.xdg.relativeConfigHome}/Code/Service Worker/CacheStorage"
|
||||
"${hmConfig.xdg.relativeConfigHome}/Code/Service Worker/ScriptCache"
|
||||
];
|
||||
"/cache" = {
|
||||
"${home}/.config/Code/Cache" = { };
|
||||
"${home}/.config/Code/CachedConfigurations" = { };
|
||||
"${home}/.config/Code/CachedData" = { };
|
||||
"${home}/.config/Code/CachedExtensionVSIXs" = { };
|
||||
"${home}/.config/Code/CachedExtensions" = { };
|
||||
"${home}/.config/Code/CachedProfilesData" = { };
|
||||
"${home}/.config/Code/Code Cache" = { };
|
||||
"${home}/.config/Code/DawnCache" = { };
|
||||
"${home}/.config/Code/GPUCache" = { };
|
||||
"${home}/.config/Code/Service Worker/CacheStorage" = { };
|
||||
"${home}/.config/Code/Service Worker/ScriptCache" = { };
|
||||
};
|
||||
};
|
||||
|
||||
home-manager.users.${username} = {
|
||||
home-manager.users.${user} = {
|
||||
programs.vscode = {
|
||||
enable = true;
|
||||
|
||||
|
@@ -1,7 +1,8 @@
|
||||
{
|
||||
username ? throw "username argument is required",
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home-manager.users.${username}.home.packages = with pkgs; [ wev ];
|
||||
home-manager.users.${user}.home.packages = with pkgs; [ wev ];
|
||||
}
|
||||
|
@@ -1,13 +1,11 @@
|
||||
{
|
||||
username ? throw "username argument is required",
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{ config, ... }:
|
||||
let
|
||||
hmConfig = config.home-manager.users.${username};
|
||||
in
|
||||
{
|
||||
home-manager.users.${username} = {
|
||||
home-manager.users.${user} = {
|
||||
home.pointerCursor.x11.enable = true;
|
||||
xresources.path = "${hmConfig.xdg.configHome}/X11/xresources";
|
||||
xresources.path = "${home}/.config/X11/xresources";
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user