From 751694df63b34946e1a79d379eac8c35ba40eed1 Mon Sep 17 00:00:00 2001 From: Azat Bahawi Date: Fri, 16 Sep 2022 15:13:19 +0300 Subject: 2022-09-16 --- modules/nixfiles/common/home-manager.nix | 20 +++++++++----------- modules/nixfiles/common/kernel.nix | 1 + modules/nixfiles/common/shell/default.nix | 9 ++++++++- modules/nixfiles/profiles/headful.nix | 28 ++++++++++++++++------------ modules/nixfiles/qutebrowser.nix | 29 ++++++++++++++--------------- modules/nixfiles/throttled.nix | 3 +++ modules/nixfiles/unbound.nix | 3 +-- modules/nixfiles/vim/default.nix | 10 ++++++---- 8 files changed, 58 insertions(+), 45 deletions(-) (limited to 'modules') diff --git a/modules/nixfiles/common/home-manager.nix b/modules/nixfiles/common/home-manager.nix index 3e715bb..91f6705 100644 --- a/modules/nixfiles/common/home-manager.nix +++ b/modules/nixfiles/common/home-manager.nix @@ -10,23 +10,21 @@ with lib; { (mkAliasOptionModule ["hm"] ["home-manager" "users" my.username]) ]; - hm.home = {inherit (config.system) stateVersion;}; - home-manager = { backupFileExtension = "bak"; useUserPackages = true; useGlobalPkgs = true; verbose = true; - # TODO You know what to do. - users = { - root.home = { - inherit (config.system) stateVersion; - }; - ${my.username}.home = { - inherit (config.system) stateVersion; - }; - }; + users = + mapListToAttrs (_: { + home = { + inherit (config.system) stateVersion; + }; + }) [ + "root" + my.username + ]; }; system.extraDependencies = [inputs.home-manager]; diff --git a/modules/nixfiles/common/kernel.nix b/modules/nixfiles/common/kernel.nix index f6c096b..2fdfeeb 100644 --- a/modules/nixfiles/common/kernel.nix +++ b/modules/nixfiles/common/kernel.nix @@ -1,6 +1,7 @@ {lib, ...}: with lib; { boot = { + # I don't use it even on laptops. kernelParams = ["hibernate=no"]; kernel.sysctl = { diff --git a/modules/nixfiles/common/shell/default.nix b/modules/nixfiles/common/shell/default.nix index 50ae488..4e0572f 100644 --- a/modules/nixfiles/common/shell/default.nix +++ b/modules/nixfiles/common/shell/default.nix @@ -120,6 +120,13 @@ with lib; { // genAttrs ["grep" "egrep" "fgrep"] (name: "${pkgs.gnugrep}/bin/${name} --color=always"); - systemPackages = with pkgs; [bash-completion bc gawk hr moreutils pv]; + systemPackages = with pkgs; [ + bash-completion + bc + gawk + hr + moreutils + pv + ]; }; } diff --git a/modules/nixfiles/profiles/headful.nix b/modules/nixfiles/profiles/headful.nix index f4d3dc9..ba54b03 100644 --- a/modules/nixfiles/profiles/headful.nix +++ b/modules/nixfiles/profiles/headful.nix @@ -97,18 +97,22 @@ in { }; }; - # There are (arguably) not a lot of reasons to keep mitigations enabled for - # on machine that is not web-facing. First of all, to completely mitigate - # any possible Spectre holes one would need to disable Hyperthreading - # altogether which will essentially put one's computer into the stone age by - # not being able to to effectively utilise multi-core its multicore - # capabilities. Secondly, by enabling mitigations, we introduce a plethora - # of performace overheads[1], which, albeit small, but still contribute to - # the overall speed of things. This is however still poses a security risk, - # which I am willing to take. - # - # [1]: https://www.phoronix.com/scan.php?page=article&item=spectre-meltdown-2&num=11 - boot.kernelParams = ["mitigations=off"]; + boot = { + kernelPackages = mkForce pkgs.linuxPackages_xanmod_latest; + + # There are (arguably) not a lot of reasons to keep mitigations enabled + # for on machine that is not web-facing. First of all, to completely + # mitigate any possible Spectre holes one would need to disable + # Hyperthreading altogether which will essentially put one's computer into + # the stone age by not being able to to effectively utilise multi-core its + # multicore capabilities. Secondly, by enabling mitigations, we introduce + # a plethora of performace overheads[1], which, albeit small, but still + # contribute to the overall speed of things. This is however still poses a + # security risk, which I am willing to take. + # + # [1]: https://www.phoronix.com/scan.php?page=article&item=spectre-meltdown-2&num=11 + kernelParams = ["mitigations=off"]; + }; hardware.opengl = { enable = true; diff --git a/modules/nixfiles/qutebrowser.nix b/modules/nixfiles/qutebrowser.nix index 3fd2c24..dd1d027 100644 --- a/modules/nixfiles/qutebrowser.nix +++ b/modules/nixfiles/qutebrowser.nix @@ -451,21 +451,20 @@ in { }; }; } - // (listToAttrs - (map (name: nameValuePair name "default_size default_family") [ - "completion.category" - "completion.entry" - "contextmenu" - "debug_console" - "downloads" - "hints" - "keyhint" - "messages.error" - "messages.info" - "messages.warning" - "prompts" - "statusbar" - ])); + // mapListToAttrs (_: "default_size default_family") [ + "completion.category" + "completion.entry" + "contextmenu" + "debug_console" + "downloads" + "hints" + "keyhint" + "messages.error" + "messages.info" + "messages.warning" + "prompts" + "statusbar" + ]; qt = mkIf kde.enable { force_platform = null; diff --git a/modules/nixfiles/throttled.nix b/modules/nixfiles/throttled.nix index 2454ebd..f182ee1 100644 --- a/modules/nixfiles/throttled.nix +++ b/modules/nixfiles/throttled.nix @@ -10,6 +10,9 @@ in { options.nixfiles.modules.throttled.enable = mkEnableOption "Throttled"; config = mkIf cfg.enable { + # Disable the module we are trying to "override". + services.throttled.enable = mkForce false; + environment.etc."throttled.conf".text = '' [GENERAL] # Enable or disable the script execution diff --git a/modules/nixfiles/unbound.nix b/modules/nixfiles/unbound.nix index 066cdd3..8c40291 100644 --- a/modules/nixfiles/unbound.nix +++ b/modules/nixfiles/unbound.nix @@ -108,8 +108,7 @@ in { name = "."; forward-tls-upstream = true; forward-addr = let - mkDnsOverTls = ips: auth: - map (ip: concatStrings [ip "@" auth]) ips; + mkDnsOverTls = ips: auth: map (ip: concatStrings [ip "@" auth]) ips; in mkDnsOverTls dns.const.quad9.default "853#dns.quad9.net"; } diff --git a/modules/nixfiles/vim/default.nix b/modules/nixfiles/vim/default.nix index a38c58f..db46d34 100644 --- a/modules/nixfiles/vim/default.nix +++ b/modules/nixfiles/vim/default.nix @@ -12,8 +12,7 @@ in { config = mkIf cfg.enable { programs.vim.package = with pkgs; ((vim_configurable.override {features = "normal";} - // listToAttrs - (map (name: nameValuePair name false) [ + // mapListToAttrs false [ "cscopeSupport" "darwinSupport" "guiSupport" @@ -26,11 +25,14 @@ in { "rubySupport" "tclSupport" "ximSupport" - ])) + ]) .overrideAttrs (_: super: { configureFlags = super.configureFlags - ++ ["--enable-gpm=no" "--enable-gui=no"]; + ++ [ + "--enable-gpm=no" + "--enable-gui=no" + ]; })) .customize { name = "vim"; -- cgit v1.2.3