From 624fd23f8b1d0e611083948d29107cf9deaaa780 Mon Sep 17 00:00:00 2001 From: Grimmauld Date: Tue, 30 Apr 2024 12:32:03 +0200 Subject: [PATCH] more cleanup --- common/default.nix | 21 +++++++++++++++++++ common/graphics/default.nix | 1 + common/graphics/fonts.nix | 20 ++++++++++++++++++ common/graphics/sway.nix | 6 ++++-- common/laptop_hardware.nix | 12 ++++++++++- common/tooling/default.nix | 4 ++-- common/tooling/nix.nix | 2 ++ common/tooling/security.nix | 2 +- common/xdg/portals.nix | 3 --- configuration.nix | 7 ------- flake.nix | 2 +- load_common.nix | 21 ------------------- modules/fonts.nix | 11 ---------- modules/tabletdriver.nix | 8 ------- .../hardware-configuration.nix | 1 - 15 files changed, 63 insertions(+), 58 deletions(-) create mode 100644 common/default.nix create mode 100644 common/graphics/fonts.nix delete mode 100644 load_common.nix delete mode 100644 modules/fonts.nix delete mode 100644 modules/tabletdriver.nix diff --git a/common/default.nix b/common/default.nix new file mode 100644 index 0000000..a5961f1 --- /dev/null +++ b/common/default.nix @@ -0,0 +1,21 @@ +{ config, lib, pkgs, ... }: +with lib; +{ + options.grimmShared = { + enable = mkEnableOption "grimm-shared-common"; + }; + + imports = [ + ./localisation.nix + ./printing.nix + ./xdg + ./network + ./tooling + ./sound + ./graphics + ./gaming.nix + ./firefox.nix + ./cloudsync.nix + ./laptop_hardware.nix + ]; +} diff --git a/common/graphics/default.nix b/common/graphics/default.nix index e1f83d6..da6adf4 100644 --- a/common/graphics/default.nix +++ b/common/graphics/default.nix @@ -3,5 +3,6 @@ ./qt.nix ./opengl.nix ./sway.nix + ./fonts.nix ]; } diff --git a/common/graphics/fonts.nix b/common/graphics/fonts.nix new file mode 100644 index 0000000..b8ac495 --- /dev/null +++ b/common/graphics/fonts.nix @@ -0,0 +1,20 @@ +{ lib, pkgs, config, ... }: +{ + config = with config.grimmShared; lib.mkIf (enable && graphical) { + fonts = { + packages = with pkgs; [ + noto-fonts + noto-fonts-cjk + font-awesome + noto-fonts-emoji + roboto + liberation_ttf + ]; + + fontDir.enable = true; + }; + environment.sessionVariables = { + FREETYPE_PROPERTIES = "cff:no-stem-darkening=0 autofitter:no-stem-darkening=0"; + }; + }; +} diff --git a/common/graphics/sway.nix b/common/graphics/sway.nix index 27b332e..b83ef21 100644 --- a/common/graphics/sway.nix +++ b/common/graphics/sway.nix @@ -123,6 +123,8 @@ in programs.waybar.enable = true; + programs.dconf.enable = true; + programs.sway = { enable = true; @@ -145,8 +147,8 @@ in "/etc/${conf_path}" ]; extraSessionCommands = '' -# source /etc/profile -# test -f $HOME/.profile && source $HOME/.profile + # source /etc/profile + # test -f $HOME/.profile && source $HOME/.profile systemctl --user import-environment export XDG_CURRENT_DESKTOP=sway diff --git a/common/laptop_hardware.nix b/common/laptop_hardware.nix index ebcf3dc..15ff5e1 100644 --- a/common/laptop_hardware.nix +++ b/common/laptop_hardware.nix @@ -11,6 +11,7 @@ in pciutils usbutils powertop + opentabletdriver ddcutil ] ++ lib.optionals graphical [ ddcui @@ -22,6 +23,7 @@ in hardware.i2c.enable = true; services.libinput.enable = true; powerManagement.cpuFreqGovernor = lib.mkDefault "normal"; + hardware.opentabletdriver.enable = true; services.udev.extraRules = '' SUBSYSTEM=="i2c-dev", ACTION=="add",\ @@ -45,7 +47,6 @@ in serviceConfig.Type = "oneshot"; }; - boot = { kernelParams = [ "splash" @@ -56,6 +57,15 @@ in "mmio_stale_data=full,nosmt" "pcie_aspm=off" ]; # "vfio-pci.ids=10de:1aeb,10de:2191,10de:1aed,10de:1aec" ]; + initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "nvme" + "usbhid" + "usb_storage" + "sd_mod" + ]; + loader.systemd-boot.enable = true; extraModulePackages = [ (config.boot.kernelPackages.ddcci-driver.overrideAttrs (old: { diff --git a/common/tooling/default.nix b/common/tooling/default.nix index c88da07..b96436d 100644 --- a/common/tooling/default.nix +++ b/common/tooling/default.nix @@ -49,7 +49,7 @@ in glxinfo alacritty vulkan-tools - + gparted thunderbird ]; @@ -139,7 +139,7 @@ in description = "Extra init LUA scripts"; }; }; - + git_user = mkOption { type = types.str; default = "Grimmauld"; diff --git a/common/tooling/nix.nix b/common/tooling/nix.nix index 0fd6b0e..510cc01 100644 --- a/common/tooling/nix.nix +++ b/common/tooling/nix.nix @@ -39,4 +39,6 @@ in nix.package = pkgs.nixVersions.unstable; nix.optimise.automatic = true; nixpkgs.hostPlatform = system; + + boot.tmp.cleanOnBoot = true; } diff --git a/common/tooling/security.nix b/common/tooling/security.nix index d29ecc0..4613165 100644 --- a/common/tooling/security.nix +++ b/common/tooling/security.nix @@ -23,7 +23,7 @@ in vulnix doas-sudo-shim # muscle memory inputs.agenix.packages.${system}.default - ] ++ lib.optionals (tooling.enable && tooling.pass) [ + ] ++ lib.optionals (tooling.enable && tooling.pass) [ pass (writeShellScriptBin "passw" "pass $@") ] ++ lib.optional graphical lxqt.lxqt-policykit; diff --git a/common/xdg/portals.nix b/common/xdg/portals.nix index 1d150ab..498b50f 100644 --- a/common/xdg/portals.nix +++ b/common/xdg/portals.nix @@ -29,14 +29,11 @@ in environment.sessionVariables = { XDG_CONFIG_HOME = "$HOME/.config"; - FREETYPE_PROPERTIES = "cff:no-stem-darkening=0 autofitter:no-stem-darkening=0"; }; environment.systemPackages = with pkgs; [ xwaylandvideobridge ]; - - fonts.fontDir.enable = true; }; options.grimmShared.portals = lib.mkEnableOption "Enables portals for wlr, gtk and kde as well as fixes fonts"; diff --git a/configuration.nix b/configuration.nix index 80e652b..54c36f3 100644 --- a/configuration.nix +++ b/configuration.nix @@ -2,14 +2,11 @@ { imports = [ - ./modules/fonts.nix - ./modules/tabletdriver.nix ./sway ]; # Bootloader. boot = { - loader.systemd-boot.enable = true; loader.efi.canTouchEfiVariables = true; kernelPackages = pkgs.linuxPackages_zen; }; @@ -55,12 +52,8 @@ spotify.enable = true; }; - age.identityPaths = [ "/home/grimmauld/.ssh/id_rsa" ]; age.secrets.nextcloud_pass = { file = ./secrets/nextcloud_pass.age; mode = "777"; }; - - boot.tmp.cleanOnBoot = true; - programs.dconf.enable = true; } diff --git a/flake.nix b/flake.nix index 7f346b3..fd16f3c 100644 --- a/flake.nix +++ b/flake.nix @@ -67,7 +67,7 @@ agenix.nixosModules.default chaotic.nixosModules.default nix-gaming.nixosModules.pipewireLowLatency - ./load_common.nix + ./common ./specific/grimm-nixos-laptop/configuration.nix ./configuration.nix ./modules/users.nix diff --git a/load_common.nix b/load_common.nix deleted file mode 100644 index 308f662..0000000 --- a/load_common.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ config, lib, pkgs, ... }: -with lib; -{ - options.grimmShared = { - enable = mkEnableOption "grimm-shared-common"; - }; - - imports = [ - ./common/localisation.nix - ./common/printing.nix - ./common/xdg - ./common/network - ./common/tooling - ./common/sound - ./common/graphics - ./common/gaming.nix - ./common/firefox.nix - ./common/cloudsync.nix - ./common/laptop_hardware.nix - ]; -} diff --git a/modules/fonts.nix b/modules/fonts.nix deleted file mode 100644 index e522fd0..0000000 --- a/modules/fonts.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ pkgs, fonts, ... }: -{ - fonts.packages = with pkgs; [ - noto-fonts - noto-fonts-cjk - font-awesome - noto-fonts-emoji - roboto - liberation_ttf - ]; -} diff --git a/modules/tabletdriver.nix b/modules/tabletdriver.nix deleted file mode 100644 index 11be880..0000000 --- a/modules/tabletdriver.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ pkgs, ... }: -{ - environment.systemPackages = with pkgs; [ - opentabletdriver - ]; - - hardware.opentabletdriver.enable = true; -} diff --git a/specific/grimm-nixos-laptop/hardware-configuration.nix b/specific/grimm-nixos-laptop/hardware-configuration.nix index 2456133..224cdb5 100644 --- a/specific/grimm-nixos-laptop/hardware-configuration.nix +++ b/specific/grimm-nixos-laptop/hardware-configuration.nix @@ -10,7 +10,6 @@ # ./modules/nvidia.nix ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; boot.initrd.kernelModules = [ ]; boot.extraModulePackages = [ ];