From eb0915822098cf0cab5f0e6606722159ea8dfa5c Mon Sep 17 00:00:00 2001 From: BuyMyMojo Date: Wed, 26 Mar 2025 11:57:21 +1100 Subject: [PATCH] Move to using flakje for installing moonlight (Fixes crash) --- home-manager/flake.lock | 134 ++++++++++++++++++++++++++++++++++++++-- home-manager/flake.nix | 20 +++--- home-manager/home.nix | 47 +++++++++++--- 3 files changed, 182 insertions(+), 19 deletions(-) diff --git a/home-manager/flake.lock b/home-manager/flake.lock index 7e1db38..370c37b 100644 --- a/home-manager/flake.lock +++ b/home-manager/flake.lock @@ -1,5 +1,41 @@ { "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -21,18 +57,40 @@ "type": "github" } }, + "moonlight": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs-unstable" + ], + "pnpm2nix": "pnpm2nix" + }, + "locked": { + "lastModified": 1742927915, + "narHash": "sha256-lhTv0kAe9qvowcWVt2pxEKLcdVg2HcMYZMvqxWlDx7E=", + "owner": "moonlight-mod", + "repo": "moonlight", + "rev": "edb548c9fb005a4eed89f2ef72f49b97baa67282", + "type": "github" + }, + "original": { + "owner": "moonlight-mod", + "repo": "moonlight", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1742751704, - "narHash": "sha256-rBfc+H1dDBUQ2mgVITMGBPI1PGuCznf9rcWX/XIULyE=", + "lastModified": 1736344531, + "narHash": "sha256-8YVQ9ZbSfuUk2bUf2KRj60NRraLPKPS0Q4QFTbc+c2c=", "owner": "nixos", "repo": "nixpkgs", - "rev": "f0946fa5f1fb876a9dc2e1850d9d3a4e3f914092", + "rev": "bffc22eb12172e6db3c5dde9e3e5628f8e3e7912", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-24.11", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } @@ -53,12 +111,78 @@ "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1742751704, + "narHash": "sha256-rBfc+H1dDBUQ2mgVITMGBPI1PGuCznf9rcWX/XIULyE=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "f0946fa5f1fb876a9dc2e1850d9d3a4e3f914092", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "pnpm2nix": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1736457458, + "narHash": "sha256-eiw+hAsxavEgBfhwrktNI2hwvgeVDzBDYClx/yqka78=", + "owner": "NotNite", + "repo": "pnpm2nix-nzbr", + "rev": "4ac61c6a50623da937dca005e3dbcb8862aafb83", + "type": "github" + }, + "original": { + "owner": "NotNite", + "repo": "pnpm2nix-nzbr", + "type": "github" + } + }, "root": { "inputs": { "home-manager": "home-manager", - "nixpkgs": "nixpkgs", + "moonlight": "moonlight", + "nixpkgs": "nixpkgs_2", "nixpkgs-unstable": "nixpkgs-unstable" } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/home-manager/flake.nix b/home-manager/flake.nix index 6df2540..74c5c87 100644 --- a/home-manager/flake.nix +++ b/home-manager/flake.nix @@ -10,6 +10,11 @@ url = "github:nix-community/home-manager/release-24.11"; inputs.nixpkgs.follows = "nixpkgs"; }; + + moonlight = { + url = "github:moonlight-mod/moonlight"; # Add `/develop` to the flake URL to use nightly. + inputs.nixpkgs.follows = "nixpkgs-unstable"; + }; }; outputs = @@ -18,24 +23,25 @@ home-manager, nixpkgs-unstable, ... - }: + }@inputs: let system = "x86_64-linux"; pkgs = import nixpkgs { - inherit system; - config.allowUnfree = true; - }; + inherit system; + config.allowUnfree = true; + }; unstable = import nixpkgs-unstable { - inherit system; - config.allowUnfree = true; - }; + inherit system; + config.allowUnfree = true; + }; in { homeConfigurations."buymymojo" = home-manager.lib.homeManagerConfiguration { inherit pkgs; extraSpecialArgs = { inherit unstable; + inherit inputs; }; # Specify your home configuration modules here, for example, diff --git a/home-manager/home.nix b/home-manager/home.nix index 4cb5d6b..78b916c 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -1,6 +1,24 @@ -{ config, pkgs, unstable, ... }: +{ + config, + pkgs, + unstable, + inputs, + ... +}: { + + imports = [ + inputs.moonlight.homeModules.default + ]; + + nixpkgs = { + # You can add overlays here + overlays = [ + inputs.moonlight.overlays.default + ]; + }; + # Home Manager needs a bit of information about you and the paths it should # manage. home.username = "buymymojo"; @@ -28,7 +46,6 @@ pkgs.qbittorrent pkgs.monero-gui - # pkgs.protonplus pkgs.pcsx2 pkgs.rpcs3 @@ -36,7 +53,6 @@ pkgs.heroic-unwrapped pkgs.ludusavi - # === Minecraft === pkgs.prismlauncher # pkgs.zulu8 @@ -69,7 +85,7 @@ # === Communication === pkgs.vesktop - (unstable.discord-canary.override { withMoonlight = true; }) # pkgs.discord fails to build because of `'anonymous lambda' called with unexpected argument` so we need to use unstable instead + pkgs.discord-canary pkgs.signal-desktop pkgs.telegram-desktop # pkgs.thunderbird-latest-unwrapped @@ -83,7 +99,6 @@ # === Dev tooling === # pkgs.rustup - unstable.libreoffice-fresh # pkgs.kdePackages.kate pkgs.jetbrains.webstorm @@ -144,6 +159,24 @@ # ''; }; + programs.moonlight-mod = { + enable = true; + # stable = { + # extensions = { + # allActivites.enabled = true; + # alwaysFocus.enabled = true; + + # betterEmbedsYT = { + # enabled = true; + # config = { + # fullDescription = false; + # expandDescription = true; + # }; + # }; + # }; + # }; + }; + programs.git = { enable = true; userName = "BuyMyMojo"; @@ -154,7 +187,7 @@ extraConfig = { init = { - defaultBranch = "main"; + defaultBranch = "main"; }; }; }; @@ -221,7 +254,7 @@ NIXPKGS_ALLOW_UNFREE = "1"; }; -home.sessionPath = [ + home.sessionPath = [ "/home/buymymojo/bin/" ];