Compare commits

...

18 Commits

Author SHA1 Message Date
1c3fca3518 Add jailed-agy 2026-06-12 13:38:29 +00:00
fd77e045f4 Allow unfree packages (agy) 2026-06-09 08:24:08 +00:00
4832e5d70d Remove unused files 2026-06-09 08:23:55 +00:00
a60d5b16e2 nix flake update 2026-06-08 20:44:40 +02:00
b0290b45c3 Add dia 2026-06-08 20:35:21 +02:00
95a19549db nix flake update 2026-06-07 18:44:05 +02:00
901e1129e0 Add identities module 2026-05-16 19:25:28 +02:00
3559877d25 nix flake update 2026-05-16 19:18:05 +02:00
b636b119fe Remove unused workaround 2026-05-11 15:01:17 +02:00
1f63fc0f88 Use inkscape from homebrew
The one from nixpkgs crashes
2026-05-11 14:50:43 +02:00
c94b70a45c Update README.md for new nix-deploy command 2026-05-11 14:44:15 +02:00
f55f7f6337 Add iterm2, inkscape, gimp 2026-05-11 14:42:53 +02:00
863b742ead Update nix-deploy from dotdoom version 2026-05-11 14:42:43 +02:00
cd8648da89 Add legacy temporarily to satisfy stow 2026-05-11 14:42:15 +02:00
18006d96ea nix flake update 2026-05-11 14:42:06 +02:00
bf51938c80 Update nix search URL in README 2026-05-11 14:35:29 +02:00
53826ead9a Install a few other applications via Nix 2026-03-29 14:35:04 +02:00
39985667c5 Mobile development environment 2026-03-29 14:27:26 +02:00
11 changed files with 258 additions and 254 deletions

View File

@@ -2,13 +2,20 @@ Config for my computers.
## Common operations
Update computer from my configuration:
Update computer and home from my configuration:
```
cd ~/dotfiles
nix-deploy
```
Advanced: computer only:
```
sudo darwin-rebuild switch --flake .
```
Update home from my configuration:
Advanced: home only:
```
home-manager switch --flake .
@@ -27,7 +34,7 @@ configuration after doing this.
### First search for Nix
https://search.nixos.org/packages
[search.nixos.org](https://search.nixos.org/packages?buckets={%22package_attr_set%22:[],%22package_license_set%22:[],%22package_maintainers_set%22:[],%22package_teams_set%22:[],%22package_platforms%22:[%22aarch64-darwin%22]})
Add to:

157
flake.lock generated
View File

@@ -6,20 +6,20 @@
"fw_nix": "fw_nix",
"git-hooks": "git-hooks_2",
"home-manager": "home-manager",
"jail-nix": "jail-nix",
"nix-homebrew": "nix-homebrew",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-screen": "nixpkgs-screen",
"systems": "systems_2",
"vscode-server": "vscode-server"
},
"locked": {
"lastModified": 1774784938,
"narHash": "sha256-Chh4AxbE8iygGnNdUhuTULTvXod+kUFjJTpF0PN5g68=",
"lastModified": 1781271331,
"narHash": "sha256-ut5Bb92qeovYACgLzQeg/QLKqmWuw9G/xiwTyzj6Z4o=",
"ref": "refs/heads/master",
"rev": "8c375d0a995973abec7670c07e06ec0d6c95004f",
"revCount": 472,
"rev": "a2c2b2a2e5b64d5f7664c1067fbf05f9dffb7bd6",
"revCount": 561,
"type": "git",
"url": "https://github.com/dotdoom/dotfiles.git"
},
@@ -31,16 +31,16 @@
"brew-src": {
"flake": false,
"locked": {
"lastModified": 1774235677,
"narHash": "sha256-0ryNYmzDAeRlrzPTAgmzGH/Cgc8iv/LBN6jWGUANvIk=",
"lastModified": 1779646357,
"narHash": "sha256-rnnAaESXxItX4D9xCMGvs3hfDBjbbTYht7OluRcvT8k=",
"owner": "Homebrew",
"repo": "brew",
"rev": "894a3d23ac0c8aaf561b9874b528b9cb2e839201",
"rev": "10a163ac127624caa80cc5cc5a705e97f3615b0e",
"type": "github"
},
"original": {
"owner": "Homebrew",
"ref": "5.1.1",
"ref": "5.1.14",
"repo": "brew",
"type": "github"
}
@@ -48,16 +48,16 @@
"brew-src_2": {
"flake": false,
"locked": {
"lastModified": 1774235677,
"narHash": "sha256-0ryNYmzDAeRlrzPTAgmzGH/Cgc8iv/LBN6jWGUANvIk=",
"lastModified": 1781226006,
"narHash": "sha256-w4ZTuOnhYiDxjaynrMTASzp802QblBWmo3wpB8wVN4Y=",
"owner": "Homebrew",
"repo": "brew",
"rev": "894a3d23ac0c8aaf561b9874b528b9cb2e839201",
"rev": "109191be4988470b51a60a5ef1998520aa24c01b",
"type": "github"
},
"original": {
"owner": "Homebrew",
"ref": "5.1.1",
"ref": "6.0.1",
"repo": "brew",
"type": "github"
}
@@ -70,11 +70,11 @@
]
},
"locked": {
"lastModified": 1773000227,
"narHash": "sha256-zm3ftUQw0MPumYi91HovoGhgyZBlM4o3Zy0LhPNwzXE=",
"lastModified": 1780795403,
"narHash": "sha256-AkWx4Zt9pQbD/f82Z8N57+d0HGLN/rV3gdMKJTpBPKs=",
"owner": "nix-darwin",
"repo": "nix-darwin",
"rev": "da529ac9e46f25ed5616fd634079a5f3c579135f",
"rev": "6a771120d607dcccb279a27d227650e324815c35",
"type": "github"
},
"original": {
@@ -90,11 +90,11 @@
]
},
"locked": {
"lastModified": 1773000227,
"narHash": "sha256-zm3ftUQw0MPumYi91HovoGhgyZBlM4o3Zy0LhPNwzXE=",
"lastModified": 1781242433,
"narHash": "sha256-bchLZZ3sRn740zyvD2icZSnNoTaanN0nw7l6fjVXO+E=",
"owner": "nix-darwin",
"repo": "nix-darwin",
"rev": "da529ac9e46f25ed5616fd634079a5f3c579135f",
"rev": "aabb2037edfc0f210723b72cd5f528aab5dd3f0b",
"type": "github"
},
"original": {
@@ -195,11 +195,11 @@
"systems": "systems"
},
"locked": {
"lastModified": 1774734717,
"narHash": "sha256-mmIc5ZA+hWt9IfZolKOSFEHQc0//dNei3hy7V8yblCg=",
"lastModified": 1780996927,
"narHash": "sha256-eHLRPZfoJqi65kmDmtH5WSrfB6rkmRNy9lg6r/mmmzM=",
"ref": "refs/heads/main",
"rev": "581b0c951d83f25a532cea8209eb302c18c7a826",
"revCount": 13,
"rev": "06c21a86a1e097654e0657ebff648dbd47aeac6d",
"revCount": 35,
"type": "git",
"url": "https://github.com/futureware-tech/nix.git"
},
@@ -217,11 +217,11 @@
"systems": "systems_4"
},
"locked": {
"lastModified": 1774734717,
"narHash": "sha256-mmIc5ZA+hWt9IfZolKOSFEHQc0//dNei3hy7V8yblCg=",
"lastModified": 1780996927,
"narHash": "sha256-eHLRPZfoJqi65kmDmtH5WSrfB6rkmRNy9lg6r/mmmzM=",
"ref": "refs/heads/main",
"rev": "581b0c951d83f25a532cea8209eb302c18c7a826",
"revCount": 13,
"rev": "06c21a86a1e097654e0657ebff648dbd47aeac6d",
"revCount": 35,
"type": "git",
"url": "https://github.com/futureware-tech/nix.git"
},
@@ -241,11 +241,11 @@
]
},
"locked": {
"lastModified": 1774104215,
"narHash": "sha256-EAtviqz0sEAxdHS4crqu7JGR5oI3BwaqG0mw7CmXkO8=",
"lastModified": 1778507602,
"narHash": "sha256-kTwur1wV+01SdqskVMSo6JMEpg71ps3HpbFY2GsflKs=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "f799ae951fde0627157f40aec28dec27b22076d0",
"rev": "61ab0e80d9c7ab14c256b5b453d8b3fb0189ba0a",
"type": "github"
},
"original": {
@@ -264,11 +264,11 @@
]
},
"locked": {
"lastModified": 1774104215,
"narHash": "sha256-EAtviqz0sEAxdHS4crqu7JGR5oI3BwaqG0mw7CmXkO8=",
"lastModified": 1778507602,
"narHash": "sha256-kTwur1wV+01SdqskVMSo6JMEpg71ps3HpbFY2GsflKs=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "f799ae951fde0627157f40aec28dec27b22076d0",
"rev": "61ab0e80d9c7ab14c256b5b453d8b3fb0189ba0a",
"type": "github"
},
"original": {
@@ -287,11 +287,11 @@
]
},
"locked": {
"lastModified": 1774104215,
"narHash": "sha256-EAtviqz0sEAxdHS4crqu7JGR5oI3BwaqG0mw7CmXkO8=",
"lastModified": 1778507602,
"narHash": "sha256-kTwur1wV+01SdqskVMSo6JMEpg71ps3HpbFY2GsflKs=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "f799ae951fde0627157f40aec28dec27b22076d0",
"rev": "61ab0e80d9c7ab14c256b5b453d8b3fb0189ba0a",
"type": "github"
},
"original": {
@@ -309,11 +309,11 @@
]
},
"locked": {
"lastModified": 1774104215,
"narHash": "sha256-EAtviqz0sEAxdHS4crqu7JGR5oI3BwaqG0mw7CmXkO8=",
"lastModified": 1778507602,
"narHash": "sha256-kTwur1wV+01SdqskVMSo6JMEpg71ps3HpbFY2GsflKs=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "f799ae951fde0627157f40aec28dec27b22076d0",
"rev": "61ab0e80d9c7ab14c256b5b453d8b3fb0189ba0a",
"type": "github"
},
"original": {
@@ -418,11 +418,11 @@
]
},
"locked": {
"lastModified": 1774007980,
"narHash": "sha256-FOnZjElEI8pqqCvB6K/1JRHTE8o4rer8driivTpq2uo=",
"lastModified": 1781009359,
"narHash": "sha256-w/mZkRscTatf8NWyUstli8ROzM/eopxZzi0WRjoeYkU=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "9670de2921812bc4e0452f6e3efd8c859696c183",
"rev": "c58ead12efcac436afffa93a22099a5595eb4157",
"type": "github"
},
"original": {
@@ -438,11 +438,11 @@
]
},
"locked": {
"lastModified": 1774738535,
"narHash": "sha256-2jfBEZUC67IlnxO5KItFCAd7Oc+1TvyV/jQlR+2ykGQ=",
"lastModified": 1781189114,
"narHash": "sha256-5inaamLgUMWy+MOBE9ChF9QAF1o/74LFuHkI0W/9rqc=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "769e07ef8f4cf7b1ec3b96ef015abec9bc6b1e2a",
"rev": "486595d2cf49cfcd649b58a284fa11ac0e34da22",
"type": "github"
},
"original": {
@@ -451,16 +451,46 @@
"type": "github"
}
},
"jail-nix": {
"locked": {
"lastModified": 1772137954,
"narHash": "sha256-h4MGNbOo7L3RHi4uNFmsg5g17/DHXEfnv/xiG6BrNFQ=",
"owner": "~alexdavid",
"repo": "jail.nix",
"rev": "42b355c38ca63dab4904acc5c0d95f17954a8c9b",
"type": "sourcehut"
},
"original": {
"owner": "~alexdavid",
"repo": "jail.nix",
"type": "sourcehut"
}
},
"jail-nix_2": {
"locked": {
"lastModified": 1772137954,
"narHash": "sha256-h4MGNbOo7L3RHi4uNFmsg5g17/DHXEfnv/xiG6BrNFQ=",
"owner": "~alexdavid",
"repo": "jail.nix",
"rev": "42b355c38ca63dab4904acc5c0d95f17954a8c9b",
"type": "sourcehut"
},
"original": {
"owner": "~alexdavid",
"repo": "jail.nix",
"type": "sourcehut"
}
},
"nix-homebrew": {
"inputs": {
"brew-src": "brew-src"
},
"locked": {
"lastModified": 1774720267,
"narHash": "sha256-YYftFe8jyfpQI649yfr0E+dqEXE2jznZNcYvy/lKV1U=",
"lastModified": 1780492467,
"narHash": "sha256-zMEJwtQPmsPPgPczFkyjWHgd1z0HagOPS2Wt2WDYLJY=",
"owner": "zhaofengli",
"repo": "nix-homebrew",
"rev": "a7760a3a83f7609f742861afb5732210fdc437ed",
"rev": "562332f97de9f5ba51aa647d70462e88222b2988",
"type": "github"
},
"original": {
@@ -474,11 +504,11 @@
"brew-src": "brew-src_2"
},
"locked": {
"lastModified": 1774720267,
"narHash": "sha256-YYftFe8jyfpQI649yfr0E+dqEXE2jznZNcYvy/lKV1U=",
"lastModified": 1781269551,
"narHash": "sha256-zn0rty4K5LbBAzuyJMdncDbYzSefr29IUJvcUv7kFn8=",
"owner": "zhaofengli",
"repo": "nix-homebrew",
"rev": "a7760a3a83f7609f742861afb5732210fdc437ed",
"rev": "5e721fc7756a6abffe07c7dd5ed3f9080b68108f",
"type": "github"
},
"original": {
@@ -489,11 +519,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1774386573,
"narHash": "sha256-4hAV26quOxdC6iyG7kYaZcM3VOskcPUrdCQd/nx8obc=",
"lastModified": 1781074563,
"narHash": "sha256-md8WlXOlfnIeHeOScMTTHFyf2d6iaTwPl2apR5EQ3P4=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "46db2e09e1d3f113a13c0d7b81e2f221c63b8ce9",
"rev": "9ae611a455b90cf061d8f332b977e387bda8e1ca",
"type": "github"
},
"original": {
@@ -519,22 +549,6 @@
"type": "github"
}
},
"nixpkgs-screen_2": {
"locked": {
"lastModified": 1737753705,
"narHash": "sha256-fQeXAeNQrsEUH3fd6RTjN/W+8flJiAFHo7Eya2RT87M=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e518d4ad2bcad74f98fec028cf21ce5b1e5020dd",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e518d4ad2bcad74f98fec028cf21ce5b1e5020dd",
"type": "github"
}
},
"root": {
"inputs": {
"artem_dotfiles": "artem_dotfiles",
@@ -542,9 +556,10 @@
"fw_nix": "fw_nix_2",
"git-hooks": "git-hooks_4",
"home-manager": "home-manager_2",
"jail-nix": "jail-nix_2",
"nix-homebrew": "nix-homebrew_2",
"nixpkgs": "nixpkgs",
"nixpkgs-screen": "nixpkgs-screen_2",
"nixpkgs-screen": "nixpkgs-screen",
"systems": "systems_5"
}
},

View File

@@ -30,6 +30,7 @@
url = "git+https://github.com/dotdoom/dotfiles.git";
inputs.nixpkgs.follows = "nixpkgs";
};
jail-nix.url = "sourcehut:~alexdavid/jail.nix";
};
outputs =
@@ -54,15 +55,48 @@
);
});
homeConfigurations."katarina@dia" = home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs {
system = "x86_64-linux";
};
extraSpecialArgs.primaryUser = "katarina";
modules = [
inputs.fw_nix.nixosModules.identities
inputs.artem_dotfiles.homeModules.linux-headless
./hosts/dia/home.nix
];
};
homeConfigurations."katarina@jupiter" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.aarch64-darwin;
extraSpecialArgs.primaryUser = "katarina";
modules = [
inputs.artem_dotfiles.homeModules.mac-portable
inputs.fw_nix.nixosModules.identities
./hosts/jupiter/home.nix
];
};
nixosConfigurations.dia = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
primaryUser = "katarina";
inherit (inputs) jail-nix;
};
modules = [
inputs.fw_nix.nixosModules.identities
inputs.artem_dotfiles.nixosModules.linux-headless
inputs.artem_dotfiles.nixosModules.linux-lxc
inputs.artem_dotfiles.nixosModules.jailed-agy
inputs.fw_nix.nixosModules.nix-gc
inputs.fw_nix.nixosModules.nix-settings
inputs.fw_nix.nixosModules.tools
inputs.fw_nix.nixosModules.sshd
inputs.fw_nix.nixosModules.futureware
./hosts/dia/nixos.nix
];
};
darwinConfigurations.jupiter = darwin.lib.darwinSystem {
system = "aarch64-darwin";
specialArgs.primaryUser = "katarina";
@@ -72,16 +106,6 @@
inputs.fw_nix.nixosModules.nix-settings
inputs.fw_nix.nixosModules.futureware
inputs.nix-homebrew.darwinModules.nix-homebrew
(
{ lib, ... }:
{
# TODO: find solution to these ugly workarounds
options.programs.htop = lib.mkOption {
type = lib.types.deferredModule;
default = { };
};
}
)
./hosts/jupiter/darwin.nix
];
};

22
hosts/common/home.nix Normal file
View File

@@ -0,0 +1,22 @@
{
identities,
primaryUser,
...
}:
let
user = identities.users.${primaryUser};
in
{
programs.git = {
signing = {
# Will be available on remote machines via SSH agent (Secretive).
key = "key::" + user.sign."sign@jupiter".publicKey;
signByDefault = true;
};
settings.user = {
name = "Katarina Sheremet";
inherit (user) email;
};
};
}

5
hosts/dia/home.nix Normal file
View File

@@ -0,0 +1,5 @@
_: {
imports = [
../common/home.nix
];
}

73
hosts/dia/nixos.nix Normal file
View File

@@ -0,0 +1,73 @@
{
pkgs,
identities,
primaryUser,
jail-nix,
...
}:
let
jail = jail-nix.lib.init pkgs;
in
{
users.users.${primaryUser} = {
uid = 1000;
isNormalUser = true;
extraGroups = [
"wheel"
"docker"
"kvm"
];
openssh.authorizedKeys.keys = identities.getAccessKeys { user = primaryUser; };
shell = pkgs.zsh;
};
virtualisation.docker.enable = true;
nixpkgs.config.allowUnfree = true; # for agy
environment.systemPackages = with pkgs; [
(jail "jailed-agy" pkgs.antigravity-cli (
with jail.combinators;
[
network
time-zone
no-new-session
mount-cwd
(readwrite (noescape "~/.gemini"))
# The above is a stow-controlled symlink to the following.
(readwrite (noescape "~/dotfiles/legacy/.gemini"))
(add-pkg-deps (
with pkgs;
[
bashInteractive
curl
wget
jq
git
which
ripgrep
gnugrep
gnused
gawkInteractive
ps
findutils
gzip
unzip
gnutar
diffutils
coreutils
procps
python3
]
))
]
))
];
networking = {
hostName = "dia";
domain = "home.arpa";
};
}

View File

@@ -1,5 +1,7 @@
_: {
homebrew.casks = [
"android-studio"
"gimp"
"inkscape"
];
}

View File

@@ -1,6 +1,30 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
antigravity
imports = [
../common/home.nix
];
home.packages = with pkgs; [
google-chrome
antigravity
flutter
android-tools
iterm2
zoom-us
chatgpt
antigravity-cli
];
programs.java = {
enable = true;
package = pkgs.jdk25;
};
home.sessionVariables = {
JAVA_HOME = "${pkgs.jdk25}";
JDK_HOME = "${pkgs.jdk25}";
};
}

0
legacy/.gitkeep Normal file
View File

View File

@@ -1,6 +0,0 @@
# At least have the following in .zshenv_local:
# export GIT_AUTHOR_NAME='Alfred Muster'
# export GIT_AUTHOR_EMAIL='test@example.com'
# export GIT_COMMITTER_NAME="${GIT_AUTHOR_NAME?}"
# export GIT_COMMITTER_EMAIL="${GIT_AUTHOR_EMAIL?}"
[ -r ~/.zshenv_local ] && source ~/.zshenv_local || true

View File

@@ -1,162 +0,0 @@
# Interactive shell.
export PATH="${HOME}/bin:${PATH}"
# Login shell, connected via SSH, interactive (implied by running in this file),
# not in a GNU screen session already and screen is installed: jump to an active
# screen session or start a new, UTF-8 capable.
#
# Since we exec right afterwards, there's no point in setting this shell up.
if [[ -o login ]]; then
[ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ] && \
[ -z "$STY" ] && \
which screen 2>/dev/null && \
exec screen -URR
fi
HISTFILE=~/.zsh_history
# History in the file
HISTSIZE=10000
# History in RAM
SAVEHIST=10000
setopt appendhistory
setopt SHARE_HISTORY
# Self-explanatory
setopt hist_ignore_space
setopt hist_ignore_dups
# Remove older duplicates first
setopt hist_expire_dups_first
# Store timestamps
setopt EXTENDED_HISTORY
export EDITOR=vim
# Noticing this EDITOR setting, zsh will default to vim keybindings. No thanks.
bindkey -e
export PAGER='less -R -F -X -S -n -i -m'
export LESSCHARSET=utf-8
export PYTHONSTARTUP="$HOME/.pythonstartup"
export NCURSES_NO_UTF8_ACS=1
# For ls.
export CLICOLOR=1
# For dark terminal backgrounds.
export LSCOLORS=HxFxCxDxBxEgEdHbHgHcHd
# Looking for more environment variables? Check out .zshenv!
alias rm='rm -i'
alias mv='mv -i'
alias cp='cp -i'
alias crontab='crontab -i'
alias gb='git branch'
alias gba='git branch -a'
alias gc='git commit -v'
alias gd='git diff'
alias gdc='git diff --cached'
alias gst='git status'
alias sudo='sudo -E '
alias su='su -m'
alias pager=$PAGER
alias grep='grep --line-buffered --color=auto'
alias ipt='iptables -nvL --line-numbers'
alias ip6t='ip6tables -nvL --line-numbers'
alias tcpdump='tcpdump -l'
alias ag='ag -C 2 --pager="$PAGER" --smart-case'
alias mysql='mysql --select_limit=1000'
alias logcat='adb logcat -v "color printable usec year zone" -T 10'
alias readelf='readelf -W'
alias l='ls -lA'
alias ll='ls -la'
# To kill the ControlMaster session (e.g. to modify it or when it's stuck).
alias unssh='ssh -O exit'
alias ffmpeg_q='ffmpeg -hide_banner -nostats -loglevel warning'
alias curl_t='curl -w \
"# dnslookup: %{time_namelookup} | \
connect: %{time_connect} | \
appconnect: %{time_appconnect} | \
pretransfer: %{time_pretransfer} | \
starttransfer: %{time_starttransfer} | \
total: %{time_total} | \
size: %{size_download}\n"'
# nix-deploy # current host
# nix-deploy nas # deploy nas
# nix-deploy test secondary # deploy secondary but do not add to boot
nix-deploy() {
ACTION=switch
if [ $# -gt 1 ]; then
ACTION=$1
shift
fi
if which nixos-rebuild &>/dev/null; then
COMMAND=(nixos-rebuild)
else
COMMAND=(nix run nixpkgs#nixos-rebuild --)
fi
if [ $# -gt 0 ]; then
TARGET_HOST=$1 # user@host.domain
TARGET_WITH_DOMAIN=${TARGET_HOST#*@} # host.domain
TARGET=${TARGET_WITH_DOMAIN%%.*} # host
shift
"${COMMAND[@]}" "${ACTION?}" \
--flake ".#${TARGET?}" \
--target-host "${TARGET_HOST?}" \
--sudo \
"$@" |& nom
else
sudo "${COMMAND[@]}" switch --flake . |& nom
fi
}
myip() {
if [ $# -eq 0 ]; then
curl -4 --silent http://ipecho.net/plain; echo
curl -6 --silent http://ipecho.net/plain; echo
else
ip addr show "$1" | sed -nr 's/\s+inet ([0-9.]+)\/.*/\1/p'
fi
}
colordiff() {
local gitarg file1 file2
for arg; do
gitarg="$gitarg $file1"
file1="$file2"
file2="$arg"
done
# git won't diff against a pipe, so a kind of workaround
cat "$file2" | git diff --no-prefix $gitarg --no-index "$file1" -
}
alias backup-home-explore='eval "ncdu $(grep -A1 -- --exclude $HOME/bin/backup-home | tr -d \|)"'
# stderr redirect for if direnv is missing
eval "$(direnv hook zsh 2>/dev/null)"
if [ -z "$SSH_AUTH_SOCK" -a -z "$SSH_CLIENT" ]; then
# This path is only needed in a local shell.
#
# In a screen session, we set SSH_AUTH_SOCK to a fixed path in
# .screenrc before a shell is started.
#
# That fixed path is a symlink which gets updated by .ssh/rc scrtipt.
eval `ssh-agent -s`
trap 'ssh-agent -k' EXIT
fi
autoload -Uz vcs_info
precmd_functions+=( vcs_info )
zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:*' stagedstr '%F{green}*%f'
zstyle ':vcs_info:*' unstagedstr '%F{red}*%f'
zstyle ':vcs_info:git:*' formats ' (%F{cyan}%b%f%c%u)'
setopt prompt_subst
PROMPT='${IN_NIX_SHELL}%(?..%F{red}%?%f )[%n@%m] %3~${vcs_info_msg_0_} %# '
# Expand aliases by the press of TAB.
zstyle ':completion:*' completer _expand_alias _complete _ignored
[ -r ~/.zshrc_local ] && source ~/.zshrc_local || true