From 7fc65965c5e35798fb74560572ba936eda4a7de7 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 5 Aug 2023 19:31:10 -0600 Subject: [PATCH] [NixOS] Set NIX_PATH so that nixpkgs is always what we last built with --- dotfiles/config/autorandr/postswitch | 2 +- dotfiles/lib/functions/find_store_path_gc_roots | 2 +- nixos/environment.nix | 13 ++++++++----- 3 files changed, 10 insertions(+), 7 deletions(-) mode change 100755 => 100644 dotfiles/config/autorandr/postswitch diff --git a/dotfiles/config/autorandr/postswitch b/dotfiles/config/autorandr/postswitch old mode 100755 new mode 100644 index 8b137891..161bfa6a --- a/dotfiles/config/autorandr/postswitch +++ b/dotfiles/config/autorandr/postswitch @@ -1 +1 @@ - +systemctl --user restart random-background diff --git a/dotfiles/lib/functions/find_store_path_gc_roots b/dotfiles/lib/functions/find_store_path_gc_roots index ca71f80c..10a523d5 100755 --- a/dotfiles/lib/functions/find_store_path_gc_roots +++ b/dotfiles/lib/functions/find_store_path_gc_roots @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh function find_store_path_gc_roots { store_path="$(realpath $1)" diff --git a/nixos/environment.nix b/nixos/environment.nix index 652d5b47..1db32a47 100644 --- a/nixos/environment.nix +++ b/nixos/environment.nix @@ -1,4 +1,4 @@ -{ config, pkgs, options, lib, ... }: +{ config, pkgs, options, lib, inputs, ... }: with lib; { options = { @@ -46,6 +46,11 @@ with lib; shellAliases = { df_ssh = "TERM='xterm-256color ssh -o StrictHostKeyChecking=no'"; }; + variables = { + ROFI_SYSTEMD_TERM = "alacritty -e"; + NIXPKGS_GIT_REV = "${inputs.nixpkgs.rev}"; + NIXPKGS_SOURCE = "${inputs.nixpkgs.outPath}"; + }; interactiveShellInit = '' vterm_printf(){ if [ -n "$TMUX" ] && ([ "''${TERM%%-*}" = "tmux" ] || [ "''${TERM%%-*}" = "screen" ] ); then @@ -66,10 +71,8 @@ with lib; export STARSHIP_INSIDE_EMACS="yes" ''; extraInit = '' - export ROFI_SYSTEMD_TERM="alacritty -e" - export PATH="${libDir}/bin:$PATH" - export PATH="${libDir}/functions:$PATH" - export PATH="$HOME/.cargo/bin:$PATH" + export NIX_PATH="nixpkgs=${inputs.nixpkgs.outPath}:$NIX_PATH"; + export PATH="$HOME/.cargo/bin:${libDir}/bin:${libDir}/functions:$PATH"; ''; }; };