From 6b978b074d311a1c2b1afd71a8fbb079f92f7b01 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Fri, 29 Dec 2023 00:39:36 +0800 Subject: [PATCH] fix: config for foot, add NIX_PATH for compatibility --- flake.lock | 6 ++--- .../desktop/hyprland/values/wayland-apps.nix | 24 ++++++++++++++++++- lib/colmenaSystem.nix | 7 +++++- lib/nixosSystem.nix | 7 +++++- 4 files changed, 38 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index 065bc45e..e1209e04 100644 --- a/flake.lock +++ b/flake.lock @@ -773,11 +773,11 @@ "nixpkgs": "nixpkgs_5" }, "locked": { - "lastModified": 1703694125, - "narHash": "sha256-7gdwhPcMpaHZzjg9Cw6FKTm2k4OotSJcwAQ9iwYfnCE=", + "lastModified": 1703782686, + "narHash": "sha256-nZ8eWb4NYAHn02eUF+PUgdx77vWOmtVxYHKC3eai0FM=", "owner": "ryan4yin", "repo": "nur-packages", - "rev": "630c1a26ffa11ed2bfd9407bcf03e3238a2e83cc", + "rev": "189eb3df8734c698edc5664f0a3bae68ece2a8dd", "type": "github" }, "original": { diff --git a/home/linux/desktop/hyprland/values/wayland-apps.nix b/home/linux/desktop/hyprland/values/wayland-apps.nix index 31d5c51c..31f401b1 100644 --- a/home/linux/desktop/hyprland/values/wayland-apps.nix +++ b/home/linux/desktop/hyprland/values/wayland-apps.nix @@ -1,8 +1,30 @@ -{pkgs, ...}: { +{ + pkgs, + nur-ryan4yin, + ... +}: { + # refer to https://codeberg.org/dnkl/foot/src/branch/master/foot.ini + xdg.configFile."foot/foot.ini".text = + (builtins.readFile "${nur-ryan4yin.packages.${pkgs.system}.catppuccin-foot}/catppuccin-mocha.conf") + + '' + term=foot + font=JetBrainsMono Nerd Font:size=13 + dpi-aware=yes + shell=${pkgs.bash}/bin/bash --login -c 'nu --login --interactive' + ''; + programs = { # a wayland only terminal emulator foot = { enable = true; + # foot can also be run in a server mode. In this mode, one process hosts multiple windows. + # All Wayland communication, VT parsing and rendering is done in the server process. + # New windows are opened by running footclient, which remains running until the terminal window is closed. + # + # Advantages to run foot in server mode including reduced memory footprint and startup time. + # The downside is a performance penalty. If one window is very busy with, for example, producing output, + # then other windows will suffer. Also, should the server process crash, all windows will be gone. + server.enable = false; }; # source code: https://github.com/nix-community/home-manager/blob/master/modules/programs/chromium.nix diff --git a/lib/colmenaSystem.nix b/lib/colmenaSystem.nix index 7eed29c7..54f37c06 100644 --- a/lib/colmenaSystem.nix +++ b/lib/colmenaSystem.nix @@ -23,7 +23,12 @@ in { # make `nix run nixpkgs#nixpkgs` use the same nixpkgs as the one used by this flake. nix.registry.nixpkgs.flake = nixpkgs; - nix.channel.enable = false; # disable nix-channel, we use flakes instead. + nix.channel.enable = false; # remove nix-channel related tools & configs, we use flakes instead. + + # but NIX_PATH is still used by many useful tools, so we set it to the same value as the one used by this flake. + # Make `nix repl ''` use the same nixpkgs as the one used by this flake. + environment.etc."nix/inputs/nixpkgs".source = "${nixpkgs}"; + environment.sessionVariables.NIX_PATH = nixpkgs.lib.mkForce "nixpkgs=/etc/nix/inputs/nixpkgs"; } ] ++ ( diff --git a/lib/nixosSystem.nix b/lib/nixosSystem.nix index 101bd404..4acadab3 100644 --- a/lib/nixosSystem.nix +++ b/lib/nixosSystem.nix @@ -17,7 +17,12 @@ in { # make `nix run nixpkgs#nixpkgs` use the same nixpkgs as the one used by this flake. nix.registry.nixpkgs.flake = nixpkgs; - nix.channel.enable = false; # disable nix-channel, we use flakes instead. + nix.channel.enable = false; # remove nix-channel related tools & configs, we use flakes instead. + + # but NIX_PATH is still used by many useful tools, so we set it to the same value as the one used by this flake. + # Make `nix repl ''` use the same nixpkgs as the one used by this flake. + environment.etc."nix/inputs/nixpkgs".source = "${nixpkgs}"; + environment.sessionVariables.NIX_PATH = nixpkgs.lib.mkForce "nixpkgs=/etc/nix/inputs/nixpkgs"; } nixos-generators.nixosModules.all-formats