1
0
Fork 0

Make shell scripts a bit more OS independent

This commit is contained in:
Daniel Kempkens 2022-08-02 20:48:28 +02:00
parent 4317ab1dcf
commit 693220a895
4 changed files with 12 additions and 5 deletions

View file

@ -38,7 +38,6 @@
aria2 aria2
arp-scan arp-scan
cachix cachix
cliclick
curlFull curlFull
dasel dasel
exa exa
@ -51,7 +50,6 @@
lnav lnav
mtr mtr
nix-prefetch nix-prefetch
nvd
parallel parallel
q q
ripgrep ripgrep

View file

@ -149,7 +149,7 @@
# Disable greeting # Disable greeting
set fish_greeting set fish_greeting
if [ -z "$__NIX_DARWIN_SET_ENVIRONMENT_DONE" ] if test (uname) = "Darwin"; and test -z "$__NIX_DARWIN_SET_ENVIRONMENT_DONE"
set __nifoc_nix_darwin_set_env (cat /run/current-system/etc/bashrc | grep '-set-environment' | cut -d '.' -f 2) set __nifoc_nix_darwin_set_env (cat /run/current-system/etc/bashrc | grep '-set-environment' | cut -d '.' -f 2)
fenv source "$__nifoc_nix_darwin_set_env" fenv source "$__nifoc_nix_darwin_set_env"
end end

View file

@ -1,4 +1,4 @@
{ config, pkgs, lib, ... }: { pkgs, config, lib, ... }:
let let
customPlugins = import ./plugins.nix { inherit pkgs; }; customPlugins = import ./plugins.nix { inherit pkgs; };

View file

@ -1,9 +1,18 @@
{ config, ... }: { pkgs, config, lib, ... }:
let let
inherit (pkgs.stdenv) isDarwin;
inherit (lib) optionals;
user-bin-directory = "${config.home.homeDirectory}/.bin"; user-bin-directory = "${config.home.homeDirectory}/.bin";
in in
{ {
home.packages = with pkgs; [
nvd
] ++ optionals isDarwin [
cliclick
];
home.file."${user-bin-directory}" = { home.file."${user-bin-directory}" = {
source = ./scripts; source = ./scripts;
recursive = true; recursive = true;