From aed273b46a14d992f273a2873db2239f659267fc Mon Sep 17 00:00:00 2001 From: Marty Sluijtman Date: Mon, 5 Feb 2024 23:03:46 +0100 Subject: [PATCH 1/3] Graphics module rather than Nvidia specific module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I❤ nvidia... --- flake.nix | 2 +- modules/graphics.nix | 31 +++++++++++++++++++++++++++++++ modules/nvidia.nix | 27 --------------------------- 3 files changed, 32 insertions(+), 28 deletions(-) create mode 100644 modules/graphics.nix delete mode 100644 modules/nvidia.nix diff --git a/flake.nix b/flake.nix index 88294a1..d7e5767 100644 --- a/flake.nix +++ b/flake.nix @@ -9,7 +9,7 @@ ./modules/audio.nix ./modules/font.nix ./modules/nix-settings.nix - ./modules/nvidia.nix + ./modules/graphics.nix ./modules/services.nix ./modules/vim.nix ./modules/xconfig.nix diff --git a/modules/graphics.nix b/modules/graphics.nix new file mode 100644 index 0000000..04d340b --- /dev/null +++ b/modules/graphics.nix @@ -0,0 +1,31 @@ +{ lib, config, ... }: +with lib; +let cfg = config.voidcruiser.graphics; +in { + options.voidcruiser.graphics ={ + defaultSettings.enable = mkEnableOption "Enables some basic graphical settings"; + nvidia = { + enable = mkEnableOption "Enables Nvidia settings"; + proprietaryDrivers = mkEnableOption "Enables proprietary drivers"; + }; + }; + config = { + hardware = { + opengl = { + enable = true; + driSupport = true; + driSupport32Bit = true; + }; + nvidia = mkIf cfg.nvidia.enable { + package = config.boot.kernelPackages.nvidiaPackages.stable; + powerManagement = { + enable = false; + finegrained = false; + }; + open = !cfg.nvidia.proprietaryDrivers; + nvidiaSettings = cfg.nvidia.proprietaryDrivers; + }; + }; + services.xserver.videoDrivers = mkIf cfg.nvidia.proprietaryDrivers ["nvidia"]; + }; +} diff --git a/modules/nvidia.nix b/modules/nvidia.nix deleted file mode 100644 index f9a87a9..0000000 --- a/modules/nvidia.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ lib, config, ... }: -with lib; -let cfg = config.voidcruiser.nvidia; -in { - options.voidcruiser.nvidia = { - enable = mkEnableOption "Enables proprietary Nvidia drivers and related config"; - }; - config = mkIf cfg.enable { - hardware = { - opengl = { - enable = true; - driSupport = true; - driSupport32Bit = true; - }; - nvidia = { - package = config.boot.kernelPackages.nvidiaPackages.stable; - powerManagement = { - enable = false; - finegrained = false; - }; - open = false; - nvidiaSettings = true; - }; - }; - services.xserver.videoDrivers = ["nvidia"]; - }; -} From ba158984554fa4f3a269b7848753e4cb92127316 Mon Sep 17 00:00:00 2001 From: Marty Sluijtman Date: Sat, 17 Feb 2024 18:49:37 +0100 Subject: [PATCH 2/3] More logical name --- modules/audio.nix | 4 ++-- modules/font.nix | 4 ++-- modules/graphics.nix | 4 ++-- modules/kernel.nix | 4 ++-- modules/nix-settings.nix | 4 ++-- modules/prometheus.nix | 4 ++-- modules/services.nix | 4 ++-- modules/vim.nix | 4 ++-- modules/xconfig.nix | 4 ++-- modules/zsh.nix | 4 ++-- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/modules/audio.nix b/modules/audio.nix index 626672f..376af77 100644 --- a/modules/audio.nix +++ b/modules/audio.nix @@ -1,8 +1,8 @@ { lib, config, ... }: with lib; -let cfg = config.voidcruiser.audio; +let cfg = config.voidconf.audio; in { - options.voidcruiser.audio = { + options.voidconf.audio = { enable = mkEnableOption "Enable all the audio daemons"; }; config = mkIf cfg.enable { diff --git a/modules/font.nix b/modules/font.nix index fa82349..e7b02cb 100644 --- a/modules/font.nix +++ b/modules/font.nix @@ -1,8 +1,8 @@ { pkgs, config, lib, ... }: with lib; -let cfg = config.voidcruiser.fontConfig; +let cfg = config.voidconf.fontConfig; in { - options.voidcruiser.fontConfig = { + options.voidconf.fontConfig = { enable = mkEnableOption "Enable opinionated font configuration"; joyPixels = mkEnableOption "Enables the JoyPixels font"; }; diff --git a/modules/graphics.nix b/modules/graphics.nix index 04d340b..1c5c6e9 100644 --- a/modules/graphics.nix +++ b/modules/graphics.nix @@ -1,8 +1,8 @@ { lib, config, ... }: with lib; -let cfg = config.voidcruiser.graphics; +let cfg = config.voidconf.graphics; in { - options.voidcruiser.graphics ={ + options.voidconf.graphics ={ defaultSettings.enable = mkEnableOption "Enables some basic graphical settings"; nvidia = { enable = mkEnableOption "Enables Nvidia settings"; diff --git a/modules/kernel.nix b/modules/kernel.nix index e8feac3..dbd81b5 100644 --- a/modules/kernel.nix +++ b/modules/kernel.nix @@ -1,8 +1,8 @@ { lib, config, ... }: with lib; -let cfg = config.voidcruiser.kernelTweaks; +let cfg = config.voidconf.kernelTweaks; in { - options.voidcruiser.kernelTweaks = { + options.voidconf.kernelTweaks = { enable = mkEnableOption "Enables kernel tweaks"; }; config = mkIf cfg.enable { diff --git a/modules/nix-settings.nix b/modules/nix-settings.nix index bf9af98..e58f5c7 100644 --- a/modules/nix-settings.nix +++ b/modules/nix-settings.nix @@ -1,8 +1,8 @@ { lib, config, ... }: with lib; -let cfg = config.voidcruiser.nixSettings; +let cfg = config.voidconf.nixSettings; in { - options.voidcruiser.nixSettings = { + options.voidconf.nixSettings = { gc = { automatic = mkOption { type = types.bool; diff --git a/modules/prometheus.nix b/modules/prometheus.nix index 2bc0b73..d748a4f 100644 --- a/modules/prometheus.nix +++ b/modules/prometheus.nix @@ -1,8 +1,8 @@ { lib, config, ... }: with lib; -let cfg = config.voidcruiser.prometheus; +let cfg = config.voidconf.prometheus; in { - options.voidcruiser.prometheus = { + options.voidconf.prometheus = { enable = mkEnableOption "Enable prometheus node"; }; config = mkIf cfg.enable { diff --git a/modules/services.nix b/modules/services.nix index fa278b2..15185bd 100644 --- a/modules/services.nix +++ b/modules/services.nix @@ -1,8 +1,8 @@ { config, lib, pkgs, ... }: with lib; -let cfg = config.voidcruiser.services; +let cfg = config.voidconf.services; in { - options.voidcruiser.services = { + options.voidconf.services = { flatpak = { enable = mkEnableOption "Enables basic flatpak configuration"; diff --git a/modules/vim.nix b/modules/vim.nix index afc04db..b01de61 100644 --- a/modules/vim.nix +++ b/modules/vim.nix @@ -1,8 +1,8 @@ { config, lib, pkgs, ... }: with lib; -let cfg = config.voidcruiser.vim; +let cfg = config.voidconf.vim; in { - options.voidcruiser.vim = { + options.voidconf.vim = { enable = mkEnableOption "Enables opinionated vim configuration"; enableNvim = mkEnableOption "Enables neovim and alias"; setEnvVar = mkOption { diff --git a/modules/xconfig.nix b/modules/xconfig.nix index 10a45d9..2421742 100644 --- a/modules/xconfig.nix +++ b/modules/xconfig.nix @@ -1,8 +1,8 @@ { config, lib, ... }: with lib; -let cfg = config.voidcruiser.xconfig; +let cfg = config.voidconf.xconfig; in { - options.voidcruiser.xconfig = { + options.voidconf.xconfig = { enable = mkEnableOption "Enables opinionated xorg config"; diff --git a/modules/zsh.nix b/modules/zsh.nix index 3926a6f..4706e8f 100644 --- a/modules/zsh.nix +++ b/modules/zsh.nix @@ -1,8 +1,8 @@ { config, lib, ... }: with lib; -let cfg = config.voidcruiser.zsh; +let cfg = config.voidconf.zsh; in { - options.voidcruiser.zsh = { + options.voidconf.zsh = { enable = mkEnableOption "Enables opinionated zsh configuration"; skim.enable = mkEnableOption "Enables skim support for shell history"; highlightStyle = mkOption { From 3b544a6565e4aaee8a6ff1ce2e5af8dded148c62 Mon Sep 17 00:00:00 2001 From: Marty Sluijtman Date: Tue, 5 Mar 2024 16:50:50 +0100 Subject: [PATCH 3/3] Ubuntu font --- modules/font.nix | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/modules/font.nix b/modules/font.nix index e7b02cb..060c309 100644 --- a/modules/font.nix +++ b/modules/font.nix @@ -11,24 +11,25 @@ in { fontDir.enable = true; packages = with pkgs; [ (nerdfonts.override { fonts = [ "FiraCode" "Iosevka" ]; }) - jetbrains-mono - iosevka - fira-code - fira - font-awesome - liberation_ttf - libertine - libertinus - vollkorn - noto-fonts-emoji - noto-fonts - ipafont - bqn386 - blackout - prociono - mplus-outline-fonts.githubRelease - mononoki - uiua386 + ubuntu_font_family + jetbrains-mono + iosevka + fira-code + fira + font-awesome + liberation_ttf + libertine + libertinus + vollkorn + noto-fonts-emoji + noto-fonts + ipafont + bqn386 + blackout + prociono + mplus-outline-fonts.githubRelease + mononoki + uiua386 ]; fontconfig = { enable = true;