From a6d2cbad1a206a7ec2323c3bc58c5bbc30008df9 Mon Sep 17 00:00:00 2001 From: Yusuf Bera Ertan Date: Mon, 18 Jul 2022 19:34:54 +0300 Subject: [PATCH] new host pog --- flake.lock | 17 +++ flake.nix | 2 + hosts/default.nix | 1 + hosts/tkaronto/default.nix | 170 +++++++++++++++++++++++++++++ pkgs-set/overlays/discord.nix | 21 ++++ users/modules/hyprland/default.nix | 4 +- users/patriot/default.nix | 4 +- 7 files changed, 214 insertions(+), 5 deletions(-) create mode 100644 hosts/tkaronto/default.nix create mode 100644 pkgs-set/overlays/discord.nix diff --git a/flake.lock b/flake.lock index 052f9af..a7deef2 100644 --- a/flake.lock +++ b/flake.lock @@ -110,6 +110,22 @@ "type": "github" } }, + "fufexan": { + "flake": false, + "locked": { + "lastModified": 1657711492, + "narHash": "sha256-t7WLSMPXWs+TR8/ZWvyoUR5h0nrSWQryNmpS/+00DtM=", + "owner": "fufexan", + "repo": "dotfiles", + "rev": "90b4e7452b41aaf18026b5ad46601597e8ec8dcd", + "type": "github" + }, + "original": { + "owner": "fufexan", + "repo": "dotfiles", + "type": "github" + } + }, "helix": { "inputs": { "nixCargoIntegration": "nixCargoIntegration", @@ -265,6 +281,7 @@ }, "root": { "inputs": { + "fufexan": "fufexan", "helix": "helix", "home": "home", "hyprland": "hyprland", diff --git a/flake.nix b/flake.nix index c7b06b4..589406b 100644 --- a/flake.nix +++ b/flake.nix @@ -18,6 +18,8 @@ helix.inputs.nixpkgs.follows = "nixpkgs"; hyprland.url = "github:hyprwm/Hyprland"; hyprland.inputs.nixpkgs.follows = "nixpkgs"; + fufexan.url = "github:fufexan/dotfiles"; + fufexan.flake = false; }; outputs = inputs: let diff --git a/hosts/default.nix b/hosts/default.nix index e04d995..ff6418d 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -28,6 +28,7 @@ systems = { lungmen = "x86_64-linux"; + tkaronto = "x86_64-linux"; }; in lib.mapAttrs mkSystem systems diff --git a/hosts/tkaronto/default.nix b/hosts/tkaronto/default.nix new file mode 100644 index 0000000..ed76dcb --- /dev/null +++ b/hosts/tkaronto/default.nix @@ -0,0 +1,170 @@ +{ + config, + lib, + pkgs, + inputs, + ... +}: +let + byLabel = label: "/dev/disk/by-label/${label}"; +in +{ + imports = with inputs; + with nixos-hardware.nixosModules; [ + nixpkgs.nixosModules.notDetected + nixos-persistence.nixosModule + common-pc-ssd + common-pc-laptop + common-gpu-nvidia + common-gpu-amd + common-cpu-amd + ../../modules/persist + ../../modules/network/iwd.nix + #../../modules/develop/nixbuild + ../../users/root + ../../users/patriot + ]; + + system.persistDir = "/persist"; + + boot = { + tmpOnTmpfs = true; + loader = { + efi.canTouchEfiVariables = true; + systemd-boot.enable = true; + systemd-boot.configurationLimit = 10; + }; + kernelPackages = pkgs.linuxPackages_latest; + supportedFilesystems = ["f2fs"]; + initrd = { + availableKernelModules = [ + "nvme" + "xhci_pci" + "ahci" + "usb_storage" + "usbhid" + "sd_mod" + ]; + kernelModules = ["amdgpu"]; + }; + kernelModules = ["kvm-amd"]; + extraModulePackages = []; + kernel.sysctl = {"fs.inotify.max_user_watches" = 524288;}; + }; + + fileSystems."/" = { + device = "none"; + fsType = "tmpfs"; + options = ["defaults" "size=2G" "mode=755"]; + }; + fileSystems."/nix" = { + device = byLabel "NIX"; + fsType = "f2fs"; + }; + fileSystems."${config.system.persistDir}" = { + device = byLabel "PERSIST"; + fsType = "f2fs"; + neededForBoot = true; + }; + fileSystems."/boot" = { + device = byLabel "BOOT"; + fsType = "vfat"; + }; + + swapDevices = []; + zramSwap = { + enable = true; + algorithm = "zstd"; + }; + + nix.settings.max-jobs = lib.mkDefault 8; + security = { + pam.loginLimits = [ + { + domain = "*"; + type = "soft"; + item = "nofile"; + value = "524288"; + } + { + domain = "*"; + type = "hard"; + item = "nofile"; + value = "524288"; + } + ]; + allowSimultaneousMultithreading = true; + # Deleting root subvolume makes sudo show lecture every boot + sudo.extraConfig = '' + Defaults lecture = never + ''; + rtkit.enable = true; + }; + + sound.enable = false; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + hardware = { + opengl = { + driSupport = true; + driSupport32Bit = true; + enable = true; + extraPackages = with pkgs; [ + libvdpau-va-gl + vaapiVdpau + libva + vulkan-loader + ]; + extraPackages32 = with pkgs.pkgsi686Linux; + [ + libvdpau-va-gl + vaapiVdpau + libva + vulkan-loader + ]; + }; + pulseaudio = { + enable = false; + support32Bit = true; + }; + }; + + fonts = { + enableDefaultFonts = true; + fontconfig.enable = true; + fonts = [pkgs.dejavu_fonts]; + }; + + environment = { + systemPackages = [pkgs.ntfs3g]; + pathsToLink = ["/share/zsh"]; + persistence."${config.system.persistDir}" = { + directories = ["/etc/nixos"]; + files = ["/etc/machine-id"]; + }; + }; + + networking.firewall.checkReversePath = "loose"; + services = { + earlyoom.enable = true; + tailscale.enable = false; + ipfs = { + enable = false; + enableGC = true; + autoMount = true; + }; + flatpak.enable = false; + }; + + virtualisation = { + waydroid.enable = false; + podman.enable = false; + libvirtd.enable = false; + }; + + system.stateVersion = "22.05"; +} diff --git a/pkgs-set/overlays/discord.nix b/pkgs-set/overlays/discord.nix new file mode 100644 index 0000000..6e2fb91 --- /dev/null +++ b/pkgs-set/overlays/discord.nix @@ -0,0 +1,21 @@ +{inputs}: final: prev: { + discord-open-asar = final.callPackage "${inputs.fufexan}/pkgs/discord" { + inherit (prev.discord) pname version src; + + openasar = prev.callPackage "${inputs.nixpkgs}/pkgs/applications/networking/instant-messengers/discord/openasar.nix" {}; + binaryName = "Discord"; + desktopName = "Discord"; + + isWayland = false; + enableVulkan = false; + extraOptions = [ + "--disable-gpu-memory-buffer-video-frames" + "--enable-accelerated-mjpeg-decode" + "--enable-accelerated-video" + "--enable-gpu-rasterization" + "--enable-native-gpu-memory-buffers" + "--enable-zero-copy" + "--ignore-gpu-blocklist" + ]; + }; +} diff --git a/users/modules/hyprland/default.nix b/users/modules/hyprland/default.nix index 2a5bb73..f3f649b 100644 --- a/users/modules/hyprland/default.nix +++ b/users/modules/hyprland/default.nix @@ -28,8 +28,8 @@ ''; in '' # should be configured per-profile - monitor=HDMI-A-1,1920x1080@60,0x0,1 - workspace=HDMI-A-1,1 + monitor=,2560x1600@120,0x0,1.6 + workspace=,1 exec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY DISPLAY HYPRLAND_INSTANCE_SIGNATURE exec-once=systemctl --user start graphical-session-pre.target exec-once=systemctl --user start graphical-session.target diff --git a/users/patriot/default.nix b/users/patriot/default.nix index 1e0b0fd..97bbb72 100644 --- a/users/patriot/default.nix +++ b/users/patriot/default.nix @@ -175,9 +175,7 @@ in { # polymc cloudflared lutris - (pkgs.discord.override { - withOpenASAR = true; - }) + discord-open-asar ]; shellAliases = nixosConfig.environment.shellAliases