[NixOS] Set NIX_PATH so that nixpkgs is always what we last built with

This commit is contained in:
Ivan Malison 2023-08-05 19:31:10 -06:00
parent dcd57e5f8e
commit 7fc65965c5
3 changed files with 10 additions and 7 deletions

2
dotfiles/config/autorandr/postswitch Executable file → Normal file
View File

@ -1 +1 @@
systemctl --user restart random-background

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env sh
function find_store_path_gc_roots {
store_path="$(realpath $1)"

View File

@ -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";
'';
};
};