Compare commits

..

No commits in common. "5a3dda7a106a9ccce540264e1455fe6888b51a02" and "543611983cd66449378ada55e33d6d0bff7a6e55" have entirely different histories.

7 changed files with 57 additions and 73 deletions

View file

@ -231,20 +231,7 @@
# for each hostname, for each user, generate an attribute "${user}@${hostname}" # for each hostname, for each user, generate an attribute "${user}@${hostname}"
homeConfigurations = homeConfigurations =
{ builtins.listToAttrs (builtins.concatLists
"chayleaf@hysteria" = inputs.home-manager.lib.homeManagerConfiguration {
pkgs = mkPkgs {
system = "x86_64-linux";
overlays = [ overlay ];
};
extraSpecialArgs = { inherit inputs; };
modules = [
./home/hosts/remote.nix
({ pkgs, ... }: { home.file.hysteria.source = pkgs.hysteria; })
];
};
}
// builtins.listToAttrs (builtins.concatLists
(lib.flip lib.mapAttrsToList config (lib.flip lib.mapAttrsToList config
(hostname: { system, home ? {}, ... }: (hostname: { system, home ? {}, ... }:
let let

View file

@ -1,15 +0,0 @@
{ inputs
, ...
}:
{
imports = [
../modules/general.nix
inputs.nur.nixosModules.nur
];
home.stateVersion = "24.05";
home.username = "chayleaf";
home.homeDirectory = "/home/chayleaf";
minimal = true;
}

View file

@ -99,10 +99,10 @@
# the following 4 values are special in some way # the following 4 values are special in some way
# (e.g. even if you use -gx to set them, it won't work) # (e.g. even if you use -gx to set them, it won't work)
set -U _tide_left_items context pwd git vi_mode set -U _tide_left_items pwd git vi_mode
set -U _tide_prompt_69105 \x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b34m\x1b\x5b44m\x20\x40PWD\x40\x20\x1b\x5b34m\x1b\x5b40m\ue0b0\x1b\x5b32m\x1b\x5b40m\x20\u276f\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b30m\ue0b0 \x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b30m\ue0b2\x1b\x5b32m\x1b\x5b40m\x20\uf00c\x20\x1b\x5b33m\x1b\x5b40m\ue0b2\x1b\x5b30m\x1b\x5b43m\x2021m\x2023s\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b33m set -U _tide_prompt_69105 \x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b34m\x1b\x5b44m\x20\x40PWD\x40\x20\x1b\x5b34m\x1b\x5b40m\ue0b0\x1b\x5b32m\x1b\x5b40m\x20\u276f\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b30m\ue0b0 \x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b30m\ue0b2\x1b\x5b32m\x1b\x5b40m\x20\uf00c\x20\x1b\x5b33m\x1b\x5b40m\ue0b2\x1b\x5b30m\x1b\x5b43m\x2021m\x2023s\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b33m
set -U _tide_prompt_79899 \x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b34m\x1b\x5b44m\x20\x40PWD\x40\x20\x1b\x5b34m\x1b\x5b40m\ue0b0\x1b\x5b32m\x1b\x5b40m\x20\u276f\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b30m\ue0b0 \x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b30m\ue0b2\x1b\x5b32m\x1b\x5b40m\x20\uf00c\x20\x1b\x5b33m\x1b\x5b40m\ue0b2\x1b\x5b30m\x1b\x5b43m\x2015s\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b33m set -U _tide_prompt_79899 \x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b34m\x1b\x5b44m\x20\x40PWD\x40\x20\x1b\x5b34m\x1b\x5b40m\ue0b0\x1b\x5b32m\x1b\x5b40m\x20\u276f\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b30m\ue0b0 \x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b30m\ue0b2\x1b\x5b32m\x1b\x5b40m\x20\uf00c\x20\x1b\x5b33m\x1b\x5b40m\ue0b2\x1b\x5b30m\x1b\x5b43m\x2015s\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b33m
set -U _tide_right_items status cmd_duration jobs rustc nix_shell set -U _tide_right_items status cmd_duration context jobs rustc nix_shell
# for the following values, -gx works too (-g doesn't) # for the following values, -gx works too (-g doesn't)
# but it pollutes children's env, so do -U # but it pollutes children's env, so do -U
@ -160,7 +160,7 @@
set -U tide_kubectl_color black set -U tide_kubectl_color black
set -U tide_kubectl_icon \u2388 set -U tide_kubectl_icon \u2388
set -U tide_left_prompt_frame_enabled false set -U tide_left_prompt_frame_enabled false
set -U tide_left_prompt_items context pwd git vi_mode set -U tide_left_prompt_items pwd git vi_mode
set -U tide_left_prompt_prefix set -U tide_left_prompt_prefix
set -U tide_left_prompt_separator_diff_color \ue0b0 set -U tide_left_prompt_separator_diff_color \ue0b0
set -U tide_left_prompt_separator_same_color \ue0b1 set -U tide_left_prompt_separator_same_color \ue0b1
@ -195,7 +195,7 @@
set -U tide_pwd_icon_unwritable \uf023 set -U tide_pwd_icon_unwritable \uf023
set -U tide_pwd_markers \x2ebzr \x2ecitc \x2egit \x2ehg \x2enode\x2dversion \x2epython\x2dversion \x2eruby\x2dversion \x2eshorten_folder_marker \x2esvn \x2eterraform Cargo\x2etoml composer\x2ejson CVS go\x2emod package\x2ejson set -U tide_pwd_markers \x2ebzr \x2ecitc \x2egit \x2ehg \x2enode\x2dversion \x2epython\x2dversion \x2eruby\x2dversion \x2eshorten_folder_marker \x2esvn \x2eterraform Cargo\x2etoml composer\x2ejson CVS go\x2emod package\x2ejson
set -U tide_right_prompt_frame_enabled false set -U tide_right_prompt_frame_enabled false
set -U tide_right_prompt_items status cmd_duration jobs node rustc java php go kubectl toolbox terraform aws nix_shell crystal set -U tide_right_prompt_items status cmd_duration context jobs node rustc java php go kubectl toolbox terraform aws nix_shell crystal
set -U tide_right_prompt_prefix \ue0b2 set -U tide_right_prompt_prefix \ue0b2
set -U tide_right_prompt_separator_diff_color \ue0b2 set -U tide_right_prompt_separator_diff_color \ue0b2
set -U tide_right_prompt_separator_same_color \ue0b3 set -U tide_right_prompt_separator_same_color \ue0b3

View file

@ -11,9 +11,9 @@
./zsh.nix ./zsh.nix
./fish.nix ./fish.nix
]; ];
manual.json.enable = !config.minimal; manual.json.enable = true;
services.gpg-agent = { services.gpg-agent = {
enable = !config.minimal; enable = true;
enableSshSupport = true; enableSshSupport = true;
maxCacheTtl = 72000; maxCacheTtl = 72000;
maxCacheTtlSsh = 72000; maxCacheTtlSsh = 72000;
@ -65,14 +65,14 @@
extraPackages = with pkgs; [ extraPackages = with pkgs; [
# utils # utils
gnused mktemp fzf coreutils-full findutils xdg-utils gnupg whois curl gnused mktemp fzf coreutils-full findutils xdg-utils gnupg whois curl
file mediainfo unzip gnutar man rclone file mediainfo unzip gnutar man rclone sshfs trash-cli
# for preview # for preview
# exa - TODO: replace with eza wrapper? # exa - TODO: replace with eza wrapper?
bat libarchive atool glow bat
libarchive atool
glow w3m
# for opening # for opening
p7zip unrar-wrapper p7zip unrar-wrapper odt2txt
] ++ lib.optionals (!config.minimal) [
odt2txt w3m sshfs trash-cli
]; ];
plugins = { plugins = {
src = pluginSrc; src = pluginSrc;
@ -92,14 +92,14 @@
home-manager.enable = true; home-manager.enable = true;
# i only use this as a login shell # i only use this as a login shell
bash = { bash = {
enable = !config.minimal; enable = true;
initExtra = '' initExtra = ''
bind -x '"\C-r": __atuin_history' bind -x '"\C-r": __atuin_history'
export ATUIN_NOBIND=true export ATUIN_NOBIND=true
''; '';
}; };
git = { git = {
enable = !config.minimal; enable = true;
package = pkgs.gitAndTools.gitFull; package = pkgs.gitAndTools.gitFull;
delta.enable = true; delta.enable = true;
extraConfig = { extraConfig = {
@ -135,7 +135,7 @@
}; };
}; };
ssh = { ssh = {
enable = !config.minimal; enable = true;
compression = true; compression = true;
}; };
tmux = { tmux = {
@ -145,7 +145,7 @@
keyMode = "vi"; keyMode = "vi";
}; };
gpg = { gpg = {
enable = !config.minimal; enable = true;
homedir = "${config.xdg.dataHome}/gnupg"; homedir = "${config.xdg.dataHome}/gnupg";
mutableKeys = true; mutableKeys = true;
mutableTrust = true; mutableTrust = true;
@ -156,7 +156,7 @@
variables.show-mode-in-prompt = true; variables.show-mode-in-prompt = true;
}; };
nix-index = { nix-index = {
enable = !config.minimal; enable = true;
# don't add pkgs.nix to PATH # don't add pkgs.nix to PATH
# use the nix that's already in PATH # use the nix that's already in PATH
# (because I use nix plugins and plugins are nix version-specific) # (because I use nix plugins and plugins are nix version-specific)
@ -168,38 +168,31 @@
# vimKeys = true; # vimKeys = true;
#}; #};
alot = { alot = {
enable = !config.minimal; enable = true;
settings = { settings = {
handle_mouse = true; handle_mouse = true;
initial_command = "search tag:inbox AND NOT tag:killed"; initial_command = "search tag:inbox AND NOT tag:killed";
prefer_plaintext = true; prefer_plaintext = true;
}; };
}; };
msmtp.enable = !config.minimal; msmtp.enable = true;
notmuch = { notmuch = {
enable = !config.minimal; enable = true;
hooks.preNew = '' hooks.preNew = ''
${config.services.mbsync.package}/bin/mbsync --all || ${pkgs.coreutils}/bin/true ${config.services.mbsync.package}/bin/mbsync --all || ${pkgs.coreutils}/bin/true
''; '';
}; };
mbsync.enable = !config.minimal; mbsync.enable = true;
}; };
#services.mbsync.enable = true; #services.mbsync.enable = true;
# TODO: see https://github.com/pazz/alot/issues/1632 # TODO: see https://github.com/pazz/alot/issues/1632
home.file.".mailcap" = lib.mkIf (!config.minimal) { home.file.".mailcap".text = ''
text = ''
text/html; ${pkgs.w3m}/bin/w3m -dump -o document_charset=%{charset} -o display_link_number=1 '%s'; nametemplate=%s.html; copiousoutput text/html; ${pkgs.w3m}/bin/w3m -dump -o document_charset=%{charset} -o display_link_number=1 '%s'; nametemplate=%s.html; copiousoutput
''; '';
};
home.file.".cache/nix-index/files" = lib.mkIf (!config.minimal) { home.file.".cache/nix-index/files".source = assert config.xdg.cacheHome == "${config.home.homeDirectory}/.cache"; inputs.nix-index-database.packages.${pkgs.system}.nix-index-database;
source =
assert config.xdg.cacheHome == "${config.home.homeDirectory}/.cache";
inputs.nix-index-database.packages.${pkgs.system}.nix-index-database;
};
systemd.user.tmpfiles.rules = lib.mkIf (!config.minimal) systemd.user.tmpfiles.rules = builtins.map (file: "r! \"/home/${config.home.username}/${file}\"") [
(builtins.map (file: "r! \"/home/${config.home.username}/${file}\"") [
".local/share/clipman.json" ".local/share/clipman.json"
".local/state/lesshst" # I don't need less search history to persist across boots... ".local/state/lesshst" # I don't need less search history to persist across boots...
".Xauthority" ".Xauthority"
@ -308,14 +301,12 @@
] ++ builtins.map (dir: "x \"/home/${config.home.username}/${dir}/\"") [ ] ++ builtins.map (dir: "x \"/home/${config.home.username}/${dir}/\"") [
# WHY DOES THIS KEEP PART OF THE CONFIG # WHY DOES THIS KEEP PART OF THE CONFIG
".cache/keepassxc" ".cache/keepassxc"
]); ];
home.packages = with pkgs; [ home.packages = with pkgs; [
rclone sshfs fuse rclone sshfs fuse
file jq python3Full killall file jq python3Full killall
comma nix-output-monitor appimage-run comma nix-output-monitor
unzip p7zip unrar-wrapper unzip p7zip unrar-wrapper
] ++ lib.optionals (!config.minimal) [
appimage-run
]; ];
} }

View file

@ -1,9 +1,5 @@
{ lib, config, ... }: { lib, config, ... }:
with lib; { with lib; {
options.minimal = mkOption {
type = types.bool;
default = false;
};
options.phone = { options.phone = {
enable = mkOption { enable = mkOption {
type = types.bool; type = types.bool;

View file

@ -1,7 +1,7 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
programs.zsh = { programs.zsh = {
enable = !config.minimal; enable = true;
# zsh-autosuggestions # zsh-autosuggestions
autosuggestion.enable = true; autosuggestion.enable = true;
# zsh-syntax-highlighting # zsh-syntax-highlighting

View file

@ -35,7 +35,7 @@ in
"net.ipv4.tcp_congestion_control" = "bbr"; "net.ipv4.tcp_congestion_control" = "bbr";
}; };
# as expected, systemd initrd didn't work well, and i really cba to debug it # as expected, systemd initrd and networking didn't work well, and i really cba to debug it
networking.useDHCP = false; networking.useDHCP = false;
networking.useNetworkd = true; networking.useNetworkd = true;
systemd.network = { systemd.network = {
@ -50,22 +50,46 @@ in
networks."10-dhcp" = { networks."10-dhcp" = {
DHCP = "yes"; DHCP = "yes";
name = "e*"; name = "e*";
networkConfig.IPv6AcceptRA = "yes"; networkConfig = {
IPv6AcceptRA = "yes";
};
dhcpV4Config = { dhcpV4Config = {
ClientIdentifier = "mac"; ClientIdentifier = "mac";
DUIDType = "link-layer"; DUIDType = "link-layer";
}; };
dhcpV6Config.DUIDType = "link-layer"; dhcpV6Config = {
DUIDType = "link-layer";
};
}; };
}; };
boot.initrd = { boot.initrd = {
/*systemd = {
enable = true;
network = {
enable = true;
links."10-mac" = {
matchConfig.OriginalName = "e*";
linkConfig = {
MACAddressPolicy = "none";
MACAddress = router-config.router-settings.serverInitrdMac;
};
};
networks."10-dhcp" = {
DHCP = "yes";
name = "e*";
};
};
};*/
# eth0 on some kernels # eth0 on some kernels
# end0 on other kernels # end0 on other kernels
# sometimes even version dependent # sometimes even version dependent
preLVMCommands = lib.mkOrder 499 '' preLVMCommands = lib.mkOrder 499 ''
ip link set end0 address ${router-config.router-settings.serverInitrdMac} || ip link set eth0 address ${router-config.router-settings.serverInitrdMac} || true ip link set end0 address ${router-config.router-settings.serverInitrdMac} || ip link set eth0 address ${router-config.router-settings.serverInitrdMac} || true
''; '';
# postMountCommands = ''
# ip link set end0 address ${router-config.router-settings.serverMac} || ip link set eth0 address ${router-config.router-settings.serverMac} || true
# '';
network.enable = true; network.enable = true;
network.flushBeforeStage2 = true; network.flushBeforeStage2 = true;
network.udhcpc.enable = true; network.udhcpc.enable = true;
@ -78,6 +102,7 @@ in
"/secrets/initrd/ssh_host_rsa_key" "/secrets/initrd/ssh_host_rsa_key"
"/secrets/initrd/ssh_host_ed25519_key" "/secrets/initrd/ssh_host_ed25519_key"
]; ];
# shell = "/bin/cryptsetup-askpass";
}; };
luks.devices.cryptroot = { luks.devices.cryptroot = {
device = parts.enc; device = parts.enc;