Added flags to all applications

This commit is contained in:
James Patrick 2021-12-14 00:24:26 -05:00
parent bb9f0632a9
commit 54cc3eb049
12 changed files with 148 additions and 87 deletions

View File

@ -1,10 +1,3 @@
{ config, pkgs, ... }: {
imports = [
./firefox.nix
./mako.nix
./nextcloud.nix
./waybar.nix
./emacs.nix
./sway.nix
];
imports = [ ./sway ./emacs.nix ./firefox.nix ./nextcloud.nix ];
}

View File

@ -1,12 +1,14 @@
{ inputs, config, lib, pkgs, ... }:
# TODO Still need the following dependecies
# - Language tools (grammer)
let cfg = config.application.emacs;
let
cfg = config.application.emacs;
graphical = config.graphical;
in with lib; {
options = {
application.emacs = {
enable = mkOption {
default = true;
default = graphical.enable;
type = with types; bool;
description = "Insert joke about emacs is an operating system.";
};

View File

@ -1,61 +1,73 @@
{ config, pkgs, ... }: {
home-manager.users.james = {
# Enable touch controls.
home.sessionVariables = { MOZ_USE_XINPUT2 = 1; };
programs.firefox = {
enable = true;
package = pkgs.firefox.override {
cfg = {
enableTridactylNative = true;
# TODO make this general based on the whether sway is being used.
forceWayland = true;
};
{ config, pkgs, lib, ... }:
let
cfg = config.application.firefox;
graphical = config.graphical;
sway_cfg = config.applications.sway;
in with lib; {
options = {
application.firefox = {
enable = mkOption {
default = graphical.enable;
type = with types; bool;
description = "";
};
};
};
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
onepassword-password-manager
https-everywhere
ublock-origin
tridactyl
];
config = mkIf cfg.enable {
home-manager.users.james = {
# Enable touch controls.
home.sessionVariables = { MOZ_USE_XINPUT2 = 1; };
profiles = {
default = {
name = "primary";
id = 0;
programs.firefox = {
enable = true;
package = pkgs.firefox.override {
cfg = {
enableTridactylNative = true;
forceWayland = sway_cfg.enable;
};
};
settings = {
"browser.download.useDownloadDir" =
false; # Ask for download location
"browser.in-content.dark-mode" = true; # Dark mode
"browser.newtabpage.activity-stream.feeds.section.topstories" =
false; # Disable top stories
"browser.newtabpage.activity-stream.feeds.sections" = false;
"browser.newtabpage.activity-stream.feeds.system.topstories" =
false; # Disable top stories
"browser.newtabpage.activity-stream.section.highlights.includePocket" =
false; # Disable pocket
"media.eme.enabled" = true; # Enable DRM
"media.gmp-widevinecdm.visible" = true; # Enable DRM
"media.gmp-widevinecdm.enabled" = true; # Enable DRM
"signon.autofillForms" = false; # Disable built-in form-filling
"signon.rememberSignons" =
false; # Disable built-in password manager
"ui.systemUsesDarkTheme" = true; # Dark mode
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
onepassword-password-manager
https-everywhere
ublock-origin
tridactyl
];
profiles = {
default = {
name = "primary";
id = 0;
settings = {
"browser.download.useDownloadDir" =
false; # Ask for download location
"browser.in-content.dark-mode" = true; # Dark mode
"browser.newtabpage.activity-stream.feeds.section.topstories" =
false; # Disable top stories
"browser.newtabpage.activity-stream.feeds.sections" = false;
"browser.newtabpage.activity-stream.feeds.system.topstories" =
false; # Disable top stories
"browser.newtabpage.activity-stream.section.highlights.includePocket" =
false; # Disable pocket
"media.eme.enabled" = true; # Enable DRM
"media.gmp-widevinecdm.visible" = true; # Enable DRM
"media.gmp-widevinecdm.enabled" = true; # Enable DRM
"signon.autofillForms" = false; # Disable built-in form-filling
"signon.rememberSignons" =
false; # Disable built-in password manager
"ui.systemUsesDarkTheme" = true; # Dark mode
};
};
};
};
};
# This is a bit silly as this is currently managed by my make dot config.
xdg.configFile."tridactyl/tridactylrc".source = pkgs.fetchurl {
url =
"https://git.jpatrick.io/james/dotfiles/raw/branch/master/tridactyl/tridactylrc";
sha256 = "sha256-iOBd/yEvQP/Gn3+lS2Ztu9oslllZU4G7VnM4pTck+Tg=";
# This is a bit silly as this is currently managed by my make dot config.
xdg.configFile."tridactyl/tridactylrc".source = pkgs.fetchurl {
url =
"https://git.jpatrick.io/james/dotfiles/raw/branch/master/tridactyl/tridactylrc";
sha256 = "sha256-iOBd/yEvQP/Gn3+lS2Ztu9oslllZU4G7VnM4pTck+Tg=";
};
};
};
}

View File

@ -1,21 +1,38 @@
{ config, lib, pkgs, ... }: {
home-manager.users.james = {
home.packages = with pkgs; [ nextcloud-client ];
{ config, lib, pkgs, ... }:
let
cfg = config.application.nextcloud;
graphical = config.graphical;
in with lib; {
options = {
application.nextcloud = {
enable = mkOption {
default = graphical.enable;
type = with types; bool;
description = "Dropbox for people who don't like dropbox";
};
};
};
systemd.user.services = {
nextcloud = {
Unit = {
Description = "Nextcloud - A slighly more GNU friendly dropbox";
BindsTo = [ "graphical-session.target" ];
Wants = [ "graphical-session-pre.target" ];
After = [ "graphical-session-pre.target" ];
};
Service = {
Type = "simple";
ExecStart = "${pkgs.nextcloud-client}/bin/nextclient --background";
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
config = mkIf cfg.enable {
home-manager.users.james = {
home.packages = with pkgs; [ nextcloud-client ];
systemd.user.services = {
nextcloud = {
Unit = {
Description = "Nextcloud - A slighly more GNU friendly dropbox";
BindsTo = [ "graphical-session.target" ];
Wants = [ "graphical-session-pre.target" ];
After = [ "graphical-session-pre.target" ];
};
Service = {
Type = "simple";
ExecStart = "${pkgs.nextcloud-client}/bin/nextclient --background";
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
};
};
};

View File

@ -0,0 +1 @@
{ config, pkgs, ... }: { imports = [ ./sway.nix ./mako.nix ./waybar.nix ]; }

View File

@ -1,11 +1,13 @@
{ options, config, lib, pkgs, ... }:
let cfg = config.application.mako;
let
cfg = config.application.mako;
sway = config.application.sway;
in with lib; {
options = {
application.mako = {
enable = mkOption {
# TODO track based on sway default
default = false;
default = sway.enable;
type = with types; bool;
description = "testing one two three";
};

View File

@ -1,11 +1,13 @@
{ config, lib, pkgs, ... }:
let cfg = config.application.sway;
let
cfg = config.application.sway;
graphical = config.graphical;
in with lib; {
options = {
application.sway = {
enable = mkOption {
# TODO base on graphical
default = true;
default = graphical.enable;
type = with types; bool;
description = "testing one two three";
};

View File

@ -0,0 +1,20 @@
{ options, config, lib, pkgs, ... }:
let
cfg = config.application.waybar;
sway_cfg = config.application.sway;
in with lib; {
options = {
application.waybar = {
enable = mkOption {
# TODO track based on sway default
default = sway_cfg.enable;
type = with types; bool;
description = "testing one two three";
};
};
};
config = mkIf cfg.enable {
home-manager.users.james = { home.packages = with pkgs; [ waybar ]; };
};
}

View File

@ -1,3 +0,0 @@
{ config, pkgs, ... }: {
home-manager.users.james = { home.packages = with pkgs; [ waybar ]; };
}

View File

@ -1,6 +1,6 @@
{ config, lib, ... }: {
# Enable bootloader & clear /tmp on boot.
boot = {
# Enable bootloader & clear /tmp on boot.
cleanTmpDir = true;
loader = {
systemd-boot.enable = true;

View File

@ -1,4 +1,14 @@
{ config, pkgs, ... }: {
{ config, pkgs, lib, ... }: {
options = {
graphical = {
enable = lib.mkOption {
default = false;
type = with lib.types; bool;
description = "Does this actually need X/Wayland";
};
};
};
imports = [
./system
./applications

View File

@ -1,4 +1,7 @@
{ config, lib, pkgs, ... }: {
{ config, lib, pkgs, ... }:
let grpahical = config.graphical;
in {
imports = [
../applications/firefox.nix
../applications/nextcloud.nix
@ -9,6 +12,8 @@
./minimal.nix
];
graphical.enable = true;
# Enable sound.
sound.enable = true;
hardware.pulseaudio.enable = true;