refactor(modules): rewrite some modules; add dconf
This commit is contained in:
parent
14c7e10e8b
commit
7938019d55
15 changed files with 131 additions and 59 deletions
|
@ -1,5 +1,5 @@
|
|||
{pkgs, ...}: {
|
||||
alqueva.fonts = {
|
||||
alqueva.system.fonts = {
|
||||
enable = true;
|
||||
names = {
|
||||
sansSerif = ["Liberation Sans"];
|
||||
|
|
|
@ -18,16 +18,18 @@
|
|||
};
|
||||
|
||||
alqueva = {
|
||||
xonsh = {
|
||||
enable = true;
|
||||
package = pkgs.amadaluzian-xonsh;
|
||||
};
|
||||
programs = {
|
||||
libvirt.enable = true;
|
||||
direnv.enable = true;
|
||||
git.enable = true;
|
||||
pipewire.enable = true;
|
||||
openssh.enable = true;
|
||||
river.enable = true;
|
||||
};
|
||||
shells.xonsh = {
|
||||
enable = true;
|
||||
package = pkgs.amadaluzian-xonsh;
|
||||
};
|
||||
system.pipewire.enable = true;
|
||||
wms.river.enable = true;
|
||||
};
|
||||
|
||||
xdg.mime = {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{pkgs, ...}: {
|
||||
alqueva.fonts = {
|
||||
alqueva.system.fonts = {
|
||||
names = {
|
||||
sansSerif = ["Fira Sans"];
|
||||
monospace = ["Fira Mono"];
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
{pkgs, ...}: let
|
||||
themes = {
|
||||
gtk-theme = pkgs.nightfox-gtk-theme.override {
|
||||
colorVariants = ["dark"];
|
||||
|
@ -14,22 +10,16 @@
|
|||
cursor-theme = pkgs.simp1e-cursors;
|
||||
};
|
||||
in {
|
||||
programs.dconf = {
|
||||
alqueva.system.dconf = {
|
||||
enable = true;
|
||||
profiles.user.databases = [
|
||||
{
|
||||
settings = {
|
||||
"org/gnome/desktop/interface" = {
|
||||
color-scheme = "prefer-dark";
|
||||
cursor-size = lib.gvariant.mkUint32 24;
|
||||
cursor-theme = "Simp1e-Adw-Dark";
|
||||
icon-theme = "Colloid-Dark";
|
||||
gtk-theme = "Nightfox-Purple-Dark-Compact-Carbon";
|
||||
luminosity = "dark";
|
||||
theme = "Nightfox-Purple-Dark-Compact-Carbon";
|
||||
icon.theme = "Colloid-Dark";
|
||||
cursor = {
|
||||
size = 24;
|
||||
theme = "Simp1e-Adw-Dark";
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
qt = {
|
||||
enable = true;
|
||||
|
|
|
@ -1,10 +1,20 @@
|
|||
{pkgs, ...}: let
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
ezaOptions = "--colour=always --icons=never --group-directories-first --octal-permissions";
|
||||
cfg = config.alqueva.shells.aliases;
|
||||
in {
|
||||
config = {
|
||||
options.alqueva.shells.aliases = {
|
||||
enable = (lib.mkEnableOption "default aliases") // {default = true;};
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment = {
|
||||
shellAliases = builtins.mapAttrs (_: v: "${v} ${ezaOptions}") {
|
||||
l = "eza -alh";
|
||||
la = "eza -ah";
|
||||
ls = "eza";
|
||||
ll = "eza -l";
|
||||
};
|
||||
|
|
71
hosts/shared/dconf.nix
Normal file
71
hosts/shared/dconf.nix
Normal file
|
@ -0,0 +1,71 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.alqueva.system.dconf;
|
||||
inherit (lib) types;
|
||||
in {
|
||||
options.alqueva.system.dconf = {
|
||||
enable = lib.mkEnableOption "configuration with DConf";
|
||||
luminosity = lib.mkOption {
|
||||
type = types.enum ["dark" "light"];
|
||||
default = "dark";
|
||||
description = "The luminosity you want to use for GTK.";
|
||||
apply = lum: "prefer-${lum}";
|
||||
};
|
||||
theme = lib.mkOption {
|
||||
type = types.str;
|
||||
description = "The theme you want to use for GTK.";
|
||||
default = "";
|
||||
};
|
||||
icon.theme = lib.mkOption {
|
||||
type = types.str;
|
||||
description = "The icon theme you want to use for GTK.";
|
||||
default = "";
|
||||
};
|
||||
cursor = {
|
||||
theme = lib.mkOption {
|
||||
type = types.str;
|
||||
description = "The cursor theme you want to use for GTK.";
|
||||
default = "";
|
||||
};
|
||||
size = lib.mkOption {
|
||||
type = types.ints.u32;
|
||||
default = 24;
|
||||
description = "The cursor size you want to use for GTK.";
|
||||
apply = size: lib.gvariant.mkUint32 size;
|
||||
};
|
||||
};
|
||||
extraDconfPackages = lib.mkOption {
|
||||
type = types.listOf types.package;
|
||||
description = "Extra packages to install for DConf.";
|
||||
default = [];
|
||||
};
|
||||
extraDconfSettings = lib.mkOption {
|
||||
type = types.attrsOf types.anything;
|
||||
description = "Extra settings you want to apply to DConf.";
|
||||
default = {};
|
||||
};
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.dconf = {
|
||||
profiles.user.databases = [
|
||||
{
|
||||
settings =
|
||||
{
|
||||
"org/gnome/desktop/interface" = {
|
||||
color-scheme = cfg.luminosity;
|
||||
cursor-size = cfg.cursor.size;
|
||||
cursor-theme = cfg.cursor.theme;
|
||||
icon-theme = cfg.icon.theme;
|
||||
gtk-theme = cfg.theme;
|
||||
};
|
||||
}
|
||||
// cfg.extraDconfSettings;
|
||||
}
|
||||
];
|
||||
packages = cfg.extraDconfPackages;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -11,5 +11,6 @@
|
|||
./support.nix
|
||||
./users.nix
|
||||
./xonsh.nix
|
||||
./dconf.nix
|
||||
];
|
||||
}
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.alqueva.direnv;
|
||||
cfg = config.alqueva.programs.direnv;
|
||||
in {
|
||||
options.alqueva.direnv = {
|
||||
options.alqueva.programs.direnv = {
|
||||
enable = lib.mkEnableOption "direnv";
|
||||
};
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.alqueva.fonts;
|
||||
cfg = config.alqueva.system.fonts;
|
||||
inherit (lib) types mkOption;
|
||||
mkStringsOption = default: letterform:
|
||||
mkOption {
|
||||
|
@ -19,7 +19,7 @@
|
|||
description = "The packages you want to use for your ${letterform} fonts.";
|
||||
};
|
||||
in {
|
||||
options.alqueva.fonts = {
|
||||
options.alqueva.system.fonts = {
|
||||
enable = lib.mkEnableOption "" // {description = "Whether you want to use this fonts module.";};
|
||||
packages =
|
||||
{
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.alqueva.git;
|
||||
cfg = config.alqueva.programs.git;
|
||||
in {
|
||||
options.alqueva.git = {
|
||||
options.alqueva.programs.git = {
|
||||
enable = lib.mkEnableOption "git";
|
||||
};
|
||||
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.alqueva.libvirt;
|
||||
cfg = config.alqueva.programs.libvirt;
|
||||
in {
|
||||
options.alqueva.libvirt = {
|
||||
options.alqueva.programs.libvirt = {
|
||||
enable = lib.mkEnableOption "libvirt";
|
||||
};
|
||||
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.alqueva.pipewire;
|
||||
cfg = config.alqueva.system.pipewire;
|
||||
in {
|
||||
options.alqueva.pipewire = {
|
||||
options.alqueva.system.pipewire = {
|
||||
enable = lib.mkEnableOption "PipeWire";
|
||||
};
|
||||
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.alqueva.river;
|
||||
cfg = config.alqueva.wms.river;
|
||||
in {
|
||||
options.alqueva.river = {
|
||||
options.alqueva.wms.river = {
|
||||
enable = lib.mkEnableOption "River";
|
||||
};
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.alqueva.openssh;
|
||||
cfg = config.alqueva.programs.openssh;
|
||||
in {
|
||||
options.alqueva.openssh = {
|
||||
options.alqueva.programs.openssh = {
|
||||
enable = lib.mkEnableOption "OpenSSH";
|
||||
};
|
||||
|
||||
|
|
|
@ -4,15 +4,12 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.alqueva.xonsh;
|
||||
attrsToPyDict = attrs: (lib.pipe attrs [
|
||||
(builtins.mapAttrs (n: v: "aliases['${n}'] = '${v}'"))
|
||||
builtins.attrValues
|
||||
(lib.concatStringsSep "\n")
|
||||
(s: s + "\n")
|
||||
]);
|
||||
cfg = config.alqueva.shells.xonsh;
|
||||
aliasesToPyDict = aliases:
|
||||
lib.concatStringsSep "\n"
|
||||
(lib.mapAttrsToList (k: v: "aliases['${k}'] = '${v}'") aliases);
|
||||
in {
|
||||
options.alqueva.xonsh = {
|
||||
options.alqueva.shells.xonsh = {
|
||||
enable = lib.mkEnableOption "xonsh";
|
||||
package = lib.mkPackageOption pkgs "xonsh" {};
|
||||
};
|
||||
|
@ -20,10 +17,11 @@ in {
|
|||
config = lib.mkIf cfg.enable {
|
||||
programs = {
|
||||
xonsh = {
|
||||
config =
|
||||
"from xonsh.xontribs import get_xontribs\n"
|
||||
+ attrsToPyDict config.environment.shellAliases
|
||||
+ ''
|
||||
config = ''
|
||||
from xonsh.xontribs import get_xontribs
|
||||
|
||||
${aliasesToPyDict config.environment.shellAliases}
|
||||
|
||||
for xontrib in get_xontribs():
|
||||
xontrib load @(xontrib)
|
||||
'';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue