diff --git a/Justfile b/Justfile index 64154e0..d68a508 100644 --- a/Justfile +++ b/Justfile @@ -2,7 +2,8 @@ default: @just --list deployhome: - home-manager switch -b bak --flake . + # Impure is required for NixGL with proprietary Nvidia drivers :( + home-manager switch --impure -b bak --flake . update: nix flake update diff --git a/flake.lock b/flake.lock index 1a2fc2f..c682d2f 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,20 @@ { "nodes": { + "flake-utils": { + "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" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -20,7 +35,41 @@ "type": "github" } }, + "nixgl": { + "inputs": { + "flake-utils": "flake-utils", + "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": 1660551188, + "narHash": "sha256-a1LARMMYQ8DPx1BgoI/UN4bXe12hhZkCNqdxNi6uS0g=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "441dc5d512153039f19ef198e662e4f3dbb9fd65", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1730200266, "narHash": "sha256-l253w0XMT8nWHGXuXqyiIC/bMvh1VRszGXgdpQlfhvU=", @@ -39,17 +88,18 @@ "root": { "inputs": { "home-manager": "home-manager", - "nixpkgs": "nixpkgs", + "nixgl": "nixgl", + "nixpkgs": "nixpkgs_2", "rose-pine": "rose-pine" } }, "rose-pine": { "locked": { - "lastModified": 1730588441, - "narHash": "sha256-7cVAVvzZiYs3dWgIRxCs/4LtdYsh9M84eEQICgHdaA4=", + "lastModified": 1730601595, + "narHash": "sha256-VK+q689BfEYvqup6RpOoQTCR2hUo8fMnHUd7En6oa9E=", "ref": "refs/heads/main", - "rev": "1fb54d67aeb32c65cd4f9b3e31e2bb14da96355c", - "revCount": 373, + "rev": "4ce7b95d1bb2d211d39f2697a0884d5eb12d716d", + "revCount": 375, "type": "git", "url": "https://git.punkfairie.net/punkfairie/rose-pine-nix" }, diff --git a/flake.nix b/flake.nix index da64885..d3fc912 100644 --- a/flake.nix +++ b/flake.nix @@ -9,6 +9,8 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + nixgl.url = "github:nix-community/nixGL"; + rose-pine.url = "git+https://git.punkfairie.net/punkfairie/rose-pine-nix"; }; @@ -27,6 +29,10 @@ home-manager.lib.homeManagerConfiguration { inherit pkgs; + extraSpecialArgs = with inputs; { + inherit nixgl; + }; + modules = [ ./home inputs.rose-pine.homeManagerModules.rose-pine diff --git a/home/default.nix b/home/default.nix index a263c23..d9deeaf 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,11 +1,19 @@ { pkgs, + nixgl, ... }: { home.username = "marley"; home.homeDirectory = "/home/marley"; + targets.genericLinux.enable = true; + + # GPU integration. + nixGL.packages = nixgl.packages; + nixGL.defaultWrapper = "nvidia"; + nixGL.installScripts = [ "nvidia" ]; + home.language.base = "en_US.UTF-8"; # Tell nix what version it is. @@ -17,7 +25,12 @@ "flakes" ]; - targets.genericLinux.enable = true; + xdg.configFile."nixpkgs/config.nix".text = # nix + '' + { + allowUnfree = true; + } + ''; # Autostart wanted systemd services. systemd.user.startServices = true; @@ -44,6 +57,7 @@ ./less ./man ./ncmpcpp + ./starship ./syncthing ./tmux ./topgrade diff --git a/home/starship/default.nix b/home/starship/default.nix new file mode 100644 index 0000000..3264ae7 --- /dev/null +++ b/home/starship/default.nix @@ -0,0 +1,54 @@ +{ lib, ... }: +{ + programs.starship = { + enable = true; + + rose-pine.enable = true; + + settings = lib.mkMerge [ + (lib.mkDefault (lib.importTOML ./nerd-font-symbols.toml)) + { + format = lib.concatStrings [ + "$username" + "$directory" + "$git_branch" + "$git_status" + "$fill" + "$c" + "$elixir" + "$elm" + "$golang" + "$haskell" + "$java" + "$julia" + "$nodejs" + "$nim" + "$rust" + "$scala" + "$python" + "$time" + "$line_break" + "[󱞪](fg:iris)" + ]; + + # https://starship.rs/presets/nerd-font + # aws.symbol = ""; + # buf.symbol = ""; + # c.symbol = ""; + # conda.symbol = ""; + # crystal.symbol = ""; + # dart.symbol = ""; + # directory.read_only = "󰌾"; + # docker_context.symbol = ""; + # elixir.symbol = ""; + # elm.symbol = ""; + # fennel.symbol = ""; + # fossil_branch.symbol = ""; + # git_branch.symbol = ""; + # git_commit.tag_symbol = ""; + # golang.symbol = ""; + # guix_shell.symbol = ""; + } + ]; + }; +} diff --git a/home/starship/nerd-font-symbols.toml b/home/starship/nerd-font-symbols.toml new file mode 100644 index 0000000..65c0b74 --- /dev/null +++ b/home/starship/nerd-font-symbols.toml @@ -0,0 +1,170 @@ +[aws] +symbol = " " + +[buf] +symbol = " " + +[c] +symbol = " " + +[conda] +symbol = " " + +[crystal] +symbol = " " + +[dart] +symbol = " " + +[directory] +read_only = " 󰌾" + +[docker_context] +symbol = " " + +[elixir] +symbol = " " + +[elm] +symbol = " " + +[fennel] +symbol = " " + +[fossil_branch] +symbol = " " + +[git_branch] +symbol = " " + +[git_commit] +tag_symbol = '  ' + +[golang] +symbol = " " + +[guix_shell] +symbol = " " + +[haskell] +symbol = " " + +[haxe] +symbol = " " + +[hg_branch] +symbol = " " + +[hostname] +ssh_symbol = " " + +[java] +symbol = " " + +[julia] +symbol = " " + +[kotlin] +symbol = " " + +[lua] +symbol = " " + +[memory_usage] +symbol = "󰍛 " + +[meson] +symbol = "󰔷 " + +[nim] +symbol = "󰆥 " + +[nix_shell] +symbol = " " + +[nodejs] +symbol = " " + +[ocaml] +symbol = " " + +[os.symbols] +Alpaquita = " " +Alpine = " " +AlmaLinux = " " +Amazon = " " +Android = " " +Arch = " " +Artix = " " +CentOS = " " +Debian = " " +DragonFly = " " +Emscripten = " " +EndeavourOS = " " +Fedora = " " +FreeBSD = " " +Garuda = "󰛓 " +Gentoo = " " +HardenedBSD = "󰞌 " +Illumos = "󰈸 " +Kali = " " +Linux = " " +Mabox = " " +Macos = " " +Manjaro = " " +Mariner = " " +MidnightBSD = " " +Mint = " " +NetBSD = " " +NixOS = " " +OpenBSD = "󰈺 " +openSUSE = " " +OracleLinux = "󰌷 " +Pop = " " +Raspbian = " " +Redhat = " " +RedHatEnterprise = " " +RockyLinux = " " +Redox = "󰀘 " +Solus = "󰠳 " +SUSE = " " +Ubuntu = " " +Unknown = " " +Void = " " +Windows = "󰍲 " + +[package] +symbol = "󰏗 " + +[perl] +symbol = " " + +[php] +symbol = " " + +[pijul_channel] +symbol = " " + +[python] +symbol = " " + +[rlang] +symbol = "󰟔 " + +[ruby] +symbol = " " + +[rust] +symbol = "󱘗 " + +[scala] +symbol = " " + +[swift] +symbol = " " + +[zig] +symbol = " " + +[gradle] +symbol = " " diff --git a/home/wezterm/default.nix b/home/wezterm/default.nix index 1160715..52768c9 100644 --- a/home/wezterm/default.nix +++ b/home/wezterm/default.nix @@ -1,8 +1,13 @@ -{ config, ... }: +{ pkgs, config, ... }: { programs.wezterm = { enable = true; + # Needs to be wrapped with GPU driver libraries on non-NixOS systems. + # package = (config.lib.nixGL.wrap pkgs.wezterm); + + package = pkgs.emptyDirectory; + # TODO: create `local config` & return it seperately, so other modules can # insert config in the middle extraConfig =