Compare commits

..

4 Commits

6 changed files with 34 additions and 83 deletions

View File

@ -1,5 +1,7 @@
{ system, pkgs, nixpkgs-flake, ... }:
{ system, pkgs, pkgs-unsupported, nixpkgs-flake, ... }:
let prismlauncher = pkgs-unsupported.prismlauncher.override { jdks = [ pkgs.jdk8 pkgs.jdk21 ]; };
in
{
# TODO: nix options should be joint for darwin and nix-os
nix.gc = {
@ -90,6 +92,8 @@
coreutils
git
zulu8 # for minecraft
home-manager
keepassxc
@ -102,6 +106,8 @@
hexfiend
inkscape
pkgs-unsupported.prismlauncher
wireshark
];

View File

@ -1,83 +1,12 @@
#!/bin/zsh
export PATH="$HOME/.cargo/bin:$PATH"
export PATH="/Applications/ARM/bin:$PATH"
alias ls="ls --color=auto"
alias bashcols="python3 ~/cloud/Projekt/Programmering/Python/BashCols.py"
alias bashcurmov="python3 ~/cloud/Projekt/Programmering/Python/Bashcurmoves.py"
alias objdump="objdump -M intel"
alias atsc="patscc -cleanaft -DATS_MEMALLOC_LIBC"
alias i2="idris2"
alias py="python"
alias ipy="ipython"
alias c="cargo"
alias bqn="rlwrap BQN"
alias nix-zsh="nix-shell --run zsh"
alias z=nix-zsh
_BLUE="\033[38;5;4m"
_GREEN="\033[38;5;2m"
_RED="\033[38;5;1m"
_RESET="\033[0m"
function activate {
(
cd ~/cloud/Projekt
F=$( fd '' -t d -d 4 . | fzf -1 -q "$1" ) || return
LINKEE=$(realpath "$F")
DEFAULT_NAME=$(basename "$LINKEE")
LINK="${2:-${DEFAULT_NAME}}"
cd ~/cloud/A-Aktivta
if [[ -d "$LINK" ]] then
echo "Project ${_BLUE}$LINK${_RESET} already exists!"
else
echo "${_BLUE}$LINK${_RESET} -> ${_BLUE}$LINKEE${_RESET} has been ${_GREEN}activated${_RESET}"
ln -s "$LINKEE" "$LINK"
fi
)
_check_proj_count
dev() {
nix develop ".#${1:-default}" -c "$SHELL"
}
function _check_proj_count {
(
cd ~/cloud/A-Aktivta
N_FILES=$(ls | wc -l | tr -d ' ')
if [[ $N_FILES > 4 ]] then
echo "You have $_RED$N_FILES$_RESET active projets. Consider deactivating some"
fi
)
}
function deactivate {
(
cd ~/cloud/A-Aktivta
F=$( fd '' -t l -d 1 . | fzf -1 -q "$1" ) || return
rm "$F"
echo "Deactivated $_BLUE$F$RESET"
)
_check_proj_count
}
function project {
pushd >/dev/null
cd ~/cloud/A-Aktivta
PROJ_NAME=$( fd '' -t l -d 1 . | fzf -1 -q "$1" ) || { popd >/dev/null ; return }
F=$(realpath "$PROJ_NAME")
echo "In $_BLUE${PROJ_NAME}$_RESET"
cd "$F"
_check_proj_count
}
alias p=project
setopt prompt_subst
# export RPROMPT='%(?.%F{green}√.%?%F{red}?)%f'
# tmux stuff
function setwd {
tmux command-prompt -I "attach -c $(pwd)"
}
alias nix-zsh="nix-shell --run zsh"

View File

@ -38,6 +38,7 @@
outputs = { self, nixpkgs, home-manager, nix-darwin, kak, unispect, ansi-utils, unambig-path, nixos-apple-silicon }:
let
mkPkgs = system: import nixpkgs { system = system; config.allowUnfree = true; };
mkPkgsUnsupported = system: import nixpkgs { system = system; config.allowUnfree = true; config.allowUnsupportedSystem = true; };
mkHome = {username, home-dir, prompt-color, system, pkgs} : import ./home/common.nix {
inherit username home-dir prompt-color pkgs;
@ -53,8 +54,8 @@
inherit pkgs;
};
mkDarwin = {system, pkgs}: import ./darwin.nix {
inherit system pkgs;
mkDarwin = {system, pkgs, pkgs-unsupported}: import ./darwin.nix {
inherit system pkgs pkgs-unsupported;
nixpkgs-flake = nixpkgs;
};
@ -88,7 +89,8 @@
let
system = "aarch64-darwin";
pkgs = mkPkgs system;
darwin = mkDarwin { inherit system pkgs; };
pkgs-unsupported = mkPkgsUnsupported system;
darwin = mkDarwin { inherit system pkgs pkgs-unsupported; };
in nix-darwin.lib.darwinSystem {
modules = [ darwin ];
};

View File

@ -54,7 +54,7 @@ esac";
};
mouse.hide_when_typing = stdenv.isDarwin;
font = {
normal.family = "SAX2";
normal.family = "uzura_font";
size = font-size;
};
colors.primary = {

View File

@ -95,14 +95,11 @@ in rec {
echo -en "%{\033[0m\033[38:5:''${BG}m%}"
echo -en "%{\033[0m%} ";
)'
setopt prompt_subst
''
+ builtins.readFile ../dotfiles/zshrc;
};
home.shellAliases = {
dev = "nix develop -c $SHELL";
};
programs.direnv = {
enable = true;
enableZshIntegration = true;
@ -173,6 +170,7 @@ in rec {
pull.ff = "only";
pull.rebase = true;
core.editor = "kak";
core.fileMode = false; # don't track changes to file modes
};
};
}

View File

@ -95,8 +95,24 @@ rec {
sha256 = "sha256-tZnDoxZnIrZkTwjOTUjGcqLaXtdZ2Tl6gcRXMclT6PY=";
};
uzura = pkgs.fetchurl {
name = "uzura";
url = "http://azukifont.com/font/uzurafont100.zip";
downloadToTemp = true;
recursiveHash = true;
postFetch = ''
mkdir -p $out/share/fonts/opentype
${pkgs.unzip}/bin/unzip -j $downloadedFile 'uzurafont100/uzura.ttf' -d $out/share/fonts/opentype
'';
sha256 = "sha256-FXkb7JQ+CYAKnOgIkeOxPovjVfIOn3xUQHWUT2oCIEM=";
};
all = [
qr-generator qr-paste
sax2 manrope metrophobic cleanvertising stencila
sax2 manrope metrophobic cleanvertising stencila uzura
];
}