From 8ea95b95d635df0deb735d8be450a17fcf7074c0 Mon Sep 17 00:00:00 2001 From: Alexander Szczepanski Date: Wed, 28 Jun 2023 12:47:21 +0200 Subject: [PATCH] 2023-06-28-12-47-21 --- configs/common.nix | 2 +- configs/gui.nix | 11 +--- configs/pantheon.nix | 39 ++++++++++++- configs/plasma.nix | 9 +++ configs/printing.nix | 9 +++ configs/user-gui-applications.nix | 75 +++++++++++++------------ configs/user-gui.nix | 13 ----- configs/user.nix | 14 +---- machine/framework.nix | 93 +++++++++++++++++-------------- 9 files changed, 150 insertions(+), 115 deletions(-) create mode 100644 configs/plasma.nix create mode 100644 configs/printing.nix diff --git a/configs/common.nix b/configs/common.nix index d65e7f8..e0d5482 100644 --- a/configs/common.nix +++ b/configs/common.nix @@ -6,6 +6,7 @@ in { services = { vnstat.enable = true; tuptime.enable = true; + locate.enable = true; openssh = { enable = true; settings = { @@ -64,7 +65,6 @@ in { lsd lsof man-pages - mlocate nethogs nil nix-du diff --git a/configs/gui.nix b/configs/gui.nix index 70fd3ef..5f3755c 100644 --- a/configs/gui.nix +++ b/configs/gui.nix @@ -17,14 +17,10 @@ in }; environment.systemPackages = with unstable.pkgs; [ - # brave - # fswebcam glxinfo gparted libsecret - # networkmanager-openconnect # openconnect - # pulseaudio-ctl gnome.simple-scan ]; @@ -51,6 +47,7 @@ in corefonts google-fonts liberation_ttf + gyre-fonts noto-fonts noto-fonts-cjk noto-fonts-emoji @@ -77,13 +74,9 @@ in hardware.sane.enable = true; services = { - # mullvad-vpn.enable = true; + mullvad-vpn.enable = true; gvfs.enable = true; # udev.packages = with pkgs; [ gnome.gnome-settings-daemon ]; - printing = { - enable = true; - drivers = [ pkgs.brlaser ]; - }; etesync-dav = { enable = true; apiUrl = "https://etesync.szczepan.ski/"; diff --git a/configs/pantheon.nix b/configs/pantheon.nix index b2448ef..3941217 100644 --- a/configs/pantheon.nix +++ b/configs/pantheon.nix @@ -17,7 +17,10 @@ desktopManager.pantheon = { enable = true; - extraWingpanelIndicators = with pkgs; [ wingpanel-indicator-ayatana ]; + extraWingpanelIndicators = with pkgs; [ + monitor + wingpanel-indicator-ayatana + ]; }; layout = "us"; @@ -28,8 +31,40 @@ }; }; + systemd.user.services = { + monitor = { + description = "indicator-monitor"; + wantedBy = [ "graphical-session.target" ]; + partOf = [ "graphical-session.target" ]; + serviceConfig = { + ExecStart = "${pkgs.monitor}/bin/com.github.stsdc.monitor"; + }; + }; + + indicatorapp = { + description = "indicator-application-gtk3"; + wantedBy = [ "graphical-session.target" ]; + partOf = [ "graphical-session.target" ]; + serviceConfig = { + ExecStart = "${pkgs.indicator-application-gtk3}/libexec/indicator-application/indicator-application-service"; + }; + }; + }; + # App indicator environment.pathsToLink = [ "/libexec" ]; - environment.systemPackages = with pkgs; [ indicator-application-gtk3 ]; + environment.systemPackages = with pkgs; [ + blackbox-terminal + cinnamon.nemo-with-extensions + gnome-online-accounts + gnome.gnome-control-center + gnome.gnome-system-monitor + indicator-application-gtk3 + monitor + ulauncher + ]; + environment.pantheon.excludePackages = with pkgs.pantheon; [ + elementary-code + ]; } diff --git a/configs/plasma.nix b/configs/plasma.nix new file mode 100644 index 0000000..039f5b0 --- /dev/null +++ b/configs/plasma.nix @@ -0,0 +1,9 @@ +{ config, pkgs, lib, ... }: + +{ + programs.dconf.enable = true; + + services.xserver.enable = true; + services.xserver.displayManager.sddm.enable = true; + services.xserver.desktopManager.plasma5.enable = true; +} diff --git a/configs/printing.nix b/configs/printing.nix new file mode 100644 index 0000000..0b0cf85 --- /dev/null +++ b/configs/printing.nix @@ -0,0 +1,9 @@ +{ config, pkgs, lib, ... }: +{ + services = { + printing = { + enable = true; + drivers = [ pkgs.brlaser ]; + }; + }; +} diff --git a/configs/user-gui-applications.nix b/configs/user-gui-applications.nix index 86034e8..9b0e30f 100644 --- a/configs/user-gui-applications.nix +++ b/configs/user-gui-applications.nix @@ -11,47 +11,50 @@ let extraPkgs = pkgs: with unstable.pkgs; [ gamescope mangohud + ncurses6 ]; }; + lutris = pkgs.lutris.override { + extraPkgs = pkgs: with unstable.pkgs; [ + gamescope + mangohud + ]; + }; + }; }; in { - imports = [ ]; - - home-manager.users.alex = { pkgs, ... }: { - home = { - packages = with unstable.pkgs; [ - brave - chromium - # bitwarden - # cura - czkawka - discord - # etcher - firefox - # font-manager - # freecad - # homebank - insomnia - # kdenlive - libreoffice - lutris - meld - # obs-studio - pinta - # prusa-slicer - # rpi-imager - signal-desktop - steam - solaar - spotify - # teams - virtmanager - vulkan-tools - wine - winetricks - ]; - }; + programs.steam = { + enable = true; + package = unstable.pkgs.steam; }; + + environment.systemPackages = with unstable.pkgs; [ + brave + catfish + chromium + czkawka # fslint before + discord + espeak-ng + firefox + handbrake + insomnia + libreoffice + librewolf + lutris + meld + nextcloud-client + pinta + signal-desktop + solaar + remmina + spotify + tor-browser-bundle-bin + virtmanager + vulkan-tools + wine + winetricks + + ]; } diff --git a/configs/user-gui.nix b/configs/user-gui.nix index 7a7aaff..9831909 100644 --- a/configs/user-gui.nix +++ b/configs/user-gui.nix @@ -28,19 +28,6 @@ in vscode = { enable = true; package = unstable.pkgs.vscode; - # extensions = with unstable.pkgs.vscode-extensions; [ - # bbenoist.nix - # eamodio.gitlens - # editorconfig.editorconfig - # ms-azuretools.vscode-docker - # # ms-vsliveshare.vsliveshare - # # ms-vscode.cpptools - # mskelton.one-dark-theme - # ms-kubernetes-tools.vscode-kubernetes-tools - # ryu1kn.partial-diff - # jnoortheen.nix-ide - # brettm12345.nixfmt-vscode - # ]; }; diff --git a/configs/user.nix b/configs/user.nix index d2460e9..9c88f51 100644 --- a/configs/user.nix +++ b/configs/user.nix @@ -94,19 +94,9 @@ in forwardAgent = true; matchBlocks."szczepan.ski" = { hostname = "207.180.220.97"; }; - - matchBlocks."nixos-vm" = { - hostname = "192.168.122.222"; - remoteForwards = [{ - bind.address = "/run/user/1000/gnupg/S.gpg-agent"; - host.address = "/run/user/1000/gnupg/S.gpg-agent"; - }]; - }; - - matchBlocks."mini" = { hostname = "192.168.0.101"; }; - + matchBlocks."mini" = { hostname = "10.100.0.3"; }; + matchBlocks."thinkpad" = { hostname = "10.100.0.8"; }; matchBlocks."pi" = { hostname = "192.168.1.143"; }; - matchBlocks."router" = { hostname = "192.168.1.1"; user = "root"; diff --git a/machine/framework.nix b/machine/framework.nix index b2f846a..33fb3b3 100644 --- a/machine/framework.nix +++ b/machine/framework.nix @@ -1,5 +1,5 @@ { config, pkgs, lib, ... }: -let +let secrets = import ../configs/secrets.nix; in { imports = @@ -32,8 +32,32 @@ in vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; }; }; + # nixpkgs.localSystem = { + # gcc.arch = "alderlake"; + # gcc.tune = "alderlake"; + # system = "x86_64-linux"; + # }; + nix.settings.system-features = [ "nixos-test" "benchmark" "big-parallel" "kvm" "gccarch-alderlake" ]; +# programs.nix-ld.enable = true; + + networking = { + hostName = "framework"; + wireguard.interfaces = { + wg0 = { + ips = [ "10.100.0.7/24" ]; + privateKey = secrets.wireguard-framework-private; + + peers = [{ + publicKey = secrets.wireguard-vps-public; + presharedKey = secrets.wireguard-preshared; + allowedIPs = [ "10.100.0.0/24" ]; + endpoint = "szczepan.ski:51820"; + persistentKeepalive = 25; + }]; + }; + }; + }; - networking.hostName = "framework"; # Define your hostname. time.timeZone = "Europe/Berlin"; hardware = { @@ -60,16 +84,8 @@ in 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 ]; - # }; + auto-cpufreq.enable = false; + thermald.enable = false; }; powerManagement = { @@ -81,39 +97,32 @@ in 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 ]; + # Set up deep sleep + hibernation + swapDevices = [ + { device = "/swapfile"; } + ]; + + # Partition swapfile is on (after LUKS decryption) + boot.resumeDevice = "/dev/disk/by-uuid/ab1126e8-ae5a-4313-a520-4dc267fea528"; + + # Resume Offset is offset of swapfile + # https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Hibernation_into_swap_file + boot.kernelParams = [ "mem_sleep_default=deep" "resume_offset=128563200" ]; + + # Suspend-then-hibernate everywhere + services.logind = { + lidSwitch = "suspend-then-hibernate"; + extraConfig = '' + HandlePowerKey=suspend-then-hibernate + IdleAction=suspend-then-hibernate + IdleActionSec=2m + ''; + }; + systemd.sleep.extraConfig = "HibernateDelaySec=60m"; + system.stateVersion = "23.05"; }