Compare commits
6 commits
adacfc47c4
...
4dd208ca1b
Author | SHA1 | Date | |
---|---|---|---|
4dd208ca1b | |||
c50b4d2d7b | |||
2dbcc4e246 | |||
3f76d39eb7 | |||
377e5a37d2 | |||
f5b7a2c71e |
9 changed files with 142 additions and 92 deletions
|
@ -1,4 +1,20 @@
|
|||
{ _ }:
|
||||
{ lib, namespace, ... }:
|
||||
let
|
||||
inherit (lib.${namespace}) enabled;
|
||||
in
|
||||
{
|
||||
home.keyboard.options = [ "apple:alupckeys" ];
|
||||
|
||||
${namespace} = {
|
||||
appearance = {
|
||||
base = enabled;
|
||||
gtk = enabled;
|
||||
qt = enabled;
|
||||
};
|
||||
xorg = {
|
||||
xsession = enabled;
|
||||
};
|
||||
};
|
||||
|
||||
home.stateVersion = "24.05";
|
||||
}
|
||||
|
|
|
@ -9,11 +9,11 @@ let
|
|||
inherit (lib) mkIf;
|
||||
inherit (lib.${namespace}) mkEnableModule enabled;
|
||||
|
||||
cfg = config.${namespace}.appearance;
|
||||
cfg = config.${namespace}.appearance.base;
|
||||
inherit (config.${namespace}) theme;
|
||||
in
|
||||
{
|
||||
options = mkEnableModule "appearance";
|
||||
options.appearance = mkEnableModule "base";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
home = {
|
||||
config.home = {
|
||||
sessionPath = [
|
||||
"${config.home.homeDirectory}/.local/bin"
|
||||
];
|
||||
|
@ -20,8 +20,4 @@
|
|||
v = "${config.home.sessionVariables.EDITOR}";
|
||||
};
|
||||
};
|
||||
|
||||
imports = [
|
||||
./xdg.nix
|
||||
];
|
||||
}
|
75
modules/home/base/xdg/default.nix
Normal file
75
modules/home/base/xdg/default.nix
Normal file
|
@ -0,0 +1,75 @@
|
|||
{
|
||||
config,
|
||||
namespace,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib) mkMerge mkIf;
|
||||
inherit (config.${namespace}) isDesktop;
|
||||
in
|
||||
{
|
||||
config = {
|
||||
home.preferXdgDirectories = true;
|
||||
|
||||
xdg =
|
||||
let
|
||||
homeDir = config.home.homeDirectory;
|
||||
in
|
||||
mkMerge [
|
||||
{
|
||||
enable = true;
|
||||
|
||||
cacheHome = "${homeDir}/.cache";
|
||||
configHome = "${homeDir}/.config";
|
||||
dataHome = "${homeDir}/.local/share";
|
||||
stateHome = "${homeDir}/.local/state";
|
||||
}
|
||||
(mkIf isDesktop {
|
||||
userDirs = {
|
||||
enable = true;
|
||||
createDirectories = true;
|
||||
|
||||
desktop = "${homeDir}/desktop";
|
||||
documents = null;
|
||||
download = "${homeDir}/downloads";
|
||||
music = null;
|
||||
pictures = "${homeDir}/pictures";
|
||||
templates = null;
|
||||
videos = "${homeDir}/videos";
|
||||
};
|
||||
|
||||
portal = {
|
||||
enable = true;
|
||||
xdgOpenUsePortal = true;
|
||||
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
|
||||
config.common.default = [ "gtk" ];
|
||||
};
|
||||
|
||||
mimeApps = rec {
|
||||
enable = true;
|
||||
|
||||
associations.added = {
|
||||
"application/json" = [ "nvim.desktop" ];
|
||||
"application/pdf" = [ "org.pwmt.zathura-pdf-mupdf.desktop" ];
|
||||
"application/xhtml+xml" = [ "zen-alpha.desktop" ];
|
||||
"application/x-extension-htm" = [ "zen-alpha.desktop" ];
|
||||
"application/x-extension-html" = [ "zen-alpha.desktop" ];
|
||||
"application/x-extension-shtml" = [ "zen-alpha.desktop" ];
|
||||
"application/x-extension-xhtml" = [ "zen-alpha.desktop" ];
|
||||
"application/x-extension-xht" = [ "zen-alpha.desktop" ];
|
||||
"image/png" = [ "feh.desktop" ];
|
||||
"text/html" = [ "zen-alpha.desktop" ];
|
||||
"text/plain" = [ "nvim.desktop" ];
|
||||
"x-scheme-handler/chrome" = [ "zen-alpha.desktop" ];
|
||||
"x-scheme-handler/http" = [ "zen-alpha.desktop" ];
|
||||
"x-scheme-handler/https" = [ "zen-alpha.desktop" ];
|
||||
};
|
||||
|
||||
defaultApplications = associations.added;
|
||||
};
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
11
modules/home/options/isDesktop/default.nix
Normal file
11
modules/home/options/isDesktop/default.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{ lib, namespace, ... }:
|
||||
let
|
||||
inherit (lib) mkOption types;
|
||||
in
|
||||
{
|
||||
options.${namespace}.isDesktop = mkOption {
|
||||
type = with types; bool;
|
||||
default = false;
|
||||
description = "Whether this machine is used as a graphical desktop.";
|
||||
};
|
||||
}
|
36
modules/home/xorg/xsession/default.nix
Normal file
36
modules/home/xorg/xsession/default.nix
Normal file
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
namespace,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib) mkIf;
|
||||
inherit (lib.${namespace}) mkEnableModule;
|
||||
|
||||
cfg = config.${namespace}.xorg.xsession;
|
||||
in
|
||||
{
|
||||
options.xorg = mkEnableModule "xsession";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
xsession = {
|
||||
enable = true;
|
||||
|
||||
numlock.enable = true;
|
||||
|
||||
# TODO: Switch to autorandr.
|
||||
profileEtra = # sh
|
||||
''
|
||||
sudo mount -a
|
||||
"${config.home.homeDirectory}/.config/xrandr/desktop.sh"
|
||||
'';
|
||||
|
||||
initExtra = # sh
|
||||
''
|
||||
mpd &
|
||||
pidgin &
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,60 +0,0 @@
|
|||
{ config, pkgs, ... }:
|
||||
{
|
||||
home.preferXdgDirectories = true;
|
||||
|
||||
xdg =
|
||||
let
|
||||
homeDir = config.home.homeDirectory;
|
||||
in
|
||||
{
|
||||
enable = true;
|
||||
|
||||
cacheHome = "${homeDir}/.cache";
|
||||
configHome = "${homeDir}/.config";
|
||||
dataHome = "${homeDir}/.local/share";
|
||||
stateHome = "${homeDir}/.local/state";
|
||||
|
||||
userDirs = {
|
||||
enable = true;
|
||||
createDirectories = true;
|
||||
|
||||
desktop = "${homeDir}/desktop";
|
||||
documents = null;
|
||||
download = "${homeDir}/downloads";
|
||||
music = null;
|
||||
pictures = "${homeDir}/pictures";
|
||||
templates = null;
|
||||
videos = "${homeDir}/videos";
|
||||
};
|
||||
|
||||
portal = {
|
||||
enable = true;
|
||||
xdgOpenUsePortal = true;
|
||||
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
|
||||
config.common.default = [ "gtk" ];
|
||||
};
|
||||
|
||||
mimeApps = rec {
|
||||
enable = true;
|
||||
|
||||
associations.added = {
|
||||
"application/json" = [ "nvim.desktop" ];
|
||||
"application/pdf" = [ "org.pwmt.zathura-pdf-mupdf.desktop" ];
|
||||
"application/xhtml+xml" = [ "zen-alpha.desktop" ];
|
||||
"application/x-extension-htm" = [ "zen-alpha.desktop" ];
|
||||
"application/x-extension-html" = [ "zen-alpha.desktop" ];
|
||||
"application/x-extension-shtml" = [ "zen-alpha.desktop" ];
|
||||
"application/x-extension-xhtml" = [ "zen-alpha.desktop" ];
|
||||
"application/x-extension-xht" = [ "zen-alpha.desktop" ];
|
||||
"image/png" = [ "feh.desktop" ];
|
||||
"text/html" = [ "zen-alpha.desktop" ];
|
||||
"text/plain" = [ "nvim.desktop" ];
|
||||
"x-scheme-handler/chrome" = [ "zen-alpha.desktop" ];
|
||||
"x-scheme-handler/http" = [ "zen-alpha.desktop" ];
|
||||
"x-scheme-handler/https" = [ "zen-alpha.desktop" ];
|
||||
};
|
||||
|
||||
defaultApplications = associations.added;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./xsession.nix
|
||||
];
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
{ ... }:
|
||||
{
|
||||
home.keyboard.options = [ "apple:alupckeys" ];
|
||||
|
||||
xsession = {
|
||||
enable = true;
|
||||
|
||||
numlock.enable = true;
|
||||
# TODO: Switch to autorandr
|
||||
profileExtra = # sh
|
||||
''
|
||||
sudo mount -a
|
||||
"$HOME/.config/xrandr/desktop.sh"
|
||||
mpd &
|
||||
pidgin &
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue