From 8a9a3ea0cb7da90ae610daf9ae523ca923829b01 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Thu, 4 Jan 2024 13:40:14 -0600 Subject: [PATCH] Add thablet stuff --- flake.nix | 28 +++++--------- modules/nixos/default.nix | 1 + modules/nixos/gnome.nix | 74 ++++++++++++++++++++++++++++++++++++ modules/nixos/sway.nix | 1 - nixos/thablet/default.nix | 79 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 164 insertions(+), 19 deletions(-) create mode 100644 modules/nixos/gnome.nix create mode 100644 nixos/thablet/default.nix diff --git a/flake.nix b/flake.nix index b90d846..fd52997 100644 --- a/flake.nix +++ b/flake.nix @@ -117,15 +117,11 @@ in { base = base; nixos = base; # alias - dragon = mkNixosSystem "x86_64-linux" [./nixos/dragon] (with outputs.homeManagerModules; [ - dragon - ]); - thinker = mkNixosSystem "x86_64-linux" [./nixos/thinker] (with outputs.homeManagerModules; [ - thinker - ]); - foxtrot = mkNixosSystem "x86_64-linux" [./nixos/foxtrot] (with outputs.homeManagerModules; [ - foxtrot - ]); + thablet = mkNixosSystem "x86_64-linux" [./nixos/thablet] [outputs.homeManagerModules.base]; + thinker = mkNixosSystem "x86_64-linux" [./nixos/thinker] [outputs.homeManagerModules.thinker]; + foxtrot = mkNixosSystem "x86_64-linux" [./nixos/foxtrot] [ + outputs.homeManagerModules.foxtrot + ]; beefcake = mkNixosSystem "x86_64-linux" [ inputs.api-lyte-dev.nixosModules.x86_64-linux.api-lyte-dev @@ -133,15 +129,11 @@ ] (with outputs.homeManagerModules; [ linux ]); - rascal = mkNixosSystem "x86_64-linux" [./nixos/rascal] (with outputs.homeManagerModules; [ - linux - ]); - musicbox = mkNixosSystem "x86_64-linux" [./nixos/musicbox] (with outputs.homeManagerModules; [ - sway - ]); - router = mkNixosSystem "x86_64-linux" [./nixos/router] (with outputs.homeManagerModules; [ - common - ]); + rascal = mkNixosSystem "x86_64-linux" [./nixos/rascal] [ + outputs.homeManagerModules.linux + ]; + musicbox = mkNixosSystem "x86_64-linux" [./nixos/musicbox] [outputs.homeManagerModules.sway]; + router = mkNixosSystem "x86_64-linux" [./nixos/router] [outputs.homeManagerModules.common]; }; # Standalone home-manager configuration entrypoint diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index 4d7468e..367df2d 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -14,5 +14,6 @@ hyprland = import ./hyprland.nix; user-installed-applications = import ./user-installed-applications.nix; wifi = import ./wifi.nix; + gnome = import ./gnome.nix; kde-connect = import ./kde-connect.nix; } diff --git a/modules/nixos/gnome.nix b/modules/nixos/gnome.nix new file mode 100644 index 0000000..3d451f9 --- /dev/null +++ b/modules/nixos/gnome.nix @@ -0,0 +1,74 @@ +{pkgs, ...}: { + imports = [./pipewire.nix]; + + services.xserver.enable = true; + services.xserver.displayManager.gdm = { + enable = true; + }; + + hardware.pulseaudio.enable = false; + + services.xserver.desktopManager.gnome = { + enable = true; + }; + + programs.gnupg.agent = { + enable = true; + pinentryFlavor = "gnome3"; + enableSSHSupport = true; + }; + + xdg.portal = { + enable = true; + }; + + services.dbus.enable = true; + + services.gvfs = { + enable = true; + }; + + environment = { + variables = { + GTK_THEME = "Catppuccin-Mocha-Compact-Sapphire-Dark"; + VISUAL = "hx"; + PAGER = "less"; + MANPAGER = "less"; + }; + + systemPackages = with pkgs; [ + brightnessctl + feh + # gimp + grim + # inkscape + # krita + libinput + libinput-gestures + libnotify + # lutris + # nil + # nixpkgs-fmt + noto-fonts + pamixer + # pavucontrol + playerctl + # pulseaudio + pulsemixer + # rclone + # restic + slurp + # steam + swaybg + swayidle + swaylock + # vlc + # vulkan-tools + waybar + # weechat + # wine + wl-clipboard + zathura + ]; + }; +} diff --git a/modules/nixos/sway.nix b/modules/nixos/sway.nix index 188d3ae..d908220 100644 --- a/modules/nixos/sway.nix +++ b/modules/nixos/sway.nix @@ -21,7 +21,6 @@ extraPortals = with pkgs; [ xdg-desktop-portal-wlr - xdg-desktop-portal-gtk ]; }; diff --git a/nixos/thablet/default.nix b/nixos/thablet/default.nix new file mode 100644 index 0000000..f452cf7 --- /dev/null +++ b/nixos/thablet/default.nix @@ -0,0 +1,79 @@ +{ + flake, + inputs, + outputs, + lib, + config, + modulesPath, + ... +}: { + imports = + [ + (modulesPath + "/installer/scan/not-detected.nix") + inputs.disko.nixosModules.disko + flake.diskoConfigurations.standard + inputs.hardware.nixosModules.lenovo-thinkpad-x1-yoga + ] + ++ (with outputs.nixosModules; [ + desktop-usage + gnome + wifi + ]); + + nixpkgs = { + overlays = [ + outputs.overlays.additions + outputs.overlays.modifications + outputs.overlays.unstable-packages + ]; + config = { + allowUnfree = true; + }; + }; + + nix = { + registry = lib.mapAttrs (_: value: {flake = value;}) inputs; + nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry; + + settings = { + experimental-features = "nix-command flakes"; + auto-optimise-store = true; + }; + }; + + # not necessarily "base", but all my machines are UEFI so... + boot.loader.systemd-boot.enable = true; + + services.fprintd = { + enable = true; + # tod.enable = true; + # tod.driver = pkgs.libfprint-2-tod1-goodix; + }; + + environment.systemPackages = + #with pkgs; + []; + + programs.steam.enable = true; + programs.steam.remotePlay.openFirewall = true; + + networking = { + firewall = { + enable = true; + allowPing = true; + allowedTCPPorts = [22]; + allowedUDPPorts = []; + }; + }; + + boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "usb_storage" "sd_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-intel"]; + boot.extraModulePackages = []; + + networking.useDHCP = lib.mkDefault true; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + + system.stateVersion = "23.11"; +}