From d185e489cf2b8c64c125528741569584ae4b5c8a Mon Sep 17 00:00:00 2001 From: punkfairie Date: Fri, 22 Nov 2024 21:37:45 -0800 Subject: [PATCH] feat(home): NixGL working!! Wezterm hates it for some reason tho :( --- Justfile | 2 +- flake.lock | 53 +++++++++++++++++++---- flake.nix | 7 ++- homes/x86_64-linux/marley@nyx/default.nix | 1 + modules/home/base/nix/default.nix | 12 ++++- modules/home/nixgl/default.nix | 21 +++++++++ modules/home/services/polybar/default.nix | 1 + 7 files changed, 86 insertions(+), 11 deletions(-) create mode 100644 modules/home/nixgl/default.nix diff --git a/Justfile b/Justfile index 9b54f6b..1a93a16 100644 --- a/Justfile +++ b/Justfile @@ -7,7 +7,7 @@ defuser := env_var('USER') alias dh := deployhome [group('home')] deployhome user=defuser host=defhost: - nh home switch -c {{user}}@{{host}} -b bak . + nh home switch -c {{user}}@{{host}} -b bak . -- --impure [group('home')] refreshhome: diff --git a/flake.lock b/flake.lock index be4744b..983e95e 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1732016537, - "narHash": "sha256-XwXUK+meYnlhdQz2TVE4Wv+tsx1CkdGbDPt1tRzCNH4=", + "lastModified": 1732324260, + "narHash": "sha256-0xzQvoId/P008QkTSAdFVv465P9rL9nYkIOWXL5pdsY=", "owner": "LnL7", "repo": "nix-darwin", - "rev": "61cee20168a3ebb71a9efd70a55adebaadfbe4d4", + "rev": "698a62c628c2ec423aa770d8ec0e1d0bcf4fca1a", "type": "github" }, "original": { @@ -149,7 +149,7 @@ }, "flake-utils-plus_2": { "inputs": { - "flake-utils": "flake-utils_4" + "flake-utils": "flake-utils_5" }, "locked": { "lastModified": 1715533576, @@ -203,6 +203,21 @@ } }, "flake-utils_4": { + "locked": { + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_5": { "inputs": { "systems": "systems_4" }, @@ -298,11 +313,11 @@ ] }, "locked": { - "lastModified": 1732025103, - "narHash": "sha256-qjEI64RKvDxRyEarY0jTzrZMa8ebezh2DEZmJJrpVdo=", + "lastModified": 1732303962, + "narHash": "sha256-5Umjb5AdtxV5jSJd5jxoCckh5mlg+FBQDsyAilu637g=", "owner": "nix-community", "repo": "home-manager", - "rev": "a46e702093a5c46e192243edbd977d5749e7f294", + "rev": "8cf9cb2ee78aa129e5b8220135a511a2be254c0c", "type": "github" }, "original": { @@ -377,7 +392,7 @@ "narHash": "sha256-6U0CyPycIBc04hbYy2hBINnVso58n/ZyywY2BD3hu+s=", "rev": "9098ac95768f7006d7e070b88bae76939f6034e6", "type": "tarball", - "url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/9098ac95768f7006d7e070b88bae76939f6034e6.tar.gz" + "url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/9098ac95768f7006d7e070b88bae76939f6034e6.tar.gz?rev=9098ac95768f7006d7e070b88bae76939f6034e6" }, "original": { "type": "tarball", @@ -445,6 +460,27 @@ "type": "github" } }, + "nixgl": { + "inputs": { + "flake-utils": "flake-utils_4", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1713543440, + "narHash": "sha256-lnzZQYG0+EXl/6NkGpyIz+FEOc/DSEG57AP1VsdeNrM=", + "owner": "nix-community", + "repo": "nixGL", + "rev": "310f8e49a149e4c9ea52f1adf70cdc768ec53f8a", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixGL", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1732014248, @@ -536,6 +572,7 @@ "home-manager": "home-manager", "lix": "lix", "marleyvim": "marleyvim", + "nixgl": "nixgl", "nixpkgs": "nixpkgs", "rofi-themes": "rofi-themes", "rose-pine": "rose-pine", diff --git a/flake.nix b/flake.nix index 9fc4d0f..ebd4ad0 100644 --- a/flake.nix +++ b/flake.nix @@ -18,7 +18,7 @@ overlays = with inputs; [ lix.overlays.default - marleyvim.overlays.default + marleyvim.overlays.default ]; systems.modules.darwin = with inputs; [ @@ -62,6 +62,11 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + nixgl = { + url = "github:nix-community/nixGL"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + rose-pine.url = "git+https://codewith.babesonthe.net/punkfairie/rose-pine-nix"; marleyvim = { diff --git a/homes/x86_64-linux/marley@nyx/default.nix b/homes/x86_64-linux/marley@nyx/default.nix index 4a541c8..05fd518 100644 --- a/homes/x86_64-linux/marley@nyx/default.nix +++ b/homes/x86_64-linux/marley@nyx/default.nix @@ -22,6 +22,7 @@ in marleyos = { isDesktop = true; + nixGL = enabled; appearance = { base = enabled; diff --git a/modules/home/base/nix/default.nix b/modules/home/base/nix/default.nix index b3b687d..f88b905 100644 --- a/modules/home/base/nix/default.nix +++ b/modules/home/base/nix/default.nix @@ -1,7 +1,9 @@ -_: +{ pkgs, config, ... }: { config = { nix = { + package = pkgs.lix; + # Enable flakes. settings.experimental-features = [ "nix-command" @@ -17,5 +19,13 @@ _: gc.automatic = true; }; + nixpkgs.config.import = "${config.xdg.configHome}/nixpkgs/config.nix"; + + xdg.configFile."nixpkgs/config.nix".text = # nix + '' + { + allowUnfree = true; + } + ''; }; } diff --git a/modules/home/nixgl/default.nix b/modules/home/nixgl/default.nix new file mode 100644 index 0000000..bb44f83 --- /dev/null +++ b/modules/home/nixgl/default.nix @@ -0,0 +1,21 @@ +{ + lib, + config, + inputs, + ... +}: +let + inherit (lib) mkEnableOption mkIf; + + cfg = config.marleyos.nixGL; +in +{ + options.marleyos.nixGL.enable = mkEnableOption "nixGL"; + + config = mkIf cfg.enable { + nixGL = { + inherit (inputs.nixgl) packages; + defaultWrapper = "nvidia"; + }; + }; +} diff --git a/modules/home/services/polybar/default.nix b/modules/home/services/polybar/default.nix index 14f0271..dc96133 100644 --- a/modules/home/services/polybar/default.nix +++ b/modules/home/services/polybar/default.nix @@ -20,6 +20,7 @@ in services.polybar = { enable = true; + package = config.lib.nixGL.wrap pkgs.polybar; script = # bash ''