From 322016864dd0c7345713b88ccda94bf568931e7d Mon Sep 17 00:00:00 2001 From: Daniel Bulant Date: Sun, 1 Sep 2024 15:44:37 +0200 Subject: [PATCH] updates and fixes --- .config/hypr/hyprland.conf | 3 ++ README.md | 5 ++++ configuration.nix | 61 +++++++++++++++++++++++++------------- flake.nix | 23 ++++++++++++++ home.nix | 1 + sync-nix.sh | 2 +- 6 files changed, 74 insertions(+), 21 deletions(-) create mode 100644 flake.nix diff --git a/.config/hypr/hyprland.conf b/.config/hypr/hyprland.conf index 422676a..49bcc70 100644 --- a/.config/hypr/hyprland.conf +++ b/.config/hypr/hyprland.conf @@ -16,6 +16,9 @@ #env = __GLX_VENDOR_LIBRARY_NAME,nvidia #cursor { no_hardware_cursors = true } +env = AQ_DRM_DEVICES,/dev/dri/card1 +monitor=,preferred,auto,1 + source = ~/.config/hypr/monitors.conf source = ~/.config/hypr/workspaces.conf diff --git a/README.md b/README.md index d1b5354..d875880 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,11 @@ For base setup, only `hyprland`, `rofi`, `waybar` and `swaylock`/`swaylock-effec ## General notes +## Setting up + +Run `sync-nix.sh`, it will copy configurations and run nixos-rebuild. +If you don't want to build hyprland yourself and instead use cache, comment out programs.hyprland in configuration first, sync, then un-comment it and sync again. + ### Lock screen Lock screen doesn't show what you type, it just changes it's circle for each character. If you delete all the input, it will show "cleared". diff --git a/configuration.nix b/configuration.nix index 92446c9..6e36c8a 100644 --- a/configuration.nix +++ b/configuration.nix @@ -2,27 +2,31 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, pkgs, lib, ... }: -let - unstable-pkgs = import {}; -in +{ config, pkgs, hyprland, nixpkgs-unstable, lib, nixos-hardware, zen-browser/*, kwin-effects-forceblur*/, ... }: +# let + # unstable-pkgs = nixpkgs-unstable.legacyPackages.x86_64-linux; #import nixpkgs-unstable.nixosModules.readOnlyPkgs {}; + # unstable-pkgs = hyprland.inputs.nixpkgs.legacyPackages.${pkgs.stdenv.hostPlatform.system}; +# in { imports = [ - # # this is borked in latest update for some reason, edid doesn't build - - - - - - - + # nixos-hardware.lenovo-legion-16ach6h-hybrid # this is borked in latest update for some reason, edid doesn't build + nixos-hardware.nixosModules.common-cpu-amd + nixos-hardware.nixosModules.common-cpu-amd-pstate + nixos-hardware.nixosModules.common-cpu-amd-zenpower + nixos-hardware.nixosModules.common-gpu-amd + nixos-hardware.nixosModules.common-gpu-nvidia + nixos-hardware.nixosModules.common-pc-laptop + nixos-hardware.nixosModules.common-pc-laptop-ssd ./hardware-configuration.nix - ./cachix.nix ]; - # Bootloader. + nixpkgs.config.permittedInsecurePackages = [ + "olm-3.2.16" + ]; + + boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; boot.supportedFilesystems = [ "ntfs" ]; @@ -64,7 +68,6 @@ in layout = "us"; variant = ""; }; - #libinput.enable = true; }; services.printing.enable = true; @@ -76,7 +79,6 @@ in alsa.enable = true; alsa.support32Bit = true; pulse.enable = true; - #jack.enable = true; }; security.pam.loginLimits = [{ domain = "*"; @@ -100,7 +102,7 @@ in shell = pkgs.fish; packages = with pkgs; [ kdePackages.kate - # thunderbird + zen-browser.packages."${system}".specific ]; }; home-manager.useGlobalPkgs = true; @@ -110,8 +112,20 @@ in environment.sessionVariables.DEFAULT_BROWSER = "firefox"; programs.firefox.enable = true; - programs.hyprland.enable = true; - programs.hyprland.package = unstable-pkgs.hyprland; + nix.settings = { + substituters = ["https://hyprland.cachix.org"]; + trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="]; + }; + + # Comment out below for the first time to avoid cache miss, if using flake + programs.hyprland = { + enable = true; + package = hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland; + # package = unstable-pkgs.hyprland; + }; + # End comment out + + # programs.hyprland.enable = true; programs.hyprlock.enable = true; services.hypridle.enable = true; programs.fish.enable = true; @@ -139,10 +153,17 @@ in nixpkgs.config.cudaSupport = true; # The nvidia fun part - hardware.opengl.enable = true; + hardware.opengl = { + enable = true; + # package = unstable-pkgs.mesa.drivers; + # Steam support + driSupport32Bit = true; + # package32 = unstable-pkgs.pkgsi686Linux.mesa.drivers; + }; boot.kernelModules = ["amdgpu"]; hardware.nvidia = { + open = false; modesetting.enable = true; powerManagement.enable = true; prime = { diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..55a213a --- /dev/null +++ b/flake.nix @@ -0,0 +1,23 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; + zen-browser.url = "github:MarceColl/zen-browser-flake"; + nixos-hardware.url = "github:NixOS/nixos-hardware"; + hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; + home-manager.url = "github:nix-community/home-manager/release-24.05"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + # kwin-effects-forceblur.url = "https://gist.githubusercontent.com/taj-ny/c1abdde710f33e34dc39dc53a5dc2c09/raw/7078265012c37b6f6bc397e9a7893bc6004e7b6c/kwin-effects-forceblur.nix"; + }; + + outputs = { nixpkgs, ... }@attrs: { + nixosConfigurations.lenovo-nix = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = attrs; + modules = with attrs; [ + home-manager.nixosModules.default + ./configuration.nix + ]; + }; + }; +} \ No newline at end of file diff --git a/home.nix b/home.nix index 9e8b880..2ff6e8f 100644 --- a/home.nix +++ b/home.nix @@ -8,6 +8,7 @@ in packages = with pkgs; [ # acpilight + nix-top grc onefetch fira diff --git a/sync-nix.sh b/sync-nix.sh index aff4236..2136918 100755 --- a/sync-nix.sh +++ b/sync-nix.sh @@ -2,4 +2,4 @@ echo "Copying configurations" cp .config/* ~/.config/ -r cp .default-python-packages ~ sudo cp *.nix /etc/nixos/ -sudo nixos-rebuild switch \ No newline at end of file +sudo nixos-rebuild switch --show-trace --recreate-lock-file