Skip to content

Commit

Permalink
feat(nix): add more apps and add MIME
Browse files Browse the repository at this point in the history
  • Loading branch information
sbulav committed Jan 31, 2024
1 parent eb5a579 commit e4e3406
Show file tree
Hide file tree
Showing 11 changed files with 131 additions and 8 deletions.
28 changes: 28 additions & 0 deletions nix/modules/nixos/apps/firefox/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,26 @@
with lib;
with lib.custom; let
cfg = config.custom.apps.firefox;
browser = ["firefox.desktop"];

# XDG MIME types
associations = {
"application/x-extension-htm" = browser;
"application/x-extension-html" = browser;
"application/x-extension-shtml" = browser;
"application/x-extension-xht" = browser;
"application/x-extension-xhtml" = browser;
"application/xhtml+xml" = browser;
"text/html" = browser;
"x-scheme-handler/about" = browser;
"x-scheme-handler/chrome" = ["chromium-browser.desktop"];
"x-scheme-handler/ftp" = browser;
"x-scheme-handler/http" = browser;
"x-scheme-handler/https" = browser;
"x-scheme-handler/unknown" = browser;

"application/json" = browser;
};
in {
options.custom.apps.firefox = with types; {
enable = mkBoolOpt false "Whether or not to enable Firefox.";
Expand All @@ -17,5 +37,13 @@ in {
programs.firefox = {
enable = true;
};

xdg = {
mime = {
enable = true;
defaultApplications = associations;
addedAssociations = associations;
};
};
};
}
18 changes: 16 additions & 2 deletions nix/modules/nixos/apps/imv/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,25 @@
with lib;
with lib.custom; let
cfg = config.custom.apps.imv;

# XDG MIME types
associations = {
"image/*" = ["imv.desktop"];
};
in {
options.custom.apps.imv = with types; {
enable = mkBoolOpt false "Whether or not to enable imv.";
};

config =
mkIf cfg.enable {environment.systemPackages = with pkgs; [imv];};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [imv];

xdg = {
mime = {
enable = true;
defaultApplications = associations;
addedAssociations = associations;
};
};
};
}
18 changes: 18 additions & 0 deletions nix/modules/nixos/apps/pcmanfm/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
options,
config,
lib,
pkgs,
...
}:
with lib;
with lib.custom; let
cfg = config.custom.apps.pcmanfm;
in {
options.custom.apps.pcmanfm = with types; {
enable = mkBoolOpt false "Whether or not to enable pcmanfm.";
};

config =
mkIf cfg.enable {environment.systemPackages = with pkgs; [pcmanfm];};
}
17 changes: 16 additions & 1 deletion nix/modules/nixos/apps/vlc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,25 @@
with lib;
with lib.custom; let
cfg = config.custom.apps.vlc;

associations = {
"audio/*" = ["vlc.desktop"];
"video/*" = ["vlc.desktop"];
};
in {
options.custom.apps.vlc = with types; {
enable = mkBoolOpt false "Whether or not to enable vlc.";
};

config = mkIf cfg.enable {environment.systemPackages = with pkgs; [vlc];};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [vlc];

xdg = {
mime = {
enable = true;
defaultApplications = associations;
addedAssociations = associations;
};
};
};
}
16 changes: 14 additions & 2 deletions nix/modules/nixos/apps/zathura/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,23 @@
with lib;
with lib.custom; let
cfg = config.custom.apps.zathura;
associations = {
"application/pdf" = ["org.pwmt.zathura.desktop.desktop"];
"application/epub" = ["org.pwmt.zathura.desktop.desktop"];
};
in {
options.custom.apps.zathura = with types; {
enable = mkBoolOpt false "Whether or not to enable zathura.";
};

config =
mkIf cfg.enable {environment.systemPackages = with pkgs; [zathura];};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [zathura];
xdg = {
mime = {
enable = true;
defaultApplications = associations;
addedAssociations = associations;
};
};
};
}
1 change: 1 addition & 0 deletions nix/modules/nixos/desktop/addons/rofi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ in {
};

config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [rbw rofi-rbw];
home.programs.rofi = {
enable = true;
plugins = with pkgs; [
Expand Down
3 changes: 3 additions & 0 deletions nix/modules/nixos/desktop/hyprland/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ in {
wlroots
cliphist
wl-clipboard

grim
slurp
];

environment.sessionVariables = {
Expand Down
6 changes: 6 additions & 0 deletions nix/modules/nixos/hardware/audio/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
options,
config,
lib,
pkgs,
...
}:
with lib;
Expand All @@ -23,5 +24,10 @@ in {
wireplumber.enable = true;
};
programs.noisetorch.enable = true;

environment.systemPackages = with pkgs; [
pamixer
pavucontrol
];
};
}
1 change: 1 addition & 0 deletions nix/modules/nixos/suites/common/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ in {
git.enable = true;
http.enable = true;
misc.enable = true;
net.enable = true;
};
custom.cli-apps = {
atuin.enable = true;
Expand Down
3 changes: 0 additions & 3 deletions nix/modules/nixos/tools/misc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,9 @@ in {

environment.systemPackages = with pkgs; [
bat
dig
fd
file
fzf
iftop
ipfetch
jq
killall
ripgrep
Expand Down
28 changes: 28 additions & 0 deletions nix/modules/nixos/tools/net/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
options,
config,
lib,
pkgs,
...
}:
with lib;
with lib.custom; let
cfg = config.custom.tools.net;
in {
options.custom.tools.net = with types; {
enable = mkBoolOpt false "Whether or not to enable common utilities.";
};

config = mkIf cfg.enable {
home.configFile."wgetrc".text = "";

environment.systemPackages = with pkgs; [
dig
iftop
ipfetch
nfs-utils
traceroute
mtr
];
};
}

0 comments on commit e4e3406

Please sign in to comment.