From 471966197a119b130c2fd33d845e239917242aa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Tue, 21 Nov 2023 21:01:56 +0100 Subject: [PATCH] nix: Reduce default size with options --- config/nix/curacao.nix | 1 + config/nix/curacao_test.nix | 12 ++++++++++++ config/nix/hm/desktop.nix | 6 +++--- config/nix/hm/extra.nix | 4 ++-- config/nix/hm/loader.nix | 1 + config/nix/hm/style.nix | 10 ++++++---- config/nix/options.nix | 7 +++++++ config/nix/os/desktop.nix | 1 - config/nix/os/geoffrey.nix | 3 ++- config/nix/os/loader.nix | 1 + config/nix/testvm.nix | 1 + 11 files changed, 36 insertions(+), 11 deletions(-) create mode 100644 config/nix/curacao_test.nix create mode 100644 config/nix/options.nix diff --git a/config/nix/curacao.nix b/config/nix/curacao.nix index 73f8c24..c1fcf5b 100644 --- a/config/nix/curacao.nix +++ b/config/nix/curacao.nix @@ -6,4 +6,5 @@ ]; networking.hostName = "curacao.geoffrey.frogeye.fr"; + frogeye.extra = true; } diff --git a/config/nix/curacao_test.nix b/config/nix/curacao_test.nix new file mode 100644 index 0000000..ecb1b16 --- /dev/null +++ b/config/nix/curacao_test.nix @@ -0,0 +1,12 @@ +{ ... }: +{ + imports = [ + ./hm/loader.nix + ]; + + home.username = "gnix"; + home.homeDirectory = "/home/gnix"; + + frogeye.extra = true; + frogeye.desktop.nixGLIntel = true; +} diff --git a/config/nix/hm/desktop.nix b/config/nix/hm/desktop.nix index 23fe543..b508335 100644 --- a/config/nix/hm/desktop.nix +++ b/config/nix/hm/desktop.nix @@ -506,12 +506,13 @@ rev = "489d6b095ab9d289fe11af0219a9ff00fe87c7c5"; }) { }; + nixGLIntelPrefix = "${nixgl.nixVulkanIntel}/bin/nixVulkanIntel ${nixgl.nixGLIntel}/bin/nixGLIntel "; + wmPrefix = "${lib.optionalString config.frogeye.desktop.nixGLIntel nixGLIntelPrefix}"; in { - # TODO Configurable source = pkgs.writeShellScript "xinitrc" '' ${pkgs.xorg.xrdb}/bin/xrdb ${config.xresources.path} - ${nixgl.nixVulkanIntel}/bin/nixVulkanIntel ${nixgl.nixGLIntel}/bin/nixGLIntel ${config.xsession.windowManager.command} + ${wmPrefix}${config.xsession.windowManager.command} ''; }; "rofimoji.rc" = { @@ -629,5 +630,4 @@ MPD_PORT = "${toString config.services.mpd.network.port}"; }; }; - } diff --git a/config/nix/hm/extra.nix b/config/nix/hm/extra.nix index f1c36d3..b8b6ee0 100644 --- a/config/nix/hm/extra.nix +++ b/config/nix/hm/extra.nix @@ -1,6 +1,6 @@ -{ pkgs, ... }: +{ pkgs, lib, config, ... }: { - home.packages = with pkgs; [ + home.packages = with pkgs; lib.mkIf config.frogeye.extra [ # android tools android-tools diff --git a/config/nix/hm/loader.nix b/config/nix/hm/loader.nix index 2e4ade4..4aa7b32 100644 --- a/config/nix/hm/loader.nix +++ b/config/nix/hm/loader.nix @@ -1,6 +1,7 @@ { ... }: { imports = [ + ../options.nix ./common.nix ./desktop.nix ./dev.nix diff --git a/config/nix/hm/style.nix b/config/nix/hm/style.nix index 07b0700..5bf2fce 100644 --- a/config/nix/hm/style.nix +++ b/config/nix/hm/style.nix @@ -23,15 +23,17 @@ in terminal = 10; }; monospace = { - package = pkgs.nerdfonts; + package = pkgs.nerdfonts.override { + fonts = [ "DejaVuSansMono" ]; # Choose from https://github.com/NixOS/nixpkgs/blob/6ba3207643fd27ffa25a172911e3d6825814d155/pkgs/data/fonts/nerdfonts/shas.nix + }; name = "DejaVuSansM Nerd Font"; }; }; targets = { - vim.enable = false; # FIXME Not compatible with nixvim for now (there's a MR) - i3.enable = false; # I prefer my own styles - tmux.enable = false; # Using another theme + vim.enable = false; # FIXME Not compatible with nixvim for now (there's a MR) + i3.enable = false; # I prefer my own styles + tmux.enable = false; # Using another theme }; }; diff --git a/config/nix/options.nix b/config/nix/options.nix new file mode 100644 index 0000000..0b2bf4e --- /dev/null +++ b/config/nix/options.nix @@ -0,0 +1,7 @@ +{ lib, ... }: +{ + options.frogeye = { + extra = lib.mkEnableOption "Big software"; + desktop.nixGLIntel = lib.mkEnableOption "Enable nixGLIntel/nixVulkanIntel for windows manager"; + }; +} diff --git a/config/nix/os/desktop.nix b/config/nix/os/desktop.nix index d068c73..51b95dd 100644 --- a/config/nix/os/desktop.nix +++ b/config/nix/os/desktop.nix @@ -5,7 +5,6 @@ services.xserver = { windowManager.i3.enable = true; - desktopManager.gnome.enable = true; displayManager.defaultSession = "none+i3"; # Keyboard layout diff --git a/config/nix/os/geoffrey.nix b/config/nix/os/geoffrey.nix index d944d19..5f5eb56 100644 --- a/config/nix/os/geoffrey.nix +++ b/config/nix/os/geoffrey.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, config, ... }: { imports = [ @@ -23,6 +23,7 @@ imports = [ ../hm/loader.nix ]; + frogeye = config.frogeye; }; # Makes VMs able to re-run useUserPackages = true; diff --git a/config/nix/os/loader.nix b/config/nix/os/loader.nix index 69dd3d5..cf9d18a 100644 --- a/config/nix/os/loader.nix +++ b/config/nix/os/loader.nix @@ -1,6 +1,7 @@ { ... }: { imports = [ + ../options.nix ./battery.nix ./geoffrey.nix ./common.nix diff --git a/config/nix/testvm.nix b/config/nix/testvm.nix index 7b62fa8..e1dcc21 100644 --- a/config/nix/testvm.nix +++ b/config/nix/testvm.nix @@ -5,4 +5,5 @@ ]; networking.hostName = "nixos"; + frogeye.extra = true; }