fixed some broken stuff.

This commit is contained in:
Gabe Venberg 2024-03-18 20:45:03 -05:00
parent 2b11da0b62
commit 54d8dcbe11
5 changed files with 172 additions and 6 deletions

View file

@ -4,8 +4,9 @@ all of my dotfiles, managed with (https://www.gnu.org/software/stow/manual/stow.
I am working on migrating my dotfiles to nix, to allow configuration and installation in a single step. I am working on migrating my dotfiles to nix, to allow configuration and installation in a single step.
In order to use the nix setup, you need to install nix and enable flakes, In order to use the nix setup, you need to install nix and enable flakes,
then run `nix run --no-write-lock-file github:nix-community/home-manager/ -- --impure --flake . switch`, while in the nix directory. then run `nix run --extra-experimental-features "nix-command flakes" --no-write-lock-file github:nix-community/home-manager/ -- --extra-experimental-features "nix-command flakes" --impure --flake . switch`, while in the nix directory.
from then on, you can update your configuration after making a change with `home-manager --impure --flake . switch` from then on, you can update your configuration after making a change with `home-manager --impure --flake . switch`.
Alternatively, if you have `just` installed, you can use `just boostrap` and `just switch`, instead.
## Dependencies: ## Dependencies:
This does not list the package manager dependencies of the programs the dotfiles are for, but any extra dependencies that are needed for the specific configuration. This does not list the package manager dependencies of the programs the dotfiles are for, but any extra dependencies that are needed for the specific configuration.

View file

@ -15,6 +15,8 @@ in {
home.packages = [ home.packages = [
pkgs.zellij pkgs.zellij
pkgs.sshfs
]; ];
# Home Manager is pretty good at managing dotfiles. The primary way to manage # Home Manager is pretty good at managing dotfiles. The primary way to manage
@ -25,16 +27,15 @@ in {
}; };
home.sessionVariables = { home.sessionVariables = {
# EDITOR = "emacs";
EDITOR = "nvim"; EDITOR = "nvim";
VISUAL = "nvim"; VISUAL = "nvim";
}; };
home.sessionPath = [ home.sessionPath = [
"$HOME/.nix-profile/bin/"
"$HOME/.local/bin/" "$HOME/.local/bin/"
"$HOME/.cargo/bin/" "$HOME/.cargo/bin/"
"/opt/" "/opt/"
"$HOME/.nix-profile/bin/"
]; ];
home.shellAliases = { home.shellAliases = {
@ -219,6 +220,7 @@ in {
}; };
}; };
#sessionVariables, sessionPath and shellAliases are not applied to nushell.
programs.nushell = { programs.nushell = {
enable = true; enable = true;
configFile.source = lib.path.append dotfilesDirectory "nushell/config.nu"; configFile.source = lib.path.append dotfilesDirectory "nushell/config.nu";
@ -258,4 +260,10 @@ in {
# Let Home Manager install and manage itself. # Let Home Manager install and manage itself.
programs.home-manager.enable = true; programs.home-manager.enable = true;
# enable flakes
nix = {
package = pkgs.nix;
settings.experimental-features = [ "nix-command" "flakes" ];
};
} }

5
nix/justfile Normal file
View file

@ -0,0 +1,5 @@
switch:
home-manager --impure --flake . switch
bootstrap:
nix run --extra-experimental-features "nix-command flakes" --no-write-lock-file github:nix-community/home-manager/ -- --extra-experimental-features "nix-command flakes" --impure --flake . switch

View file

@ -2,6 +2,139 @@
# #
# version = "0.91.0" # version = "0.91.0"
# For more information on defining custom themes, see
# https://www.nushell.sh/book/coloring_and_theming.html
# And here is the theme collection
# https://github.com/nushell/nu_scripts/tree/main/themes
let dark_theme = {
# color for nushell primitives
separator: white
leading_trailing_space_bg: { attr: n } # no fg, no bg, attr none effectively turns this off
header: green_bold
empty: blue
# Closures can be used to choose colors for specific values.
# The value (in this case, a bool) is piped into the closure.
# eg) {|| if $in { 'light_cyan' } else { 'light_gray' } }
bool: light_cyan
int: white
filesize: cyan
duration: white
date: purple
range: white
float: white
string: white
nothing: white
binary: white
cell-path: white
row_index: green_bold
record: white
list: white
block: white
hints: dark_gray
search_result: {bg: red fg: white}
shape_and: purple_bold
shape_binary: purple_bold
shape_block: blue_bold
shape_bool: light_cyan
shape_closure: green_bold
shape_custom: green
shape_datetime: cyan_bold
shape_directory: cyan
shape_external: cyan
shape_externalarg: green_bold
shape_external_resolved: light_yellow_bold
shape_filepath: cyan
shape_flag: blue_bold
shape_float: purple_bold
# shapes are used to change the cli syntax highlighting
shape_garbage: { fg: white bg: red attr: b}
shape_globpattern: cyan_bold
shape_int: purple_bold
shape_internalcall: cyan_bold
shape_keyword: cyan_bold
shape_list: cyan_bold
shape_literal: blue
shape_match_pattern: green
shape_matching_brackets: { attr: u }
shape_nothing: light_cyan
shape_operator: yellow
shape_or: purple_bold
shape_pipe: purple_bold
shape_range: yellow_bold
shape_record: cyan_bold
shape_redirection: purple_bold
shape_signature: green_bold
shape_string: green
shape_string_interpolation: cyan_bold
shape_table: blue_bold
shape_variable: purple
shape_vardecl: purple
}
let light_theme = {
# color for nushell primitives
separator: dark_gray
leading_trailing_space_bg: { attr: n } # no fg, no bg, attr none effectively turns this off
header: green_bold
empty: blue
# Closures can be used to choose colors for specific values.
# The value (in this case, a bool) is piped into the closure.
# eg) {|| if $in { 'dark_cyan' } else { 'dark_gray' } }
bool: dark_cyan
int: dark_gray
filesize: cyan_bold
duration: dark_gray
date: purple
range: dark_gray
float: dark_gray
string: dark_gray
nothing: dark_gray
binary: dark_gray
cell-path: dark_gray
row_index: green_bold
record: dark_gray
list: dark_gray
block: dark_gray
hints: dark_gray
search_result: {fg: white bg: red}
shape_and: purple_bold
shape_binary: purple_bold
shape_block: blue_bold
shape_bool: light_cyan
shape_closure: green_bold
shape_custom: green
shape_datetime: cyan_bold
shape_directory: cyan
shape_external: cyan
shape_externalarg: green_bold
shape_external_resolved: light_purple_bold
shape_filepath: cyan
shape_flag: blue_bold
shape_float: purple_bold
# shapes are used to change the cli syntax highlighting
shape_garbage: { fg: white bg: red attr: b}
shape_globpattern: cyan_bold
shape_int: purple_bold
shape_internalcall: cyan_bold
shape_keyword: cyan_bold
shape_list: cyan_bold
shape_literal: blue
shape_match_pattern: green
shape_matching_brackets: { attr: u }
shape_nothing: light_cyan
shape_operator: yellow
shape_or: purple_bold
shape_pipe: purple_bold
shape_range: yellow_bold
shape_record: cyan_bold
shape_redirection: purple_bold
shape_signature: green_bold
shape_string: green
shape_string_interpolation: cyan_bold
shape_table: blue_bold
shape_variable: purple
shape_vardecl: purple
}
let fish_completer = {|spans| let fish_completer = {|spans|
fish --command $'complete "--do-complete=($spans | str join " ")"' fish --command $'complete "--do-complete=($spans | str join " ")"'
@ -726,6 +859,13 @@ alias la = ls -a
alias ll = ls -l alias ll = ls -l
alias lla = ls -la alias lla = ls -la
alias pyactivate = overlay use ./.venv/bin/activate alias pyactivate = overlay use ./.venv/bin/activate
alias say = espeak -p 10 -s 150 -a 200
alias tmux = tmux -u
alias pdfmk = latexmk -lualatex -pvc
# converts all .doc and .docx files in the local directory to pdfs using libreoffice
alias doc2pdf = loffice --convert-to pdf --headless *.docx
#common options for sshfs
alias sshmnt = sshfs -o idmap=user,compression=no,reconnect,follow_symlinks,dir_cache=yes,ServerAliveInterval=15
# display a slideshow of all pics in a directory, recursively # display a slideshow of all pics in a directory, recursively
def slideshow [delay: int = 10] { def slideshow [delay: int = 10] {

View file

@ -89,6 +89,10 @@ def is-installed [ app: string ] {
((which $app | length) > 0) ((which $app | length) > 0)
} }
const conditional_config = ($nu.temp-path | path join 'conditional-config.nu')
'# This file is an ugly hack to conditionally source files and define aliases/custom commands.
' | save --force $conditional_config
# To add entries to PATH (on Windows you might use Path), you can use the following pattern: # To add entries to PATH (on Windows you might use Path), you can use the following pattern:
# $env.PATH = ($env.PATH | split row (char esep) | prepend '/some/path') # $env.PATH = ($env.PATH | split row (char esep) | prepend '/some/path')
# $env.PATH = ($env.PATH | split row (char esep) | append ($nu.home-path | path join ".local/bin/")) # $env.PATH = ($env.PATH | split row (char esep) | append ($nu.home-path | path join ".local/bin/"))
@ -96,8 +100,16 @@ def is-installed [ app: string ] {
# $env.PATH = ($env.PATH | split row (char esep) | append ($nu.home-path | path join "opt")) # $env.PATH = ($env.PATH | split row (char esep) | append ($nu.home-path | path join "opt"))
# An alternate way to add entries to $env.PATH is to use the custom command `path add` # An alternate way to add entries to $env.PATH is to use the custom command `path add`
# which is built into the nushell stdlib: # which is built into the nushell stdlib:
# use std "path add" use std "path add"
# $env.PATH = ($env.PATH | split row (char esep)) $env.PATH = ($env.PATH | split row (char esep))
path add ($env.HOME | path join ".cargo " "bin")
path add ($env.HOME | path join ".local" "bin")
path add ($env.HOME | path join ".nix-profile" "bin")
path add ('/opt')
$env.PATH = ($env.PATH | uniq)
$env.EDITOR = nvim
$env.VISUAL = nvim
ls (($nu.default-config-dir | path join ('scripts/**/*.nu')) | into glob) | ls (($nu.default-config-dir | path join ('scripts/**/*.nu')) | into glob) |
each { |it| $"source ($it.name)\n" | save --append $conditional_config} | ignore each { |it| $"source ($it.name)\n" | save --append $conditional_config} | ignore