defaults: cleanup
This commit is contained in:
parent
00c06f982b
commit
d8071797fd
7 changed files with 73 additions and 67 deletions
42
defaults/browsers.nix
Normal file
42
defaults/browsers.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
name = "browsers";
|
||||||
|
cfg = config.nixowos.defaults.${name};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.nixowos.defaults.${name} = {
|
||||||
|
enable = lib.mkEnableOption name;
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
programs.firefox = lib.mkDefault {
|
||||||
|
policies = {
|
||||||
|
ExtensionSettings = {
|
||||||
|
"uBlock0@raymondhill.net" = {
|
||||||
|
install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
Preferences = {
|
||||||
|
"browser.newtabpage.activity-stream.feeds.wallpaperfeed".Value = false;
|
||||||
|
"browser.newtabpage.activity-stream.feeds.weatherfeed".Value = false;
|
||||||
|
|
||||||
|
# from https://discourse.nixos.org/t/declare-firefox-extensions-and-settings/36265
|
||||||
|
"browser.newtabpage.activity-stream.feeds.section.topstories".Value = false;
|
||||||
|
"browser.newtabpage.activity-stream.feeds.snippets".Value = false;
|
||||||
|
"browser.newtabpage.activity-stream.section.highlights.includePocket".Value = false;
|
||||||
|
"browser.newtabpage.activity-stream.section.highlights.includeBookmarks".Value = false;
|
||||||
|
"browser.newtabpage.activity-stream.section.highlights.includeDownloads".Value = false;
|
||||||
|
"browser.newtabpage.activity-stream.section.highlights.includeVisited".Value = false;
|
||||||
|
"browser.newtabpage.activity-stream.showSponsored".Value = false;
|
||||||
|
"browser.newtabpage.activity-stream.system.showSponsored".Value = false;
|
||||||
|
"browser.newtabpage.activity-stream.showSponsoredTopSites".Value = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -5,17 +5,17 @@
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
name = "graphical";
|
name = "defaults";
|
||||||
cfg = config.nixowos.${name};
|
cfg = config.nixowos.${name};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./plasma.nix
|
|
||||||
./nvidia.nix
|
|
||||||
./games
|
|
||||||
./jp.nix
|
./jp.nix
|
||||||
./mpv.nix
|
./plasma.nix
|
||||||
./virt.nix
|
./tmux.nix
|
||||||
|
./git.nix
|
||||||
|
./shell.nix
|
||||||
|
./browsers.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
options.nixowos.${name} = {
|
options.nixowos.${name} = {
|
||||||
|
|
@ -24,33 +24,12 @@ in
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
nixowos.${name} = lib.mkDefault {
|
nixowos.${name} = lib.mkDefault {
|
||||||
|
jp.enable = true;
|
||||||
plasma.enable = config.services.desktopManager.plasma6.enable;
|
plasma.enable = config.services.desktopManager.plasma6.enable;
|
||||||
mpv.enable = true;
|
tmux.enable = true;
|
||||||
};
|
git.enable = true;
|
||||||
|
shell.enable = true;
|
||||||
programs.firefox = lib.mkDefault {
|
browers.enable = true;
|
||||||
policies = {
|
|
||||||
ExtensionSettings = {
|
|
||||||
"uBlock0@raymondhill.net" = {
|
|
||||||
install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
Preferences = {
|
|
||||||
"browser.newtabpage.activity-stream.feeds.wallpaperfeed".Value = false;
|
|
||||||
"browser.newtabpage.activity-stream.feeds.weatherfeed".Value = false;
|
|
||||||
|
|
||||||
# from https://discourse.nixos.org/t/declare-firefox-extensions-and-settings/36265
|
|
||||||
"browser.newtabpage.activity-stream.feeds.section.topstories".Value = false;
|
|
||||||
"browser.newtabpage.activity-stream.feeds.snippets".Value = false;
|
|
||||||
"browser.newtabpage.activity-stream.section.highlights.includePocket".Value = false;
|
|
||||||
"browser.newtabpage.activity-stream.section.highlights.includeBookmarks".Value = false;
|
|
||||||
"browser.newtabpage.activity-stream.section.highlights.includeDownloads".Value = false;
|
|
||||||
"browser.newtabpage.activity-stream.section.highlights.includeVisited".Value = false;
|
|
||||||
"browser.newtabpage.activity-stream.showSponsored".Value = false;
|
|
||||||
"browser.newtabpage.activity-stream.system.showSponsored".Value = false;
|
|
||||||
"browser.newtabpage.activity-stream.showSponsoredTopSites".Value = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,13 +7,14 @@
|
||||||
|
|
||||||
let
|
let
|
||||||
name = "git";
|
name = "git";
|
||||||
cfg = config.nixowos.cli.${name};
|
cfg = config.nixowos.defaults.${name};
|
||||||
|
superCfg = config.programs.${name};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.nixowos.cli.${name} = {
|
options = {
|
||||||
enable = lib.mkEnableOption name;
|
nixowos.defaults.${name}.enable = lib.mkEnableOption name;
|
||||||
|
|
||||||
delta.enable = lib.mkEnableOption "delta within git" // {
|
programs.${name}.delta.enable = lib.mkEnableOption "delta within git" // {
|
||||||
default = true;
|
default = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
@ -21,7 +22,6 @@ in
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
programs.git = {
|
programs.git = {
|
||||||
enable = true;
|
|
||||||
|
|
||||||
config = lib.mkMerge [
|
config = lib.mkMerge [
|
||||||
{
|
{
|
||||||
|
|
@ -34,7 +34,7 @@ in
|
||||||
merge.conflictStyle = "zdiff3";
|
merge.conflictStyle = "zdiff3";
|
||||||
commit.verbose = true; # show diffs in commit editor
|
commit.verbose = true; # show diffs in commit editor
|
||||||
}
|
}
|
||||||
(lib.mkIf cfg.delta.enable {
|
(lib.mkIf superCfg.delta.enable {
|
||||||
core.pager = "${pkgs.delta}/bin/delta";
|
core.pager = "${pkgs.delta}/bin/delta";
|
||||||
interactive.diffFilter = "${pkgs.delta}/bin/delta --color-only";
|
interactive.diffFilter = "${pkgs.delta}/bin/delta --color-only";
|
||||||
delta.navigate = true; # use n and N to move between diff sections
|
delta.navigate = true; # use n and N to move between diff sections
|
||||||
|
|
|
||||||
|
|
@ -7,23 +7,18 @@
|
||||||
|
|
||||||
let
|
let
|
||||||
name = "jp";
|
name = "jp";
|
||||||
cfg = config.nixowos.graphical.${name};
|
cfg = config.nixowos.defaults.${name};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.nixowos.graphical.${name} = {
|
options.nixowos.defaults.${name} = {
|
||||||
enable = lib.mkEnableOption "cjk fonts and fcitx5-mozc for ${name} input";
|
enable = lib.mkEnableOption name;
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
# enable default fonts (helps with emojis, etc)
|
|
||||||
fonts.enableDefaultPackages = lib.mkDefault true;
|
|
||||||
# for higher quality asian fonts
|
|
||||||
# without this, chromium might not render asian text at all
|
|
||||||
fonts.packages = [ pkgs.noto-fonts-cjk-sans ];
|
|
||||||
|
|
||||||
# for typing in japanese
|
# for typing in japanese
|
||||||
i18n.inputMethod = {
|
i18n.inputMethod = lib.mkDefault {
|
||||||
enable = true;
|
# set this for the defaults to be realized!
|
||||||
|
# enable = true;
|
||||||
type = "fcitx5";
|
type = "fcitx5";
|
||||||
fcitx5 = {
|
fcitx5 = {
|
||||||
waylandFrontend = true;
|
waylandFrontend = true;
|
||||||
|
|
|
||||||
|
|
@ -7,12 +7,13 @@
|
||||||
|
|
||||||
let
|
let
|
||||||
name = "plasma";
|
name = "plasma";
|
||||||
cfg = config.nixowos.graphical.${name};
|
cfg = config.nixowos.defaults.${name};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.nixowos.graphical.${name} = {
|
options.nixowos.defaults.${name} = {
|
||||||
enable = lib.mkEnableOption name;
|
enable = lib.mkEnableOption name;
|
||||||
|
|
||||||
|
# TODO: move
|
||||||
startOnFirstTTY = lib.mkEnableOption "starting plasma from tty1" // {
|
startOnFirstTTY = lib.mkEnableOption "starting plasma from tty1" // {
|
||||||
description = ''
|
description = ''
|
||||||
Whether to start ${name} automatically from tty1.
|
Whether to start ${name} automatically from tty1.
|
||||||
|
|
|
||||||
|
|
@ -7,16 +7,10 @@
|
||||||
|
|
||||||
let
|
let
|
||||||
name = "shell";
|
name = "shell";
|
||||||
cfg = config.nixowos.cli.${name};
|
cfg = config.nixowos.defaults.${name};
|
||||||
|
|
||||||
# use a more verbose output style for nix than default
|
|
||||||
# only lix supports log-format = multiline-with-logs
|
|
||||||
logFormat = if config.nixowos.system.lix.enable then "multiline-with-logs" else "bar-with-logs";
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.nixowos.cli.${name} = {
|
options.nixowos.defaults.${name}.enable = lib.mkEnableOption name;
|
||||||
enable = lib.mkEnableOption name;
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
# use Fish, the nicest shell :)
|
# use Fish, the nicest shell :)
|
||||||
|
|
@ -30,9 +24,7 @@ in
|
||||||
# make nix-shell preserve the user's $SHELL
|
# make nix-shell preserve the user's $SHELL
|
||||||
nix-shell = /* sh */ ''nix-shell --command "export SHELL=$SHELL; $SHELL"'';
|
nix-shell = /* sh */ ''nix-shell --command "export SHELL=$SHELL; $SHELL"'';
|
||||||
|
|
||||||
nixos-rebuild = /* sh */ "nixos-rebuild --ask-sudo-password --log-format ${logFormat}";
|
nixos-rebuild = /* sh */ "nixos-rebuild --ask-sudo-password";
|
||||||
|
|
||||||
nix = /* sh */ "nix --log-format ${logFormat}";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,16 +6,13 @@
|
||||||
|
|
||||||
let
|
let
|
||||||
name = "tmux";
|
name = "tmux";
|
||||||
cfg = config.nixowos.cli.${name};
|
cfg = config.nixowos.defaults.${name};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.nixowos.cli.${name} = {
|
options.nixowos.defaults.${name}.enable = lib.mkEnableOption name;
|
||||||
enable = lib.mkEnableOption name;
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
programs.tmux = lib.mkDefault {
|
programs.tmux = lib.mkDefault {
|
||||||
enable = true;
|
|
||||||
|
|
||||||
# this is a sin committed for ergonomics
|
# this is a sin committed for ergonomics
|
||||||
# since "1" and "0" are quite far apart on most keyboards
|
# since "1" and "0" are quite far apart on most keyboards
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue