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, ... }: { { config, pkgs, ... }: {
imports = [ imports = [ ./sway ./emacs.nix ./firefox.nix ./nextcloud.nix ];
./firefox.nix
./mako.nix
./nextcloud.nix
./waybar.nix
./emacs.nix
./sway.nix
];
} }

View File

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

View File

@ -1,18 +1,30 @@
{ config, pkgs, ... }: { { 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 = "";
};
};
};
config = mkIf cfg.enable {
home-manager.users.james = { home-manager.users.james = {
# Enable touch controls. # Enable touch controls.
home.sessionVariables = { MOZ_USE_XINPUT2 = 1; }; home.sessionVariables = { MOZ_USE_XINPUT2 = 1; };
programs.firefox = { programs.firefox = {
enable = true; enable = true;
package = pkgs.firefox.override { package = pkgs.firefox.override {
cfg = { cfg = {
enableTridactylNative = true; enableTridactylNative = true;
# TODO make this general based on the whether sway is being used. forceWayland = sway_cfg.enable;
forceWayland = true;
}; };
}; };
@ -27,7 +39,6 @@
default = { default = {
name = "primary"; name = "primary";
id = 0; id = 0;
settings = { settings = {
"browser.download.useDownloadDir" = "browser.download.useDownloadDir" =
false; # Ask for download location false; # Ask for download location
@ -58,4 +69,5 @@
sha256 = "sha256-iOBd/yEvQP/Gn3+lS2Ztu9oslllZU4G7VnM4pTck+Tg="; sha256 = "sha256-iOBd/yEvQP/Gn3+lS2Ztu9oslllZU4G7VnM4pTck+Tg=";
}; };
}; };
};
} }

View File

@ -1,4 +1,19 @@
{ config, lib, pkgs, ... }: { { 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";
};
};
};
config = mkIf cfg.enable {
home-manager.users.james = { home-manager.users.james = {
home.packages = with pkgs; [ nextcloud-client ]; home.packages = with pkgs; [ nextcloud-client ];
@ -10,6 +25,7 @@
Wants = [ "graphical-session-pre.target" ]; Wants = [ "graphical-session-pre.target" ];
After = [ "graphical-session-pre.target" ]; After = [ "graphical-session-pre.target" ];
}; };
Service = { Service = {
Type = "simple"; Type = "simple";
ExecStart = "${pkgs.nextcloud-client}/bin/nextclient --background"; ExecStart = "${pkgs.nextcloud-client}/bin/nextclient --background";
@ -20,4 +36,5 @@
}; };
}; };
}; };
};
} }

View File

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

View File

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

View File

@ -1,11 +1,13 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let cfg = config.application.sway; let
cfg = config.application.sway;
graphical = config.graphical;
in with lib; { in with lib; {
options = { options = {
application.sway = { application.sway = {
enable = mkOption { enable = mkOption {
# TODO base on graphical # TODO base on graphical
default = true; default = graphical.enable;
type = with types; bool; type = with types; bool;
description = "testing one two three"; 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, ... }: { { config, lib, ... }: {
# Enable bootloader & clear /tmp on boot.
boot = { boot = {
# Enable bootloader & clear /tmp on boot.
cleanTmpDir = true; cleanTmpDir = true;
loader = { loader = {
systemd-boot.enable = true; 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 = [ imports = [
./system ./system
./applications ./applications

View File

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