From 9d1f884ebafae5bb85eee37ccf359c6a1daf1e6e Mon Sep 17 00:00:00 2001 From: nx2 Date: Sun, 10 Mar 2024 23:05:53 +0100 Subject: [PATCH] fish, starship, chatterino(not configed yet), mounted shared, pw cleanup --- configuration.nix | 12 ++- hardware-configuration.nix | 6 +- home.nix | 141 ++++++++++++++++++++++++- secrets/passwords-and-certificates.nix | Bin 1449 -> 1372 bytes 4 files changed, 155 insertions(+), 4 deletions(-) diff --git a/configuration.nix b/configuration.nix index 29f9571..3f1a584 100644 --- a/configuration.nix +++ b/configuration.nix @@ -89,8 +89,16 @@ services.xserver.libinput.enable = true; hardware.uinput.enable = true; - # Define a user account. Don't forget to set a password with ‘passwd’. - users.defaultUserShell = pkgs.fish; + users.defaultUserShell = pkgs.bash; # if interactive, itll switch to fish + programs.bash = { + interactiveShellInit = '' + if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]] + then + shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION="" + exec ${pkgs.fish}/bin/fish $LOGIN_OPTION + fi + ''; + }; users.users.nx2 = { isNormalUser = true; diff --git a/hardware-configuration.nix b/hardware-configuration.nix index 18ff2b7..265661b 100644 --- a/hardware-configuration.nix +++ b/hardware-configuration.nix @@ -1,7 +1,7 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: +{ config, lib, user, pkgs, modulesPath, ... }: { imports = @@ -22,6 +22,10 @@ { device = "/dev/disk/by-uuid/0A97-7A2D"; fsType = "vfat"; }; + fileSystems."/home/${user}/shared" = + { device = "/dev/disk/by-uuid/C494BB0B94BAFF4C"; + fsType = "ntfs"; + }; swapDevices = [ ]; diff --git a/home.nix b/home.nix index b4fc625..e5130d6 100644 --- a/home.nix +++ b/home.nix @@ -27,7 +27,7 @@ home.packages = with pkgs; [ - firefox chromium + firefox chromium chatterino2 vscodium gimp inkscape kitty zathura remmina @@ -346,6 +346,145 @@ ]; }; + programs.fish = { + enable = true; + shellAliases = { + ls = "eza --icons --git --smart-group --group-directories-first"; + ll = "eza --icons --git --smart-group --group-directories-first --long"; + la = "eza --icons --git --smart-group --group-directories-first --all"; + lla = "eza --icons --git --smart-group --group-directories-first --all --long"; + lt = "eza --icons --git --smart-group --group-directories-first --long --tree"; + ltd = "eza --icons --git --smart-group --group-directories-first --long --tree -D"; + lt2 = "eza --icons --git --smart-group --group-directories-first --long --tree -L 2"; + sr = "sudo reboot"; + nf = "neofetch"; + nxf = "neofetch"; + nn = "nano"; + m = "micro"; + c = "codium"; + code = "codium"; + # ya = "yazi"; # function + nxfiglet = "figlet"; + }; + functions = { + ya = { + description = "yazi follow directory wrapper"; + body = '' + set tmp (mktemp -t "yazi-cwd.XXXXX") + yazi $argv --cwd-file="$tmp" + if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ] + cd -- "$cwd" + end + rm -f -- "$tmp" + ''; + }; + }; + # promptInit = '' + # set -x -g STARSHIP_CONFIG "${./shell/starship.toml}" + # ${pkgs.starship}/bin/starship init fish | source + # ''; + }; + + + + programs.starship = { + enable = true; + settings = { + add_newline = false; + format = "$jobs\$battery\$username\$hostname\$localip\$shlvl\$singularity\$kubernetes\$directory\$vcsh\$git_branch\$git_commit\$git_state\$git_metrics\$git_status\$hg_branch\$docker_context\$package\$c\$cmake\$cobol\$daml\$dart\$deno\$dotnet\$elixir\$elm\$erlang\$golang\$haskell\$helm\$java\$julia\$kotlin\$lua\$nim\$nodejs\$ocaml\$perl\$php\$pulumi\$purescript\$python\$raku\$rlang\$red\$ruby\$rust\$scala\$swift\$terraform\$vlang\$vagrant\$zig\$buf\$nix_shell\$conda\$meson\$spack\$memory_usage\$aws\$gcloud\$openstack\$azure\$env_var\$crystal\$custom\$sudo\$cmd_duration\$time\$status\$container\$shell\$character"; + aws.format = "[\\[$symbol($profile)(\\($region\\))(\\[$duration\\])\\]]($style)"; + bun.format = "[\\[$symbol($version)\\]]($style)"; + c.format = "[\\[$symbol($version(-$name))\\]]($style)"; + cmake.format = "[\\[$symbol($version)\\]]($style)"; + cmd_duration.format = "[\\[󰔛 $duration\\]]($style)"; + cobol.format = "[\\[$symbol($version)\\]]($style)"; + conda.format = "[\\[$symbol$environment\\]]($style)"; + crystal.format = "[\\[$symbol($version)\\]]($style)"; + daml.format = "[\\[$symbol($version)\\]]($style)"; + dart.format = "[\\[$symbol($version)\\]]($style)"; + deno.format = "[\\[$symbol($version)\\]]($style)"; + docker_context.format = "[\\[$symbol$context\\]]($style)"; + dotnet.format = "[\\[$symbol($version)(🎯 $tfm)\\]]($style)"; + elixir.format = "[\\[$symbol($version \\(OTP $otp_version\\))\\]]($style)"; + elm.format = "[\\[$symbol($version)\\]]($style)"; + erlang.format = "[\\[$symbol($version)\\]]($style)"; + gcloud.format = "[\\[$symbol$account(@$domain)(\\($region\\))\\]]($style)"; + git_branch = { + format = "[\\[$symbol$branch:]($style)"; + style = "bold green"; + }; + git_status = { + format = "([$all_status$ahead_behind]($style))(bold green)[\\]]($style)"; + style = "blue yellow"; + }; + golang.format = "[\\[$symbol($version)\\]]($style)"; + haskell.format = "[\\[$symbol($version)\\]]($style)"; + helm.format = "[\\[$symbol($version)\\]]($style)"; + hg_branch.format = "[\\[$symbol$branch\\]]($style)"; + java.format = "[\\[$symbol($version)\\]]($style)"; + julia.format = "[\\[$symbol($version)\\]]($style)"; + kotlin.format = "[\\[$symbol($version)\\]]($style)"; + kubernetes.format = "[\\[$symbol$context( \\($namespace\\))\\]]($style)"; + lua.format = "[\\[$symbol($version)\\]]($style)"; + memory_usage.format = "[\\[$symbol[$ram( | $swap)\\]]($style)"; + meson.format = "[\\[$symbol$project\\]]($style)"; + nim.format = "[\\[$symbol($version)\\]]($style)"; + nix_shell.format = "[\\[$symbol$state( \\($name\\))\\]]($style)"; + nodejs.format = "[\\[$symbol($version)\\]]($style)"; + ocaml.format = "[\\[$symbol($version)(\\($switch_indicator$switch_name\\))\\]]($style)"; + openstack.format = "[\\[$symbol$cloud(\\($project\\))\\]]($style)"; + package.format = "[\\[$symbol$version\\]]($style)"; + perl.format = "[\\[$symbol($version)\\]]($style)"; + php.format = "[\\[$symbol($version)\\]]($style)"; + pulumi.format = "[\\[$symbol$stack\\]]($style)"; + purescript.format = "[\\[$symbol($version)\\]]($style)"; + python = { + format = ''[\\[''${symbol}''${pyenv_prefix}(''${version})(\\($virtualenv\\))\\]]($style)''; + symbol = " "; + }; + raku.format = "[\\[$symbol($version-$vm_version)\\]]($style)"; + red.format = "[\\[$symbol($version)\\]]($style)"; + ruby.format = "[\\[$symbol($version)\\]]($style)"; + rust.format = "[\\[$symbol($version)\\]]($style)"; + scala.format = "[\\[$symbol($version)\\]]($style)"; + spack.format = "[\\[$symbol$environment\\]]($style)"; + sudo.format = "[\\[$symbol]\\]"; + swift.format = "[\\[$symbol($version)\\]]($style)"; + terraform.format = "[\\[$symbol$workspace\\]]($style)"; + time.format = "[\\[$time\\]]($style)"; + username.format = "[\\[$user\\]]($style)"; + vagrant.format = "[\\[$symbol($version)\\]]($style)"; + vlang.format = "[\\[$symbol($version)\\]]($style)"; + zig.format = "[\\[$symbol($version)\\]]($style)"; + directory = { + format = "[\\[]($style)[$lock_symbol]($lock_style)[$path\\]]($style)"; + style = "cyan bold"; + }; + character = { + format = "$symbol"; + success_symbol = "[\\[󰽧\\]](bold white) "; + error_symbol = "[\\[\\]](bold red) "; + vimcmd_symbol = "[\\[\\]](bold green) "; + vimcmd_replace_one_symbol = "[\\[1\\]](bold green) "; + vimcmd_replace_symbol = "[\\[R\\]](bold green) "; + vimcmd_visual_symbol = "[\\[V\\]](bold green) "; + }; + battery.format = "[\\[$symbol$percentage\\]]($style)"; + shlvl.format = "[\\[$symbol$shlvl\\]]($style)"; + singularity.format = "[\\[$symbol\\[$env\\]\\]]($style)"; + jobs = { + format = "[\\[$symbol $number\\]]($style)"; + number_threshold = 1; + }; + vcsh.format = "[\\[vcsh [$symbol$repo\\]]($style)"; + hostname = { + format = "[\\[$ssh_symbol$hostname\\]]($style)"; + ssh_symbol = "爵"; + ssh_only = true; + }; + }; + }; + gtk = { enable = true; diff --git a/secrets/passwords-and-certificates.nix b/secrets/passwords-and-certificates.nix index c773a2593187d1aab63122261c6f6306717cb7e4..6fc13dee836bd6e7cfc10d2b437474cbc318f933 100644 GIT binary patch literal 1372 zcmZQ@_Y83kiVO&0=s0-xS25#StL;Wt1U9UzWJ!D!HvjvQhl`xM@9pqdQGCwVrTTp9 z>Kv^HPSX{RyWM#{A$^vJk4{ecmb&1bT{6$_JDlK8R^B3O7#MqQ&5SRf%yg_y#NFpg z3aB>tF>m2nZT7i(U#1ml?NTxi%RGBz(H80EEAMz#?cM$EqTe=?zAhIpqpO_~xA}F- z<}f#M^k%00SooyBM@Zz=9b@|w3Oiu#J2 zHrQA$6d?bDOMQizr^3~p&l&#~Bnpf9Kl5hhdH2sdGRykwmHG2|qZ$gPKUq_@GEQ^8 z?ZYKDjS`PL90v!*u0`P95)yYF6pz2Lo>({VLValNR2iqDyS zr=M-=I(mGYbFa0uV?oBht=zNzi*Q*k)t)B3`})7{@^4sQCp#aqj!|DW;a04cK99W3 z1kQv6raa@jn<6J|JF@bs9x8=sBEoT-?=c))ex^3E$<=bccmnn67 zT6Wm_G~@gSjxi2SQU$!VUU4!1cf`2q`d=0)HNGZW=2h9PP@HtU&N+ASwU7U|OmJF| zDW+)gmdoBD>&@!+qZN(6R!dsB@7%4euOa=3f5WD>r(xYc{~Za{Iregj>cc;wtB!f9 zJ-!*q`*NqdsMt>C4W7%U-Fw~0I*mi`+tO*zpI@7%@BRILgIgNY%L{?`Gdpt=1Ct#4 zB=$QQox9c~xwWxtt^c`sYF}icD^p6mMdVJeza84(_-49u(kq*&gSXe7H~3ldf6luJ zdp#AeU-a8;-~Ozx!gf!TuuePQ+J)@@oo8KV_heI^z&SYb1lNarPau+x%+zsnDsh{e4&arJ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