From ee7aff8404d02914a06a6146687dfce75a34699b Mon Sep 17 00:00:00 2001 From: Alexander Szczepanski Date: Thu, 15 Jun 2023 13:09:41 +0200 Subject: [PATCH] framework --- configs/docker.nix | 5 +- configs/gnome.nix | 51 +++++++++++++ configs/gui.nix | 56 +++++++------- configs/pantheon.nix | 11 ++- configs/user-gui-applications.nix | 43 +++++++---- configs/user-gui.nix | 29 ++++++++ configs/user.nix | 2 + machine/framework.nix | 119 ++++++++++++++++++++++++++++++ machine/homeserver.nix | 1 + 9 files changed, 272 insertions(+), 45 deletions(-) create mode 100644 configs/gnome.nix create mode 100644 machine/framework.nix diff --git a/configs/docker.nix b/configs/docker.nix index 25eb933..23d55aa 100644 --- a/configs/docker.nix +++ b/configs/docker.nix @@ -8,5 +8,8 @@ }; }; - environment.systemPackages = with pkgs; [ docker-compose ]; + environment.systemPackages = with pkgs; [ + docker-compose + minikube + ]; } diff --git a/configs/gnome.nix b/configs/gnome.nix new file mode 100644 index 0000000..edc98df --- /dev/null +++ b/configs/gnome.nix @@ -0,0 +1,51 @@ +{ config, pkgs, lib, ... }: +{ + programs.evolution.enable = true; + + services = { + xserver = { + enable = true; + excludePackages = [ pkgs.xterm ]; + displayManager = { + gdm = { + enable = true; + }; + }; + + desktopManager.gnome.enable = true; + layout = "us"; + + # Enable touchpad support. + libinput.enable = true; + updateDbusEnvironment = true; + }; + }; + + environment.systemPackages = with pkgs; [ + blackbox-terminal + gnome.gnome-power-manager + gnome.gnome-tweaks + gnomeExtensions.appindicator + gnomeExtensions.blur-my-shell + gnomeExtensions.vitals + whitesur-gtk-theme + whitesur-icon-theme + moka-icon-theme + ]; + + environment.gnome.excludePackages = (with pkgs; [ gnome-tour ]) + ++ (with pkgs.gnome; [ + cheese # webcam tool + gnome-music + gedit # text editor + epiphany # web browser + gnome-characters + totem # video player + iagno # go game + hitori # sudoku game + atomix # puzzle game + ]); + + # services.gpg-agent.pinentryFlavor = lib.mkDefault "gnome3"; + +} diff --git a/configs/gui.nix b/configs/gui.nix index 5a94ea1..70fd3ef 100644 --- a/configs/gui.nix +++ b/configs/gui.nix @@ -41,37 +41,37 @@ in }; }; - # fonts = { - # enableDefaultFonts = true; - # fontDir.enable = true; + fonts = { + enableDefaultFonts = true; + fontDir.enable = true; - # fonts = with pkgs; [ - # # (nerdfonts.override { fonts = [ "Liberation" ]; }) - # nerdfonts - # corefonts - # # google-fonts - # liberation_ttf - # noto-fonts - # noto-fonts-cjk - # noto-fonts-emoji - # noto-fonts-extra + fonts = with pkgs; [ + # (nerdfonts.override { fonts = [ "Liberation" ]; }) + nerdfonts + corefonts + google-fonts + liberation_ttf + noto-fonts + noto-fonts-cjk + noto-fonts-emoji + noto-fonts-extra - # open-sans - # stix-two - # twemoji-color-font - # ]; + open-sans + stix-two + twemoji-color-font + ]; - # # fontconfig = { - # # enable = true; - # # antialias = true; - # # defaultFonts = { - # # # monospace = [ "Fira Mono" ]; - # # serif = [ "Linux Libertine" ]; - # # sansSerif = [ "Open Sans" ]; - # # emoji = [ "Twitter Color Emoji" ]; - # # }; - # # }; - # }; + # fontconfig = { + # enable = true; + # antialias = true; + # defaultFonts = { + # # monospace = [ "Fira Mono" ]; + # serif = [ "Linux Libertine" ]; + # sansSerif = [ "Open Sans" ]; + # emoji = [ "Twitter Color Emoji" ]; + # }; + # }; + }; hardware.bluetooth.enable = true; hardware.sane.enable = true; diff --git a/configs/pantheon.nix b/configs/pantheon.nix index 1a84d7c..b2448ef 100644 --- a/configs/pantheon.nix +++ b/configs/pantheon.nix @@ -15,7 +15,11 @@ }; }; - desktopManager.pantheon.enable = true; + desktopManager.pantheon = { + enable = true; + extraWingpanelIndicators = with pkgs; [ wingpanel-indicator-ayatana ]; + }; + layout = "us"; # Enable touchpad support. @@ -23,4 +27,9 @@ updateDbusEnvironment = true; }; }; + + # App indicator + environment.pathsToLink = [ "/libexec" ]; + environment.systemPackages = with pkgs; [ indicator-application-gtk3 ]; + } diff --git a/configs/user-gui-applications.nix b/configs/user-gui-applications.nix index fbe61d5..86034e8 100644 --- a/configs/user-gui-applications.nix +++ b/configs/user-gui-applications.nix @@ -1,7 +1,20 @@ { config, pkgs, lib, ... }: let - unstable = import { config.allowUnfree = true; }; + unstable = import { + config.allowUnfree = true; + config.permittedInsecurePackages = [ + "electron-12.2.3" + ]; + config.packageOverrides = pkgs: { + steam = pkgs.steam.override { + extraPkgs = pkgs: with unstable.pkgs; [ + gamescope + mangohud + ]; + }; + }; + }; in { imports = [ ]; @@ -9,31 +22,31 @@ in home-manager.users.alex = { pkgs, ... }: { home = { packages = with unstable.pkgs; [ - bitwarden - cura - cypress + brave + chromium + # bitwarden + # cura + czkawka discord - etcher + # etcher firefox - font-manager - freecad - fslint - homebank + # font-manager + # freecad + # homebank insomnia - kdenlive + # kdenlive libreoffice lutris - # mangohud meld # obs-studio pinta - prusa-slicer - rpi-imager + # prusa-slicer + # rpi-imager signal-desktop + steam solaar spotify - steam - teams + # teams virtmanager vulkan-tools wine diff --git a/configs/user-gui.nix b/configs/user-gui.nix index f1e0956..7a7aaff 100644 --- a/configs/user-gui.nix +++ b/configs/user-gui.nix @@ -60,6 +60,35 @@ in }/bin/git-credential-libsecret"; }; }; + + kitty = { + enable = true; + extraConfig = '' + enable_audio_bell false + + background #000000 + foreground #e9e9e9 + cursor #e9e9e9 + selection_background #424242 + color0 #000000 + color8 #000000 + color1 #d44d53 + color9 #d44d53 + color2 #b9c949 + color10 #b9c949 + color3 #e6c446 + color11 #e6c446 + color4 #79a6da + color12 #79a6da + color5 #c396d7 + color13 #c396d7 + color6 #70c0b1 + color14 #70c0b1 + color7 #fffefe + color15 #fffefe + selection_foreground #000000 + ''; + }; }; }; } diff --git a/configs/user.nix b/configs/user.nix index f521e2a..d2460e9 100644 --- a/configs/user.nix +++ b/configs/user.nix @@ -24,9 +24,11 @@ in "nginx" "scanner" "adbusers" + "locatedb" ]; openssh.authorizedKeys.keys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDPSzeNjfkz7/B/18TcJxxmNFUhvTKoieBcexdzebWH7oncvyBXNRJp8vAqSIVFLzz5UUFQNFuilggs8/N48U84acmFOxlbUmxlkf8KZgeB/G6uQ8ncQh6M1HNNPH+9apTURgfctr7eEZe9seLIEBISQLXB2Sf3F1ogfDj25S8kH9RM4wM1/jDFK5IecWHScKxwQPmCoXeGE1LEJq6nkQLXMDsWhSihtWouaTxSR0p7/wp/Rqt/hzLEWj8e3+qLMc5JrrdaWksupUCysme7CnSfGSzNUv9RKiRCTFofYPT9tbRn5JzdpQ55v22S6OvmmXUHjST1MOzI8MpVPZCCqd/ZQ1E+gErFiMwjG4sn/xxdPK9/jbQaXMjLklbKtR+C5090Ew2u2kj78jqGk/8COhF1MXh/9qjcG+C51uD1AS9d410kfjPwkaUt4U2KktDMQ942nWywrvIWM0Gt2kgDLYotsy/70q/aTJ8bvaCoWoDOGmpWcyNNBalz4OYYGI2Z0WHrVTs0FpzSk/XeQz0OLkmueoh5GDGd8zrfO6Nf5LWI17aWGRePTpQP5mJIg6jC3j8/QVrthEP6QyIIkZsnfsmvSiMWVfXqEy1BxVlu3T6aLffaj679KCsxY+mx5mTH2hwd4ZdbSI4F0GCIt+WGaFhHs2V3ZQitoEZuraRPEc4HGw== alexander@szczepan.ski" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOYEaT0gH9yJM2Al0B+VGXdZB/b2qjZK7n01Weq0TcmQ alex@framework" ]; }; }; diff --git a/machine/framework.nix b/machine/framework.nix new file mode 100644 index 0000000..b2f846a --- /dev/null +++ b/machine/framework.nix @@ -0,0 +1,119 @@ +{ config, pkgs, lib, ... }: +let +in +{ + imports = + [ + + /etc/nixos/hardware-configuration.nix + ../configs/gui.nix + ../configs/docker.nix + ../configs/libvirt.nix + ../configs/common.nix + ../configs/user.nix + ../configs/user-gui.nix + ../configs/user-gui-applications.nix + ../configs/pantheon.nix + + ]; + + boot = { + initrd.systemd.enable = true; + loader = { + systemd-boot.enable = true; + efi = { + canTouchEfiVariables = true; + }; + }; + plymouth.enable = true; + }; + + nixpkgs.config.packageOverrides = pkgs: { + vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; }; + }; + + + networking.hostName = "framework"; # Define your hostname. + time.timeZone = "Europe/Berlin"; + + hardware = { + enableAllFirmware = true; + cpu.intel.updateMicrocode = true; + opengl = { + enable = true; + driSupport32Bit = true; + extraPackages = with pkgs; [ + intel-media-driver # LIBVA_DRIVER_NAME=iHD + vaapiIntel # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium) + vaapiVdpau + libvdpau-va-gl + ]; + }; + }; + + # Enable sound. + sound.enable = true; + hardware.pulseaudio = { + enable = true; + support32Bit = true; + }; + + services = { + power-profiles-daemon.enable = true; + auto-cpufreq.enable = true; + + # # Enable fractional scaling + # xserver.desktopManager.gnome = { + # extraGSettingsOverrides = '' + # [org.gnome.mutter] + # experimental-features=['scale-monitor-framebuffer'] + # ''; + # extraGSettingsOverridePackages = [ pkgs.gnome.mutter ]; + # }; + }; + + powerManagement = { + enable = true; + powertop.enable = true; + }; + + systemd.extraConfig = '' + DefaultTimeoutStopSec=10s + ''; + + # # Set display settings with 150% fractional scaling + # systemd.tmpfiles.rules = [ + # "L+ /run/gdm/.config/monitors.xml - - - - ${pkgs.writeText "gdm-monitors.xml" '' + # + # + # + # 0 + # 0 + # 1.5009980201721191 + # yes + # + # + # eDP-1 + # BOE + # 0x095f + # 0x00000000 + # + # + # 2256 + # 1504 + # 59.999 + # + # + # + # + # + # ''}" + # ]; + + environment.systemPackages = with pkgs; [ + intel-gpu-tools + powertop + ]; + + system.stateVersion = "23.05"; +} diff --git a/machine/homeserver.nix b/machine/homeserver.nix index 8bebb3b..aedd4ad 100644 --- a/machine/homeserver.nix +++ b/machine/homeserver.nix @@ -91,6 +91,7 @@ nixpkgs.config.packageOverrides = pkgs: { vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; }; }; + hardware.opengl = { enable = true; extraPackages = with pkgs; [