From 255554fae11d7fb6d159cf7506a3d955e31b4464 Mon Sep 17 00:00:00 2001 From: Martin Benonisen Date: Tue, 14 May 2024 17:42:09 +0200 Subject: [PATCH] fix --- flake.lock | 111 ++++++++++++++++++-- flake.nix | 7 ++ system/hardware.nix | 2 +- system/services.nix | 38 ++++++- user/default.nix | 1 + user/packages/default.nix | 8 +- user/programs/games/default.nix | 6 +- user/programs/questpatcher/default.nix | 15 +++ user/programs/questpatcher/questpatcher.nix | 23 ++++ 9 files changed, 195 insertions(+), 16 deletions(-) create mode 100644 user/programs/questpatcher/default.nix create mode 100644 user/programs/questpatcher/questpatcher.nix diff --git a/flake.lock b/flake.lock index 2cfe2ef..3776590 100644 --- a/flake.lock +++ b/flake.lock @@ -40,12 +40,36 @@ "type": "github" } }, + "nix-citizen": { + "inputs": { + "nix-gaming": [ + "nix-gaming" + ], + "nix-github-actions": "nix-github-actions", + "nixpkgs": "nixpkgs", + "systems": "systems", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1715057822, + "narHash": "sha256-JRRNuUNjbLWu2/jyKE7c4WHK9JioMyDKpuAR2rUVDgI=", + "owner": "LovingMelody", + "repo": "nix-citizen", + "rev": "6b5b307006bcb2ca2375eb02ae698ffbbed76c20", + "type": "github" + }, + "original": { + "owner": "LovingMelody", + "repo": "nix-citizen", + "type": "github" + } + }, "nix-gaming": { "inputs": { "flake-parts": [ "flake-parts" ], - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs_2" }, "locked": { "lastModified": 1713662031, @@ -61,13 +85,34 @@ "type": "github" } }, + "nix-github-actions": { + "inputs": { + "nixpkgs": [ + "nix-citizen", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1703863825, + "narHash": "sha256-rXwqjtwiGKJheXB43ybM8NwWB8rO2dSRrEqes0S7F5Y=", + "owner": "nix-community", + "repo": "nix-github-actions", + "rev": "5163432afc817cf8bd1f031418d1869e4c9d5547", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-github-actions", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1713596654, - "narHash": "sha256-LJbHQQ5aX1LVth2ST+Kkse/DRzgxlVhTL1rxthvyhZc=", + "lastModified": 1715008058, + "narHash": "sha256-Tdlna0uGWvQzGwc/7kL1ICx/fqJaBfFJAmrkKP+cZS4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "fd16bb6d3bcca96039b11aa52038fafeb6e4f4be", + "rev": "860e65d27036476edfb85dd847d982277880b143", "type": "github" }, "original": { @@ -94,6 +139,22 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1713596654, + "narHash": "sha256-LJbHQQ5aX1LVth2ST+Kkse/DRzgxlVhTL1rxthvyhZc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "fd16bb6d3bcca96039b11aa52038fafeb6e4f4be", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1713537308, "narHash": "sha256-XtTSSIB2DA6tOv+l0FhvfDMiyCmhoRbNB+0SeInZkbk=", @@ -109,7 +170,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { "lastModified": 1710534455, "narHash": "sha256-huQT4Xs0y4EeFKn2BTBVYgEwJSv8SDlm82uWgMnCMmI=", @@ -129,14 +190,15 @@ "inputs": { "flake-parts": "flake-parts", "home-manager": "home-manager", + "nix-citizen": "nix-citizen", "nix-gaming": "nix-gaming", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_3", "sops-nix": "sops-nix" } }, "sops-nix": { "inputs": { - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_4", "nixpkgs-stable": "nixpkgs-stable" }, "locked": { @@ -152,6 +214,41 @@ "repo": "sops-nix", "type": "github" } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "id": "systems", + "type": "indirect" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nix-citizen", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1714058656, + "narHash": "sha256-Qv4RBm4LKuO4fNOfx9wl40W2rBbv5u5m+whxRYUMiaA=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "c6aaf729f34a36c445618580a9f95a48f5e4e03f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 688a966..137e39c 100644 --- a/flake.nix +++ b/flake.nix @@ -18,6 +18,13 @@ inputs.flake-parts.follows = "flake-parts"; }; + # ... + + nix-citizen.url = "github:LovingMelody/nix-citizen"; + + # Optional - updates underlying without waiting for nix-citizen to update + nix-citizen.inputs.nix-gaming.follows = "nix-gaming"; + }; outputs = diff --git a/system/hardware.nix b/system/hardware.nix index a68505a..fb58a77 100644 --- a/system/hardware.nix +++ b/system/hardware.nix @@ -24,7 +24,7 @@ powerManagement.finegrained = false; open = false; nvidiaSettings = true; - package = config.boot.kernelPackages.nvidiaPackages.production; + package = config.boot.kernelPackages.nvidiaPackages.beta; }; pulseaudio.enable = false; }; diff --git a/system/services.nix b/system/services.nix index a975be3..869e68d 100644 --- a/system/services.nix +++ b/system/services.nix @@ -12,6 +12,7 @@ autoLogin.user = "mbeno"; }; + logind.extraConfig = "IdleAction=ignore"; xserver = { enable = true; xkb.layout = "us"; @@ -20,13 +21,41 @@ xterm.enable = false; }; videoDrivers = [ "nvidia" ]; - + deviceSection = '' + Option "TearFree" "False" + Option "VariableRefresh" "true" + ''; + xrandrHeads = [ + { + output = "DP-2"; + primary = true; + monitorConfig = " + Option \"TargetRefresh\" \"144\" + Option \"Primary\" \"true\" + Option \"PreferredMode\" \"2560x1440\" + Option \"DPMS\" \"true\" + "; + } + { + output = "DP-0"; + primary = false; + monitorConfig = " + Option \"TargetRefresh\" \"144\" + Option \"Primary\" \"false\" + Option \"PreferredMode\" \"1920x1080\" + "; + } + ]; + screenSection = + '' + Option "metamodes" "DP-2: 2560x1440_144 +0+0, DP-0: 1920x1080_144 +2560+0" + ''; windowManager.i3 = { enable = true; extraPackages = with pkgs; [ dmenu #application launcher most people use i3status # gives you the default i3 status bar - i3lock #default i3 screen locker + # i3lock #default i3 screen locker i3blocks #if you are planning on using i3blocks over i3status polybar rofi @@ -43,4 +72,9 @@ }; services.pcscd.enable = true; services.dbus.packages = [ pkgs.gcr ]; + services.openssh = { + enable = true; + settings.PasswordAuthentication = true; + }; + networking.firewall.allowedTCPPorts = [ 22 ]; } diff --git a/user/default.nix b/user/default.nix index 48baa07..546f1ff 100644 --- a/user/default.nix +++ b/user/default.nix @@ -14,6 +14,7 @@ ./programs/dunst ./programs/rofi ./programs/obs-studio + ./programs/questpatcher ./programs/vscode ./programs/games ./scripts diff --git a/user/packages/default.nix b/user/packages/default.nix index a5f640d..87fe904 100644 --- a/user/packages/default.nix +++ b/user/packages/default.nix @@ -1,9 +1,13 @@ -{ pkgs, ... }: { +{ pkgs, inputs, ... }: { home.packages = with pkgs; [ # Generic tools + inputs.nix-citizen.packages.${system}.star-citizen age discord + passthru + sidequest libpng + p7zip lshw vlc expat @@ -28,6 +32,8 @@ pavucontrol jellyfin-media-player unrar + protonup-qt + protonup-ng mpv lutris pamixer diff --git a/user/programs/games/default.nix b/user/programs/games/default.nix index 7b1e9df..41932a3 100644 --- a/user/programs/games/default.nix +++ b/user/programs/games/default.nix @@ -3,8 +3,4 @@ , ... }: # games -{ - home.packages = [ - inputs.nix-gaming.packages.${pkgs.system}.star-citizen - ]; -} +{ } diff --git a/user/programs/questpatcher/default.nix b/user/programs/questpatcher/default.nix new file mode 100644 index 0000000..5bb97c4 --- /dev/null +++ b/user/programs/questpatcher/default.nix @@ -0,0 +1,15 @@ +# default.nix +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + }; + outputs = + { self, nixpkgs }: + let + system = "x86_64-linux"; + pkgs = import nixpkgs { inherit system; }; + in + { + questpatcher = pkgs.callPackage ./questpatcher.nix { }; + }; +} diff --git a/user/programs/questpatcher/questpatcher.nix b/user/programs/questpatcher/questpatcher.nix new file mode 100644 index 0000000..f4e6fcc --- /dev/null +++ b/user/programs/questpatcher/questpatcher.nix @@ -0,0 +1,23 @@ +{ fetchFromGitHub +, buildDotnetModule +, dotnetCorePackages +}: + + +buildDotnetModule rec { + pname = "questpatcher"; + version = "v0.1"; + src = fetchFromGitHub { + owner = "Lauriethefish"; + repo = "QuestPatcher"; + rev = "2.8.0"; + sha256 = "myDaWSo44b7c8uO0vmmCHiX9r6SaCWoz/GuS1+YegAc="; + }; + projectFile = "QuestPatcher/QuestPatcher.csproj"; + meta = { + homepage = "https://github.com/Lauriethefish/QuestPatcher"; + description = "Meta Quest APK Patching Tools"; + }; + dotnet-sdk = dotnetCorePackages.sdk_6_0; + dotnet-runtime = dotnetCorePackages.runtime_6_0; +}