From f667517e1a657103b137bee5bb208637f109b982 Mon Sep 17 00:00:00 2001 From: chayleaf Date: Thu, 6 Apr 2023 09:45:02 +0700 Subject: [PATCH] random changes --- home/common/gui.nix | 4 +- home/common/i3-sway.nix | 4 +- home/common/nvim.nix | 2 +- home/flake.lock | 152 +++++++++++++++++- home/flake.nix | 17 +- home/hosts/nixmsi.nix | 35 +++- home/{ => pkgs}/home-daemon/.gitignore | 0 home/{ => pkgs}/home-daemon/Cargo.lock | 0 home/{ => pkgs}/home-daemon/Cargo.toml | 0 home/{ => pkgs}/home-daemon/default.nix | 0 home/{ => pkgs}/home-daemon/shell.nix | 0 home/{ => pkgs}/home-daemon/src/main.rs | 0 home/pkgs/lalrpop/default.nix | 44 +++++ .../use-correct-binary-path-in-tests.patch | 13 ++ .../rofi-steam-game-list/.gitignore | 0 .../rofi-steam-game-list/Cargo.lock | 0 .../rofi-steam-game-list/Cargo.toml | 0 .../rofi-steam-game-list/default.nix | 0 .../rofi-steam-game-list/src/main.rs | 0 19 files changed, 259 insertions(+), 12 deletions(-) rename home/{ => pkgs}/home-daemon/.gitignore (100%) rename home/{ => pkgs}/home-daemon/Cargo.lock (100%) rename home/{ => pkgs}/home-daemon/Cargo.toml (100%) rename home/{ => pkgs}/home-daemon/default.nix (100%) rename home/{ => pkgs}/home-daemon/shell.nix (100%) rename home/{ => pkgs}/home-daemon/src/main.rs (100%) create mode 100644 home/pkgs/lalrpop/default.nix create mode 100644 home/pkgs/lalrpop/use-correct-binary-path-in-tests.patch rename home/{ => pkgs}/rofi-steam-game-list/.gitignore (100%) rename home/{ => pkgs}/rofi-steam-game-list/Cargo.lock (100%) rename home/{ => pkgs}/rofi-steam-game-list/Cargo.toml (100%) rename home/{ => pkgs}/rofi-steam-game-list/default.nix (100%) rename home/{ => pkgs}/rofi-steam-game-list/src/main.rs (100%) diff --git a/home/common/gui.nix b/home/common/gui.nix index 1732d8e..571fb66 100644 --- a/home/common/gui.nix +++ b/home/common/gui.nix @@ -47,7 +47,6 @@ xdg.userDirs.enable = true; - # TODO sort out this mess with colors programs.mpv = { enable = true; defaultProfiles = [ "gpu-hq" ]; @@ -154,7 +153,8 @@ # vaapi-device / vulkan-device # screen / vulkan-display-display audio-device = "pipewire"; - ao = "pipewire,pulse,alsa,jack,"; + # because ao=pipewire doesn't work for whatever reason... + ao = "pulse,alsa,jack,pipewire,"; audio-file-auto = "fuzzy"; sub-auto = "fuzzy"; gpu-context = "waylandvk"; diff --git a/home/common/i3-sway.nix b/home/common/i3-sway.nix index 3e94f6d..5ec9ae2 100644 --- a/home/common/i3-sway.nix +++ b/home/common/i3-sway.nix @@ -80,7 +80,7 @@ commonConfig = { inherit modifier; startup = [ { command = builtins.toString (with pkgs; writeShellScript "init-wm" '' - ${callPackage ../home-daemon {}}/bin/dotfiles-home-daemon system76-scheduler& + ${callPackage ../pkgs/home-daemon {}}/bin/dotfiles-home-daemon system76-scheduler& ${gnome.zenity}/bin/zenity --password | (${keepassxc}/bin/keepassxc --pw-stdin ~/Nextcloud/keepass.kdbx&) # nextcloud and nheko need secret service access ${nextcloud-client}/bin/nextcloud --background& @@ -448,7 +448,7 @@ in }; terminal = config.terminalBin; extraConfig = { - modi = [ "steam:${pkgs.callPackage ../rofi-steam-game-list {}}/bin/rofi-steam-game-list" "drun" "run" "ssh" ]; + modi = [ "steam:${pkgs.callPackage ../pkgs/rofi-steam-game-list {}}/bin/rofi-steam-game-list" "drun" "run" "ssh" ]; icon-theme = "hicolor"; drun-match-fields = [ "name" "generic" "exec" "keywords" ]; show-icons = true; diff --git a/home/common/nvim.nix b/home/common/nvim.nix index 18e3267..d652dc2 100644 --- a/home/common/nvim.nix +++ b/home/common/nvim.nix @@ -239,7 +239,7 @@ }; }; formatting = { - format = arg1: vim_item: let kind = PROP vim_item "kind"; in L [ + format = entry: vim_item: let kind = PROP vim_item "kind"; in L [ SET kind (string.format "%s %s" (IDX lspkind kind) kind) _ vim_item ]; diff --git a/home/flake.lock b/home/flake.lock index 76c6faa..82456a5 100644 --- a/home/flake.lock +++ b/home/flake.lock @@ -1,5 +1,58 @@ { "nodes": { + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "nixpkgs-wayland", + "nix-eval-jobs", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1679737941, + "narHash": "sha256-srSD9CwsVPnUMsIZ7Kt/UegkKUEBcTyU1Rev7mO45S0=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "3502ee99d6dade045bdeaf7b0cd8ec703484c25c", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-utils": { + "locked": { + "lastModified": 1678901627, + "narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -21,6 +74,44 @@ "type": "github" } }, + "lib-aggregate": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1679832509, + "narHash": "sha256-LZecjt8KSlAEVJgaVPcXX6XBTsf/hyYB4AWThsA6f2M=", + "owner": "nix-community", + "repo": "lib-aggregate", + "rev": "7068824f9ec4364c9375605f5af43793dd2eebee", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "lib-aggregate", + "type": "github" + } + }, + "nix-eval-jobs": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1680139406, + "narHash": "sha256-HWZZLssXwWr6k56FaMtxtcnvIsby1f3UdMkGGGl1DRs=", + "owner": "nix-community", + "repo": "nix-eval-jobs", + "rev": "10bb6ac58bc82546d8932e3d71001082254bdfe5", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-eval-jobs", + "type": "github" + } + }, "nix-gaming": { "inputs": { "nixpkgs": [ @@ -54,6 +145,60 @@ "type": "indirect" } }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1679791877, + "narHash": "sha256-tTV1Mf0hPWIMtqyU16Kd2JUBDWvfHlDC9pF57vcbgpQ=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "cc060ddbf652a532b54057081d5abd6144d01971", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixpkgs-wayland": { + "inputs": { + "flake-compat": "flake-compat", + "lib-aggregate": "lib-aggregate", + "nix-eval-jobs": "nix-eval-jobs", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1680284280, + "narHash": "sha256-7YaS5UU0qyZvLKeU5M2Xhp2c8pSZaF2WelbUrQMtTCI=", + "owner": "nix-community", + "repo": "nixpkgs-wayland", + "rev": "93f39f37964652d94fe40f597eed7bfe49254fef", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs-wayland", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1680138801, + "narHash": "sha256-TSO0F7fvX2+M6lpVYaGEOciq4Iawy/su2jZ8Mfi9nxc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "4e416a8e847057c49e73be37ae8dc4fcdfe9eff8", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "master", + "repo": "nixpkgs", + "type": "github" + } + }, "notlua": { "inputs": { "nixpkgs": [ @@ -61,11 +206,11 @@ ] }, "locked": { - "lastModified": 1679313651, - "narHash": "sha256-SwYtZhHqcr5V5IF4XNHx8du+E5WLgZXzpiTp/6qy6W4=", + "lastModified": 1679341830, + "narHash": "sha256-7+tqtNEpj/rtL55KntBI1gKo3YEu8JuKOHoK4dMx58k=", "owner": "chayleaf", "repo": "notlua", - "rev": "f04a6916767ebed80e5560d529c5bd8d95edebbc", + "rev": "8a36fec181a1fdd314064f55aa90ec9e4744ebd1", "type": "github" }, "original": { @@ -95,6 +240,7 @@ "home-manager": "home-manager", "nix-gaming": "nix-gaming", "nixpkgs": "nixpkgs", + "nixpkgs-wayland": "nixpkgs-wayland", "notlua": "notlua", "nur": "nur" } diff --git a/home/flake.nix b/home/flake.nix index e8c5d52..5ad4b7f 100644 --- a/home/flake.nix +++ b/home/flake.nix @@ -26,8 +26,21 @@ getPriv = (hostname: with builtins; if hasAttr hostname priv then (getAttr hostname priv) else {}); in { homeConfigurations = { - "user@nixmsi" = home-manager.lib.homeManagerConfiguration { - pkgs = nixpkgs.legacyPackages."x86_64-linux"; + "user@nixmsi" = let system = "x86_64-linux"; in home-manager.lib.homeManagerConfiguration { + pkgs = import nixpkgs { + inherit system; + binaryCachePublicKeys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + # "nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA=" + ]; + binaryCaches = [ + "https://cache.nixos.org" + # "https://nixpkgs-wayland.cachix.org" + ]; + }; + extraSpecialArgs = { + # pkgs-wayland = nixpkgs-wayland.packages.${system}; + }; modules = [ notlua.nixosModules.default nur.nixosModules.nur diff --git a/home/hosts/nixmsi.nix b/home/hosts/nixmsi.nix index 7e7e436..c0190f9 100644 --- a/home/hosts/nixmsi.nix +++ b/home/hosts/nixmsi.nix @@ -1,4 +1,4 @@ -{ config, pkgs, lib, ... }: +{ config, pkgs, lib, pkgs-wayland, ... }: { imports = [ ../common/general.nix @@ -62,7 +62,34 @@ })) cutter openrgb piper steam-run steam - osu-lazer-bin taisei + ((osu-lazer-bin.override { + gmrun_enable = false; + }).overrideAttrs (old: { + paths = assert builtins.length old.paths == 2; + let + osu = builtins.head old.paths; + osu' = osu.overrideAttrs (old: { + installPhase = builtins.replaceStrings + ["runHook postInstall"] + ["sed -i 's:exec :exec ${obs-studio-plugins.obs-vkcapture}/bin/obs-gamecapture :g' $out/bin/osu-lazer\nrunHook postInstall"] + old.installPhase; + }); + in assert osu.pname == "osu-lazer-bin"; [ + osu' + (makeDesktopItem { + name = osu'.pname; + exec = "${osu'.outPath}/bin/osu-lazer"; + icon = "${osu'.outPath}/osu.png"; + comment = "A free-to-win rhythm game. Rhythm is just a *click* away!"; + desktopName = "osu!"; + categories = ["Game"]; + }) + ]; + })) + taisei + (wrapOBS { + plugins = with obs-studio-plugins; [ wlrobs obs-vkcapture ]; + }) easyeffects # wineWowPackages.waylandFull winetricks @@ -72,6 +99,10 @@ gimp krita blender tdesktop clang_latest rustc rustfmt cargo clippy + kdenlive + mediainfo + glaxnimate + (pkgs.callPackage ../pkgs/lalrpop { }) # waiting until the PR gets merged (looking-glass-client.overrideAttrs (old: { version = "B6"; diff --git a/home/home-daemon/.gitignore b/home/pkgs/home-daemon/.gitignore similarity index 100% rename from home/home-daemon/.gitignore rename to home/pkgs/home-daemon/.gitignore diff --git a/home/home-daemon/Cargo.lock b/home/pkgs/home-daemon/Cargo.lock similarity index 100% rename from home/home-daemon/Cargo.lock rename to home/pkgs/home-daemon/Cargo.lock diff --git a/home/home-daemon/Cargo.toml b/home/pkgs/home-daemon/Cargo.toml similarity index 100% rename from home/home-daemon/Cargo.toml rename to home/pkgs/home-daemon/Cargo.toml diff --git a/home/home-daemon/default.nix b/home/pkgs/home-daemon/default.nix similarity index 100% rename from home/home-daemon/default.nix rename to home/pkgs/home-daemon/default.nix diff --git a/home/home-daemon/shell.nix b/home/pkgs/home-daemon/shell.nix similarity index 100% rename from home/home-daemon/shell.nix rename to home/pkgs/home-daemon/shell.nix diff --git a/home/home-daemon/src/main.rs b/home/pkgs/home-daemon/src/main.rs similarity index 100% rename from home/home-daemon/src/main.rs rename to home/pkgs/home-daemon/src/main.rs diff --git a/home/pkgs/lalrpop/default.nix b/home/pkgs/lalrpop/default.nix new file mode 100644 index 0000000..d09146b --- /dev/null +++ b/home/pkgs/lalrpop/default.nix @@ -0,0 +1,44 @@ +{ lib +, rustPlatform +, rust +, fetchFromGitHub +, substituteAll +, stdenv +}: + +rustPlatform.buildRustPackage rec { + pname = "lalrpop"; + version = "0.19.9"; + + src = fetchFromGitHub { + owner = "lalrpop"; + repo = "lalrpop"; + rev = version; + hash = "sha256-1jXLcIlyObo9eIg0q6CyUTGhcAyZ8TDGmxxYhVxgcS8="; + }; + + cargoHash = "sha256-o1zpkwBmU1f/BZ4RrWuF5YvgjLhQOBOEdSbmouLPKAo="; + + patches = [ + (substituteAll { + src = ./use-correct-binary-path-in-tests.patch; + target_triple = rust.toRustTarget stdenv.hostPlatform; + }) + ]; + + buildAndTestSubdir = "lalrpop"; + + # there are some tests in lalrpop-test and some in lalrpop + checkPhase = '' + buildAndTestSubdir=lalrpop-test cargoCheckHook + cargoCheckHook + ''; + + meta = with lib; { + description = "LR(1) parser generator for Rust"; + homepage = "https://github.com/lalrpop/lalrpop"; + changelog = "https://github.com/lalrpop/lalrpop/blob/${src.rev}/RELEASES.md"; + license = with licenses; [ asl20 /* or */ mit ]; + maintainers = with maintainers; [ chayleaf ]; + }; +} diff --git a/home/pkgs/lalrpop/use-correct-binary-path-in-tests.patch b/home/pkgs/lalrpop/use-correct-binary-path-in-tests.patch new file mode 100644 index 0000000..0f46463 --- /dev/null +++ b/home/pkgs/lalrpop/use-correct-binary-path-in-tests.patch @@ -0,0 +1,13 @@ +diff --git a/lalrpop-test/src/lib.rs b/lalrpop-test/src/lib.rs +index 087df01..9361a9e 100644 +--- a/lalrpop-test/src/lib.rs ++++ b/lalrpop-test/src/lib.rs +@@ -1031,7 +1031,7 @@ fn verify_lalrpop_generates_itself() { + // Don't remove the .rs file that already exist + fs::copy(&grammar_file, &copied_grammar_file).expect("no grammar file found"); + +- assert!(Command::new("../target/debug/lalrpop") ++ assert!(Command::new("../target/@target_triple@/release/lalrpop") + .args(&[ + "--force", + "--no-whitespace", diff --git a/home/rofi-steam-game-list/.gitignore b/home/pkgs/rofi-steam-game-list/.gitignore similarity index 100% rename from home/rofi-steam-game-list/.gitignore rename to home/pkgs/rofi-steam-game-list/.gitignore diff --git a/home/rofi-steam-game-list/Cargo.lock b/home/pkgs/rofi-steam-game-list/Cargo.lock similarity index 100% rename from home/rofi-steam-game-list/Cargo.lock rename to home/pkgs/rofi-steam-game-list/Cargo.lock diff --git a/home/rofi-steam-game-list/Cargo.toml b/home/pkgs/rofi-steam-game-list/Cargo.toml similarity index 100% rename from home/rofi-steam-game-list/Cargo.toml rename to home/pkgs/rofi-steam-game-list/Cargo.toml diff --git a/home/rofi-steam-game-list/default.nix b/home/pkgs/rofi-steam-game-list/default.nix similarity index 100% rename from home/rofi-steam-game-list/default.nix rename to home/pkgs/rofi-steam-game-list/default.nix diff --git a/home/rofi-steam-game-list/src/main.rs b/home/pkgs/rofi-steam-game-list/src/main.rs similarity index 100% rename from home/rofi-steam-game-list/src/main.rs rename to home/pkgs/rofi-steam-game-list/src/main.rs