Wrap oeg in an option

This commit is contained in:
Andreas Zweili 2023-05-27 16:58:29 +02:00
parent 3072a64b38
commit c738cea86d
4 changed files with 32 additions and 15 deletions

View File

@ -41,6 +41,7 @@ custom.inputs.nixpkgs.lib.nixosSystem
# Common configuration
(import "${custom.inputs.self}/modules/common-x86" { inherit custom; })
(import "${custom.inputs.self}/modules/default.nix" { inherit custom; })
custom.inputs.agenix.nixosModules.age
{ environment.systemPackages = [ custom.inputs.agenix.packages.${system}.default ]; }

6
modules/default.nix Normal file
View File

@ -0,0 +1,6 @@
{ custom }: { ... }:
{
imports = [
(import ./eog { inherit custom; })
];
}

View File

@ -3,7 +3,6 @@
imports = [
(import "${custom.inputs.self}/modules/docker" { inherit custom; })
(import "${custom.inputs.self}/modules/email" { inherit custom; })
(import "${custom.inputs.self}/modules/eog" { inherit custom; })
"${custom.inputs.self}/modules/hunspell"
(import "${custom.inputs.self}/modules/libimobiledevice" { inherit custom; })
(import "${custom.inputs.self}/modules/nix-direnv" { inherit custom; })
@ -53,6 +52,9 @@
# Enable dconf to be able to save Nautilus settings
programs.dconf.enable = true;
# Gnome Image Viewer
programs.eog.enable = true;
# Enable Flatpack
services.flatpak.enable = true;
xdg = {

View File

@ -1,19 +1,27 @@
{ custom }: { pkgs, ... }:
{ custom }: { config, lib, pkgs, ... }:
let
cfg = config.programs.eog;
in
{
environment.systemPackages = with pkgs; [
gnome.eog
];
options = {
programs.eog.enable = lib.mkEnableOption "Gnome Image Viewer";
};
home-manager.users.${custom.username} = {
xdg.mimeApps = {
enable = true;
associations.added = {
"image/png" = [ "org.gnome.eog.desktop" ];
"image/jpeg" = [ "org.gnome.eog.desktop" ];
};
defaultApplications = {
"image/png" = [ "org.gnome.eog.desktop" ];
"image/jpeg" = [ "org.gnome.eog.desktop" ];
config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [
gnome.eog
];
home-manager.users.${custom.username} = {
xdg.mimeApps = {
enable = true;
associations.added = {
"image/png" = [ "org.gnome.eog.desktop" ];
"image/jpeg" = [ "org.gnome.eog.desktop" ];
};
defaultApplications = {
"image/png" = [ "org.gnome.eog.desktop" ];
"image/jpeg" = [ "org.gnome.eog.desktop" ];
};
};
};
};