diff --git a/flake.nix b/flake.nix index 9c8c97c..1eaa1cd 100755 --- a/flake.nix +++ b/flake.nix @@ -48,8 +48,8 @@ inputs.nixpkgs.follows = "nixpkgs"; }; - nix-qml-support = { - url = "git+https://git.outfoxxed.me/outfoxxed/nix-qml-support"; + walker = { + url = "github:abenz1267/walker"; inputs.nixpkgs.follows = "nixpkgs"; }; @@ -75,7 +75,6 @@ ./modules/devenv ./modules/system.nix ./modules/hyprland - ./modules/xserver ./systems/msi ]; }; diff --git a/modules/core/default.nix b/modules/core/default.nix index b5a3820..d5591d4 100644 --- a/modules/core/default.nix +++ b/modules/core/default.nix @@ -1,23 +1,14 @@ -{ inputs, lib, pkgs, ... }: { +{ inputs, pkgs, ... }: { boot.loader = { systemd-boot.enable = true; efi.canTouchEfiVariables = true; }; - nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ - "osu-lazer-bin" - "unrar" - "steam" - "steam-original" - "corefonts" - "vista-fonts" - "steam-unwrapped" - ]; + nixpkgs.config.allowUnfree = true; nixpkgs.config.permittedInsecurePackages = [ - "jitsi-meet-1.0.8043" - "electron-28.3.3" - "electron-27.3.11" + "electron-24.8.6" + "electron-25.9.0" ]; documentation = { @@ -34,10 +25,8 @@ ]; nix = { - settings = { - # hardlink duplicate files in the nix store - auto-optimise-store = true; - }; + # hardlink duplicate files in the nix store + settings.auto-optimise-store = true; extraOptions = '' experimental-features = nix-command flakes @@ -45,8 +34,6 @@ # keep intermediary deps alive (no redownloading to rebuild after gc) keep-outputs = true keep-derivations = true - - builders-use-substitutes = true ''; # flake registries are used by the new nix commands. @@ -62,18 +49,6 @@ "nixpkgs=/etc/nix/inputs/nixpkgs" "stable=/etc/nix/inputs/stable" ]; - - distributedBuilds = true; - buildMachines = [ { - hostName = "192.168.2.1"; - system = "x86_64-linux"; - protocol = "ssh-ng"; - supportedFeatures = [ "big-parallel" "kvm" "nixos-test" "benchmark" ]; - speedFactor = 100; - maxJobs = 16; - sshUser = "nix-remote-build"; - sshKey = "/root/.ssh/id_build_server"; - } ]; }; # add entries for `nixPath` above. diff --git a/modules/emacs/default.nix b/modules/emacs/default.nix index 68acdf3..5fca514 100644 --- a/modules/emacs/default.nix +++ b/modules/emacs/default.nix @@ -7,13 +7,13 @@ (final: prev: { tree-sitter = prev.tree-sitter.override { extraGrammars = { - tree-sitter-astro = { + tree-sitter-qmljs = { version = "master"; src = pkgs.fetchFromGitHub { - owner = "virchau13"; - repo = "tree-sitter-astro"; - rev = "4be180759ec13651f72bacee65fa477c64222a1a"; - sha256 = "qc9InFEQgeFfFReJuQd8WjTNK4fFMEaWcqQUcGxxuBI="; + owner = "yuja"; + repo = "tree-sitter-qmljs"; + rev = "35ead5b9955cdb29bcf709d622fa960ff33992b6"; + sha256 = "jT47lEGuk6YUjcHB0ZMyL3i5PqyUaCQmt0j78cUpy8Q="; }; }; }; @@ -47,7 +47,7 @@ tree-sitter-nix tree-sitter-prisma tree-sitter-python - inputs.nix-qml-support.packages.${pkgs.stdenv.system}.tree-sitter-qmljs + tree-sitter-qmljs tree-sitter-regex tree-sitter-rust tree-sitter-scss @@ -55,14 +55,24 @@ tree-sitter-toml tree-sitter-tsx tree-sitter-typescript - tree-sitter-astro tree-sitter-vim tree-sitter-yaml ]; custom-emacs = with newpkgs; - ((emacsPackagesFor (emacs29-pgtk.override { withNativeCompilation = true; })).emacsWithPackages (epkgs: with epkgs; [ + ((emacsPackagesFor (emacs29-pgtk.override { withNativeCompilation = true; })).emacsWithPackages (epkgs: with epkgs; let + qml-ts-mode = trivialBuild { + pname = "qml-ts-mode"; + version = "master"; + src = fetchFromGitHub { + owner = "outfoxxed"; + repo = "qml-ts-mode"; + rev = "b24b9e78305ed045baa136782623ad16de01b7b8"; + sha256 = "PgXm/a92cX5zjA9blTrIRH7DfOUczRwb9oBcMMEzF2I="; + }; + }; + in [ avy better-jumper company @@ -77,7 +87,6 @@ flycheck frames-only-mode fussy - glsl-mode groovy-mode just-mode kotlin-mode @@ -90,8 +99,7 @@ nasm-mode nix-mode reformatter # required by nix mode projectile - inputs.nix-qml-support.packages.${pkgs.stdenv.system}.qml-ts-mode - astro-ts-mode + qml-ts-mode rainbow-mode string-inflection (treesit-grammars.with-grammars (grammars: tree-sitter-parsers grammars)) diff --git a/modules/hyprland/default.nix b/modules/hyprland/default.nix index 4e81ee2..a317904 100644 --- a/modules/hyprland/default.nix +++ b/modules/hyprland/default.nix @@ -1,15 +1,11 @@ { system, inputs, impurity, lib, config, pkgs, ... }: let - inherit (inputs) hyprland hyprsunset hyprpicker hyprland-hy3 quickshell; - - exe = hyprland.packages.${system}.default.overrideAttrs (final: prev: { - dontStrip = true; - }); + inherit (inputs) hyprland hyprland-hy3 quickshell; # I blame home manager wrapper = pkgs.callPackage ({ ... }: pkgs.writeShellScriptBin "hyprland" '' ${builtins.readFile ./session.sh} ${config.hyprland-session.prerun} - ${lib.getExe exe} $@ + ${hyprland.packages.${system}.default}/bin/Hyprland $@ '') {}; in { imports = [ hyprland.nixosModules.default ]; @@ -24,12 +20,6 @@ in { type = types.separatedString "\n"; default = ""; }; - - # same as above but no impurity so the greeter works - extraConfigStatic = mkOption { - type = types.separatedString "\n"; - default = ""; - }; }; config = { @@ -64,10 +54,7 @@ in { grim slurp playerctl - wl-screenrec - - hyprsunset.packages.${system}.default - hyprpicker.packages.${system}.default + wf-recorder ]; wayland.windowManager.hyprland = { diff --git a/modules/hyprland/hyprland.conf b/modules/hyprland/hyprland.conf index 16d53e4..44bd308 100644 --- a/modules/hyprland/hyprland.conf +++ b/modules/hyprland/hyprland.conf @@ -1,4 +1,4 @@ -exec-once = qs -c shell +exec-once = quickshell -c shell exec = systemctl start --user emacs.service && emacsclient -e "(setenv \"HYPRLAND_INSTANCE_SIGNATURE\" \"$HYPRLAND_INSTANCE_SIGNATURE\")" @@ -17,6 +17,7 @@ input { kb_layout = us sensitivity = 0 follow_mouse = 1 + mouse_refocus = false accel_profile = flat } @@ -30,17 +31,13 @@ decoration { noise = 0.008 contrast = 0.8916 brightness = 0.8 - input_methods = yes } - shadow { - enabled = false - } + drop_shadow = no } animations { enabled = yes - first_launch_animation = no bezier = windowIn, 0.06, 0.71, 0.25, 1 bezier = windowResize, 0.04, 0.67, 0.38, 1 @@ -51,7 +48,7 @@ animations { animation = border, 1, 10, default animation = borderangle, 1, 8, default animation = fade, 1, 3, default - animation = workspaces, 1, 6, default, slidevert + animation = workspaces, 1, 6, default animation = layers, 1, 5, windowIn, slide } @@ -65,28 +62,22 @@ gestures { misc { disable_hyprland_logo = true disable_splash_rendering = true + vrr = 1 + no_direct_scanout = false key_press_enables_dpms = true } -render { - explicit_sync = true - #direct_scanout = true -} - binds { workspace_back_and_forth = true } plugin { hy3 { - tabs { - border_width = 1 - col.active = rgba(33ccff20) - col.border.active = rgba(33ccffee) - col.text.active = rgba(ffffffff) - col.inactive = rgba(30303020) - col.border.inactive = rgba(595959aa) - } + tabs { + height = 2 + padding = 6 + render_text = false + } autotile { enable = true @@ -96,13 +87,8 @@ plugin { } } -misc { - vfr = on -} - debug { disable_logs = no - overlay = off } monitor = , preferred, auto, 1 @@ -124,15 +110,10 @@ layerrule = animation fade, shell:background layerrule = blur, shell:bar layerrule = blurpopups, shell:bar layerrule = ignorezero, shell:bar -layerrule = blur, shell:notifications -layerrule = ignorezero, shell:notifications -layerrule = noanim, shell:notifications +layerrule = noanim, shell:bar layerrule = noanim, shell:screenshot -layerrule = blur, shell:launcher -layerrule = ignorezero, shell:launcher -layerrule = animation popin 90%, shell:launcher windowrulev2 = float, class:^(opensnitch_ui)$ windowrulev2 = dimaround, class:^(opensnitch_ui)$ @@ -144,12 +125,11 @@ windowrulev2 = float, class:^(org.freedesktop.impl.portal.desktop.kde)$ windowrulev2 = size 1000 700, class:^(org.freedesktop.impl.portal.desktop.kde)$ windowrulev2 = center, class:^(org.freedesktop.impl.portal.desktop.kde)$ windowrulev2 = dimaround, class:^(org.freedesktop.impl.portal.desktop.kde)$ -windowrulev2 = float, title:^(OpenSSH Authentication Passphrase request)$ windowrulev2 = float, class:^(AlacrittyFloating)$ $mod = SUPER -$launcher = qs msg -c shell launcher open +$launcher = walker bind = $mod+SHIFT, m, exit @@ -158,12 +138,12 @@ bind = $mod+SHIFT, return, exec, alacritty --class AlacrittyFloating bind = $mod, grave, exec, $launcher bind = $mod+SHIFT, q, hy3:killactive -bind = $mod+SHIFT, s, exec, qs msg -c shell screenshot takeScreenshot -bind = $mod, PERIOD, exec, qs msg -c shell lockscreen lock +bind = $mod+SHIFT, s, global, shell:screenshot +bind = $mod, c, global, shell:termselect +bind = $mod, PERIOD, exec, quickshell -c lockscreen bind = $mod, f, fullscreen, 1 bind = $mod+SHIFT, f, fullscreen, 0 -bind = $mod, tab, hy3:togglefocuslayer bind = $mod+SHIFT, tab, togglefloating bind = $mod, d, hy3:makegroup, h @@ -182,18 +162,10 @@ bindn = , mouse_down, hy3:focustab, l, require_hovered bindn = , mouse_up, hy3:focustab, r, require_hovered bind = $mod, q, hy3:warpcursor -bind = $mod, i, exec, hyprctl keyword plugin:hy3:tabs:height 20 -bind = $mod, i, exec, hyprctl keyword plugin:hy3:tabs:render_text true -bind = $mod, o, exec, hyprctl keyword plugin:hy3:tabs:height 20 -bind = $mod, o, exec, hyprctl keyword plugin:hy3:tabs:render_text true - -bindr = $mod, o, exec, hyprctl keyword plugin:hy3:tabs:height 2 -bindr = $mod, o, exec, hyprctl keyword plugin:hy3:tabs:render_text false - -bind = ,XF86AudioStop, exec, qs msg -c shell mpris pauseAll -bind = ,XF86AudioPlay, exec, qs msg -c shell mpris playPause -bind = ,XF86AudioNext, exec, qs msg -c shell mpris next -bind = ,XF86AudioPrev, exec, qs msg -c shell mpris previous +bind = ,XF86AudioPlay, exec, playerctl play-pause +bind = ,XF86AudioStop, exec, playerctl -a stop +bind = ,XF86AudioNext, exec, playerctl next +bind = ,XF86AudioPrev, exec, playerctl previous bind = $mod, h, hy3:movefocus, l bind = $mod, j, hy3:movefocus, d diff --git a/modules/hyprland/session.sh b/modules/hyprland/session.sh index 03af7d1..377765a 100644 --- a/modules/hyprland/session.sh +++ b/modules/hyprland/session.sh @@ -1,5 +1,7 @@ # session export XDG_SESSION_TYPE=wayland +export XDG_SESSION_DESKTOP=hyprland +export XDG_CURRENT_DESKTOP=hyprland # firefox export MOZ_ENABLE_WAYLAND=1 @@ -26,7 +28,7 @@ export NIXOS_OZONE_WL=1 # cursed dbus -dbus-update-activation-environment --systemd MOZ_ENABLE_WAYLAND MOZ_DBUS_REMOTE QT_QPA_PLATFORM QT_QPA_PLATFORMTHEME QT_WAYLAND_DISABLE_WINDOWDECORATION SDL_VIDEODRIVER _JAVA_AWT_WM_NONREPARENTING JDK_JAVA_OPTIONS XCURSOR_SIZE XCURSOR_THEME NIXOS_OZONE_WL +dbus-update-activation-environment --systemd MOZ_ENABLE_WAYLAND MOZ_DBUS_REMOTE QT_QPA_PLATFORM QT_QPA_PLATFORMTHEME QT_WAYLAND_DISABLE_WINDOWDECORATION SDL_VIDEODRIVER _JAVA_AWT_WM_NONREPARENTING JDK_JAVA_OPTIONS XCURSOR_SIZE XCURSOR_THEME # theme in dbus: # QT_PLUGIN_PATH=/lib/qt-ver/plugins + breeze will correctly set the theme. diff --git a/modules/system.nix b/modules/system.nix index 98fbb32..634b903 100644 --- a/modules/system.nix +++ b/modules/system.nix @@ -11,55 +11,35 @@ programs.dconf.enable = true; + #services.cpupower-gui.enable = true; + + # power management + services.tlp.enable = true; + + # battery status in ironbar services.upower.enable = true; - services.power-profiles-daemon.enable = true; environment.systemPackages = with pkgs; [ git - git-lfs vim ]; - services.ntp.enable = true; - networking = { networkmanager = { enable = true; - dns = lib.mkForce "systemd-resolved"; + dns = "systemd-resolved"; }; nameservers = [ "9.9.9.9" ]; - - useNetworkd = true; }; services.resolved = { enable = true; - #fallbackDns = [ "no" ]; - dnssec = "false"; - }; - - services.dnsmasq = { - enable = true; - resolveLocalQueries = false; - - settings = { - listen-address = "127.0.0.55"; - bind-interfaces = true; - address = [ "/foo.site/127.1.0.1" ]; - server = [ "9.9.9.9" ]; - }; - }; - - systemd.network = { - networks.wlp4s0 = { - matchConfig.Name = "wlp4s0"; - networkConfig.DHCP = "yes"; - dhcpV4Config.UseDNS = "no"; - dhcpV6Config.UseDNS = "no"; - }; - - wait-online.anyInterface = true; + dnssec = "true"; + fallbackDns = [ "9.9.9.9" ]; + extraConfig = '' + DNSOverTLS=yes + ''; }; # removable disks in file manager @@ -67,12 +47,4 @@ programs.adb.enable = true; users.users.${config.main-user}.extraGroups = [ "adbusers" ]; - - services.tailscale.enable = true; - - programs.gnupg.agent = { - enable = true; - enableSSHSupport = true; - enableExtraSocket = true; - }; } diff --git a/modules/user/dev-support.nix b/modules/user/dev-support.nix index c93011f..bccdef8 100644 --- a/modules/user/dev-support.nix +++ b/modules/user/dev-support.nix @@ -4,12 +4,10 @@ clang-tools_16 jdt-language-server kotlin-language-server - typescript-language-server - astro-language-server - glslls bear gdb + pwndbg ]; systemd.user.sessionVariables = { diff --git a/modules/user/general.nix b/modules/user/general.nix index 196d820..7898480 100644 --- a/modules/user/general.nix +++ b/modules/user/general.nix @@ -1,43 +1,15 @@ -{ lib, system, inputs, pkgs, config, ... }: { - imports = [ ./modules/greetd ]; - +{ system, inputs, pkgs, config, ... }: { system.extraDependencies = with pkgs; [ ungoogled-chromium ]; - environment.systemPackages = with pkgs; [ nix-output-monitor ]; - environment.sessionVariables.FLAKE = "/home/admin/nixnew"; - - programs.steam = { - enable = true; - extraCompatPackages = [ - pkgs.proton-ge-bin - ]; - }; - fonts = { enableDefaultPackages = false; - packages = (with inputs.stable.legacyPackages.${system}; [ + packages = with inputs.stable.legacyPackages.${system}; [ dejavu_fonts nerdfonts noto-fonts noto-fonts-cjk - ]) ++ (with pkgs; [ - corefonts - vistafonts - ]); - - fontconfig = { - defaultFonts = { - serif = [ "DejaVu Serif" ]; - sansSerif = [ "DejaVu Sans" ]; - monospace = [ "JetBrainsMono Nerd Font" ]; - }; - }; - }; - - programs.ssh = { - enableAskPassword = true; - askPassword = lib.getExe pkgs.lxqt.lxqt-openssh-askpass; + ]; }; systemd = { @@ -63,7 +35,7 @@ programs = { gnupg.agent = { enable = true; - pinentryPackage = pkgs.pinentry-qt; + pinentryFlavor = "gnome3"; }; kdeconnect = { package = pkgs.kdePackages.kdeconnect-kde; @@ -107,12 +79,13 @@ ]; home.packages = with pkgs; [ + kdePackages.ark kwrite krita gimp vlc mpv - qimgv + gpicview kdePackages.filelight kdePackages.kirigami kdePackages.kquickcharts # deps curl cantata @@ -123,22 +96,18 @@ htop btop speedcrunch - libreoffice-qt6 + libreoffice + nnn ripgrep qbittorrent signal-desktop anki-bin - kid3 - wireshark - mumble - freetube distrobox xdg-utils light unrar # used by ark - libnotify # test with it a lot ]; programs = { @@ -155,7 +124,7 @@ services = { mpd = { enable = true; - musicDirectory = "/pool/music"; + musicDirectory = "${homeConfig.home.homeDirectory}/Music"; network.startWhenNeeded = true; extraConfig = '' diff --git a/modules/user/modules/xserver/default.nix b/modules/user/modules/xserver/default.nix deleted file mode 100644 index 8b13789..0000000 --- a/modules/user/modules/xserver/default.nix +++ /dev/null @@ -1 +0,0 @@ - diff --git a/modules/xserver/default.nix b/modules/xserver/default.nix deleted file mode 100644 index 16a4372..0000000 --- a/modules/xserver/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ - services.xserver = { - enable = true; - logFile = null; - display = 7; - - libinput = { - enable = true; - mouse.accelProfile = "flat"; - }; - - displayManager.startx.enable = true; - }; -} diff --git a/systems/msi/default.nix b/systems/msi/default.nix index b121c73..7e7bea2 100644 --- a/systems/msi/default.nix +++ b/systems/msi/default.nix @@ -1,48 +1,12 @@ -{ config, pkgs, ... }: { +{ pkgs, ... }: { imports = [ ./hardware.nix + ./mullvad.nix ./hyprland ./mcontrolcenter.nix ]; - services.timesyncd.enable = true; - - services.sshd.enable = true; - system.stateVersion = "23.11"; networking.hostName = "msi"; time.timeZone = "America/Vancouver"; - programs.noisetorch.enable = true; - - home-manager.users.${config.main-user} = { - home.packages = with pkgs; [ - osu-lazer-bin - ]; - - services.blueman-applet.enable = true; - }; - - networking = { - firewall.allowedTCPPorts = [ - 40921 # bittorrent - 49775 # slsk - ]; - #nat.externalInterface = [ "wlp4s0" ]; - }; - - users.users.${config.main-user}.extraGroups = [ "docker" ]; - virtualisation.docker.enable = true; - - - boot.extraModulePackages = with config.boot.kernelPackages; [ - v4l2loopback - ]; - boot.extraModprobeConfig = '' - options v4l2loopback devices=1 video_nr=1 card_label="OBS Cam" exclusive_caps=1 - ''; - - boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; - - hardware.bluetooth.enable = true; - services.blueman.enable = true; } diff --git a/systems/msi/hardware-configuration.nix b/systems/msi/hardware-configuration.nix index 46d4c68..5056963 100644 --- a/systems/msi/hardware-configuration.nix +++ b/systems/msi/hardware-configuration.nix @@ -1,6 +1,6 @@ -# zfs: -# sudo zfs create -o mountpoint=legacy -o canmount=off -o atime=off -o compression=zstd -o sync=disabled -o casesensitivity=sensitive -o exec=on -o setuid=off -o xattr=sa -o devices=off pool/games -# sudo zfs create -o mountpoint=legacy -o canmount=off -o atime=off -o compression=zstd -o sync=disabled -o casesensitivity=sensitive -o exec=on -o setuid=off -o xattr=sa -o devices=off pool/torrents +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. { config, lib, pkgs, modulesPath, ... }: { @@ -13,11 +13,6 @@ boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; - boot.supportedFilesystems = [ "zfs" ]; - networking.hostId = "fd4421b3"; - systemd.services.zfs-mount.enable = false; - services.zfs.autoScrub.enable = true; - fileSystems."/" = { device = "/dev/disk/by-uuid/c9cb1730-c0d1-4a2e-a092-12dfa7098476"; fsType = "ext4"; @@ -28,21 +23,6 @@ fsType = "vfat"; }; - fileSystems."/pool/games" = { - fsType = "zfs"; - device = "pool/games"; - }; - - fileSystems."/pool/torrents" = { - fsType = "zfs"; - device = "pool/torrents"; - }; - - fileSystems."/pool/music" = { - fsType = "zfs"; - device = "pool/music"; - }; - swapDevices = [ ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking diff --git a/systems/msi/hardware.nix b/systems/msi/hardware.nix index 0c194af..a0a1b8c 100644 --- a/systems/msi/hardware.nix +++ b/systems/msi/hardware.nix @@ -1,22 +1,18 @@ { pkgs, ... }: { imports = [ ./hardware-configuration.nix ]; - environment.variables = { - VDPAU_DRIVER = "radeonsi"; - QT_MEDIA_BACKED = "gstreamer"; # ffmpeg can't choose between vdpau and vaapi for some reason - }; - - hardware.graphics = { + hardware.opengl = { enable = true; - #driSupport = true; - enable32Bit = true; + driSupport = true; + driSupport32Bit = true; extraPackages = with pkgs; [ + rocm-opencl-icd amdvlk ]; - extraPackages32 = with pkgs.driversi686Linux; [ - amdvlk + extraPackages32 = with pkgs; [ + driversi686Linux.amdvlk ]; }; } diff --git a/systems/msi/hyprland/default.nix b/systems/msi/hyprland/default.nix index 9f8ac75..04c4713 100644 --- a/systems/msi/hyprland/default.nix +++ b/systems/msi/hyprland/default.nix @@ -1,7 +1,6 @@ { impurity, ... }: { hyprland-session = { - prerun = "export AQ_DRM_DEVICES=/dev/dri/card1:/dev/dri/card2"; + prerun = "export WLR_DRM_DEVICES=/dev/dri/card1:/dev/dri/card2"; extraConfig = "source = ${impurity.link ./hyprland.conf}"; - extraConfigStatic = "source = ${./hyprland.conf}"; }; } diff --git a/systems/msi/hyprland/hyprland.conf b/systems/msi/hyprland/hyprland.conf index b5f580f..5eb65e6 100644 --- a/systems/msi/hyprland/hyprland.conf +++ b/systems/msi/hyprland/hyprland.conf @@ -21,7 +21,4 @@ workspace = 16, monitor:eDP-1 workspace = 17, monitor:eDP-1 workspace = 18, monitor:eDP-1 workspace = 19, monitor:eDP-1 -workspace = 20, monitor:eDP-1 - -workspace = name:lock_DP-1, monitor:DP-1 -workspace = name:lock_eDP-1, monitor:eDP-1 \ No newline at end of file +workspace = 20, monitor:eDP-1 \ No newline at end of file