refector
This commit is contained in:
parent
42f15beccf
commit
ed42006971
21 changed files with 271 additions and 366 deletions
|
|
@ -9,13 +9,8 @@
|
|||
imports = [
|
||||
./hardware-configuration.nix
|
||||
|
||||
"${inputs.self}/modules/mizukios/base"
|
||||
"${inputs.self}/modules/mizukios/features/system/boot.nix"
|
||||
"${inputs.self}/modules/mizukios/features/fonts.nix"
|
||||
"${inputs.self}/modules/mizukios/features/plasma.nix"
|
||||
"${inputs.self}/modules/mizukios/features/system/sound.nix"
|
||||
"${inputs.self}/modules/mizukios/features/packages.nix"
|
||||
"${inputs.self}/modules/mizukios/features/catppuccin.nix"
|
||||
"${inputs.self}/modules/mizukios/machine.nix"
|
||||
"${inputs.self}/modules/mizukios/desktop.nix"
|
||||
"${inputs.self}/modules/mizukios/features/figma-agent.nix"
|
||||
"${inputs.self}/modules/mizukios/features/system/sbctl.nix"
|
||||
"${inputs.self}/modules/mizukios/features/system/grub-standalone.nix"
|
||||
|
|
@ -24,7 +19,6 @@
|
|||
"${inputs.self}/modules/mizukios/features/system/bluetooth.nix"
|
||||
"${inputs.self}/modules/mizukios/features/system/graphics.nix"
|
||||
"${inputs.self}/modules/mizukios/features/steam.nix"
|
||||
"${inputs.self}/modules/mizukios/features/remote/ssh.nix"
|
||||
"${inputs.self}/modules/mizukios/features/_1password.nix"
|
||||
];
|
||||
|
||||
|
|
@ -32,8 +26,6 @@
|
|||
|
||||
networking = {
|
||||
hostName = "ena";
|
||||
networkmanager.enable = true;
|
||||
firewall.enable = false;
|
||||
};
|
||||
|
||||
services.printing.enable = true;
|
||||
|
|
|
|||
|
|
@ -1,58 +1,22 @@
|
|||
{ inputs, ... }:
|
||||
{
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
imports = [
|
||||
"${inputs.self}/modules/home/fish.nix"
|
||||
"${inputs.self}/modules/home/starship.nix"
|
||||
];
|
||||
|
||||
shellAliases = {
|
||||
# 디렉토리 네비게이션
|
||||
".." = "cd ..";
|
||||
"..." = "cd ../..";
|
||||
|
||||
# ls 별칭
|
||||
ls = "eza --icons=always";
|
||||
ll = "eza --icons=always -l";
|
||||
la = "eza --icons=always -a";
|
||||
lla = "eza --icons=always -la";
|
||||
|
||||
cat = "bat --plain";
|
||||
|
||||
rebuild = "nr";
|
||||
update = "nix flake update";
|
||||
clean = "sudo nix-collect-garbage -d";
|
||||
};
|
||||
|
||||
interactiveShellInit = ''
|
||||
set -g fish_greeting ""
|
||||
set -g fish_color_command blue
|
||||
set -g fish_color_error red
|
||||
set -g fish_color_param cyan
|
||||
'';
|
||||
programs.fish.shellAliases = {
|
||||
cat = "bat --plain";
|
||||
rebuild = "nr";
|
||||
update = "nix flake update";
|
||||
clean = "sudo nix-collect-garbage -d";
|
||||
};
|
||||
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
settings = {
|
||||
format = "🎨 $directory:$character";
|
||||
add_newline = false;
|
||||
# username = {
|
||||
# style_user = "purple";
|
||||
# style_root = "purple";
|
||||
# format = "[$user]($style)";
|
||||
# show_always = true;
|
||||
# };
|
||||
# hostname = {
|
||||
# style = "green";
|
||||
# format = "[$hostname]($style)";
|
||||
# ssh_only = false;
|
||||
# };
|
||||
directory = {
|
||||
style = "fg:#fbb6c4";
|
||||
format = "[$path]($style)";
|
||||
truncation_length = 3;
|
||||
};
|
||||
character = {
|
||||
success_symbol = " 💜";
|
||||
error_symbol = " ⚠️";
|
||||
};
|
||||
programs.starship.settings = {
|
||||
format = "🎨 $directory:$character";
|
||||
character = {
|
||||
success_symbol = " 💜";
|
||||
error_symbol = " ⚠️";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,60 +1,31 @@
|
|||
{ inputs, lib, ... }:
|
||||
{
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
imports = [
|
||||
"${inputs.self}/modules/home/fish.nix"
|
||||
"${inputs.self}/modules/home/starship.nix"
|
||||
];
|
||||
|
||||
shellAliases = {
|
||||
".." = "cd ..";
|
||||
"..." = "cd ../..";
|
||||
|
||||
ls = "eza --icons=always";
|
||||
ll = "eza --icons=always -l";
|
||||
la = "eza --icons=always -a";
|
||||
lla = "eza --icons=always -la";
|
||||
|
||||
# nix-darwin 관련
|
||||
rebuild = "sudo darwin-rebuild switch --flake .#kanade";
|
||||
update = "nix flake update";
|
||||
clean = "nix-collect-garbage -d";
|
||||
};
|
||||
|
||||
interactiveShellInit = ''
|
||||
set -g fish_greeting ""
|
||||
set -g fish_color_command blue
|
||||
set -g fish_color_error red
|
||||
set -g fish_color_param cyan
|
||||
|
||||
set -gx ANDROID_HOME "$HOME/Library/Android/sdk"
|
||||
if test -d "$ANDROID_HOME/ndk"
|
||||
set -l ndk_versions "$ANDROID_HOME"/ndk/*
|
||||
if test (count $ndk_versions) -gt 0
|
||||
set -gx NDK_HOME $ndk_versions[-1]
|
||||
end
|
||||
end
|
||||
|
||||
set -gx SSH_AUTH_SOCK /Users/imnyang/.ssh/proton-pass-agent.sock
|
||||
'';
|
||||
programs.fish.shellAliases = {
|
||||
rebuild = "sudo darwin-rebuild switch --flake .#kanade";
|
||||
update = "nix flake update";
|
||||
clean = "nix-collect-garbage -d";
|
||||
};
|
||||
|
||||
programs.fish.interactiveShellInit = lib.mkAfter ''
|
||||
set -gx ANDROID_HOME "$HOME/Library/Android/sdk"
|
||||
if test -d "$ANDROID_HOME/ndk"
|
||||
set -l ndk_versions "$ANDROID_HOME"/ndk/*
|
||||
if test (count $ndk_versions) -gt 0
|
||||
set -gx NDK_HOME $ndk_versions[-1]
|
||||
end
|
||||
end
|
||||
|
||||
set -gx SSH_AUTH_SOCK /Users/imnyang/.ssh/proton-pass-agent.sock
|
||||
'';
|
||||
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
settings = {
|
||||
format = "🎼 $directory:$character";
|
||||
add_newline = false;
|
||||
# username = {
|
||||
# style_user = "purple";
|
||||
# style_root = "purple";
|
||||
# format = "[$user]($style)";
|
||||
# show_always = true;
|
||||
# };
|
||||
# hostname = {
|
||||
# style = "green";
|
||||
# format = "[$hostname]($style)";
|
||||
# ssh_only = false;
|
||||
# };
|
||||
directory = {
|
||||
style = "fg:#fbb6c4";
|
||||
format = "[$path]($style)";
|
||||
truncation_length = 3;
|
||||
};
|
||||
character = {
|
||||
success_symbol = " 💕";
|
||||
error_symbol = " ⚠️";
|
||||
|
|
|
|||
|
|
@ -3,23 +3,16 @@
|
|||
imports = [
|
||||
./hardware-configuration.nix
|
||||
|
||||
"${inputs.self}/modules/mizukios/base"
|
||||
"${inputs.self}/modules/mizukios/features/system/boot.nix"
|
||||
"${inputs.self}/modules/mizukios/features/fonts.nix"
|
||||
"${inputs.self}/modules/mizukios/features/packages.nix"
|
||||
"${inputs.self}/modules/mizukios/features/plasma.nix"
|
||||
"${inputs.self}/modules/mizukios/features/system/sound.nix"
|
||||
"${inputs.self}/modules/mizukios/features/catppuccin.nix"
|
||||
"${inputs.self}/modules/mizukios/features/remote/ssh.nix"
|
||||
"${inputs.self}/modules/mizukios/machine.nix"
|
||||
"${inputs.self}/modules/mizukios/desktop.nix"
|
||||
"${inputs.self}/modules/mizukios/features/steam.nix"
|
||||
"${inputs.self}/modules/mizukios/features/remote/sunshine.nix"
|
||||
"${inputs.self}/modules/mizukios/features/remote/authorized-keys.nix"
|
||||
"${inputs.self}/modules/mizukios/features/_1password.nix"
|
||||
];
|
||||
|
||||
networking = {
|
||||
hostName = "mafuyu";
|
||||
networkmanager.enable = true;
|
||||
firewall.enable = false;
|
||||
};
|
||||
|
||||
services.caddy = {
|
||||
|
|
@ -83,10 +76,6 @@
|
|||
autoLogin.user = "imnyang";
|
||||
};
|
||||
|
||||
users.users.imnyang.openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOHP3Z+AYrRh9f8TYyqChKfeyNm3lOe0F75AwRHTTaxD imnyang@mizuki"
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
gtk3
|
||||
gtk4
|
||||
|
|
|
|||
|
|
@ -1,54 +1,21 @@
|
|||
{ inputs, ... }:
|
||||
{
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
imports = [
|
||||
"${inputs.self}/modules/home/fish.nix"
|
||||
"${inputs.self}/modules/home/starship.nix"
|
||||
];
|
||||
|
||||
shellAliases = {
|
||||
".." = "cd ..";
|
||||
"..." = "cd ../..";
|
||||
|
||||
ls = "eza --icons=always";
|
||||
ll = "eza --icons=always -l";
|
||||
la = "eza --icons=always -a";
|
||||
lla = "eza --icons=always -la";
|
||||
|
||||
rebuild = "nr";
|
||||
update = "nix flake update";
|
||||
clean = "sudo nix-collect-garbage -d";
|
||||
};
|
||||
|
||||
interactiveShellInit = ''
|
||||
set -g fish_greeting ""
|
||||
set -g fish_color_command blue
|
||||
set -g fish_color_error red
|
||||
set -g fish_color_param cyan
|
||||
'';
|
||||
programs.fish.shellAliases = {
|
||||
rebuild = "nr";
|
||||
update = "nix flake update";
|
||||
clean = "sudo nix-collect-garbage -d";
|
||||
};
|
||||
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
settings = {
|
||||
format = "❄️ $directory:$character";
|
||||
add_newline = false;
|
||||
# username = {
|
||||
# style_user = "purple";
|
||||
# style_root = "purple";
|
||||
# format = "[$user]($style)";
|
||||
# show_always = true;
|
||||
# };
|
||||
# hostname = {
|
||||
# style = "green";
|
||||
# format = "[$hostname]($style)";
|
||||
# ssh_only = false;
|
||||
# };
|
||||
directory = {
|
||||
style = "fg:#fbb6c4";
|
||||
format = "[$path]($style)";
|
||||
truncation_length = 3;
|
||||
};
|
||||
character = {
|
||||
success_symbol = " 💕";
|
||||
error_symbol = " ⚠️";
|
||||
};
|
||||
programs.starship.settings = {
|
||||
format = "❄️ $directory:$character";
|
||||
character = {
|
||||
success_symbol = " 💕";
|
||||
error_symbol = " ⚠️";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,19 +3,13 @@
|
|||
imports = [
|
||||
./hardware-configuration.nix
|
||||
|
||||
"${inputs.self}/modules/mizukios/base"
|
||||
"${inputs.self}/modules/mizukios/features/system/boot.nix"
|
||||
"${inputs.self}/modules/mizukios/machine.nix"
|
||||
"${inputs.self}/modules/mizukios/desktop.nix"
|
||||
"${inputs.self}/modules/mizukios/features/system/sbctl.nix"
|
||||
"${inputs.self}/modules/mizukios/features/fonts.nix"
|
||||
"${inputs.self}/modules/mizukios/features/packages.nix"
|
||||
"${inputs.self}/modules/mizukios/features/plasma.nix"
|
||||
"${inputs.self}/modules/mizukios/features/system/sound.nix"
|
||||
"${inputs.self}/modules/mizukios/features/catppuccin.nix"
|
||||
"${inputs.self}/modules/mizukios/features/figma-agent.nix"
|
||||
"${inputs.self}/modules/mizukios/features/management/cockpit.nix"
|
||||
"${inputs.self}/modules/mizukios/features/system/bluetooth.nix"
|
||||
"${inputs.self}/modules/mizukios/features/system/graphics.nix"
|
||||
"${inputs.self}/modules/mizukios/features/remote/ssh.nix"
|
||||
"${inputs.self}/modules/mizukios/features/system/virtualisation.nix"
|
||||
"${inputs.self}/modules/mizukios/features/steam.nix"
|
||||
"${inputs.self}/modules/mizukios/features/remote/sunshine.nix"
|
||||
|
|
@ -25,8 +19,6 @@
|
|||
|
||||
networking = {
|
||||
hostName = "mizuki";
|
||||
networkmanager.enable = true;
|
||||
firewall.enable = false;
|
||||
interfaces = {
|
||||
enp3s0 = {
|
||||
wakeOnLan.enable = true;
|
||||
|
|
|
|||
|
|
@ -1,54 +1,21 @@
|
|||
{ inputs, ... }:
|
||||
{
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
imports = [
|
||||
"${inputs.self}/modules/home/fish.nix"
|
||||
"${inputs.self}/modules/home/starship.nix"
|
||||
];
|
||||
|
||||
shellAliases = {
|
||||
".." = "cd ..";
|
||||
"..." = "cd ../..";
|
||||
|
||||
ls = "eza --icons=always";
|
||||
ll = "eza --icons=always -l";
|
||||
la = "eza --icons=always -a";
|
||||
lla = "eza --icons=always -la";
|
||||
|
||||
rebuild = "nr";
|
||||
update = "nix flake update";
|
||||
clean = "sudo nix-collect-garbage -d";
|
||||
};
|
||||
|
||||
interactiveShellInit = ''
|
||||
set -g fish_greeting ""
|
||||
set -g fish_color_command blue
|
||||
set -g fish_color_error red
|
||||
set -g fish_color_param cyan
|
||||
'';
|
||||
programs.fish.shellAliases = {
|
||||
rebuild = "nr";
|
||||
update = "nix flake update";
|
||||
clean = "sudo nix-collect-garbage -d";
|
||||
};
|
||||
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
settings = {
|
||||
format = "🎀 $directory:$character";
|
||||
add_newline = false;
|
||||
# username = {
|
||||
# style_user = "purple";
|
||||
# style_root = "purple";
|
||||
# format = "[$user]($style)";
|
||||
# show_always = true;
|
||||
# };
|
||||
# hostname = {
|
||||
# style = "green";
|
||||
# format = "[$hostname]($style)";
|
||||
# ssh_only = false;
|
||||
# };
|
||||
directory = {
|
||||
style = "fg:#fbb6c4";
|
||||
format = "[$path]($style)";
|
||||
truncation_length = 3;
|
||||
};
|
||||
character = {
|
||||
success_symbol = " 💕";
|
||||
error_symbol = " ⚠️";
|
||||
};
|
||||
programs.starship.settings = {
|
||||
format = "🎀 $directory:$character";
|
||||
character = {
|
||||
success_symbol = " 💕";
|
||||
error_symbol = " ⚠️";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
{ pkgs, inputs, ... }:
|
||||
{
|
||||
imports = [
|
||||
"${inputs.self}/modules/mizukios/base"
|
||||
"${inputs.self}/modules/mizukios/features/remote/ssh.nix"
|
||||
"${inputs.self}/modules/mizukios/machine.nix"
|
||||
"${inputs.self}/modules/mizukios/features/remote/authorized-keys.nix"
|
||||
];
|
||||
|
||||
wsl.enable = true;
|
||||
|
|
@ -10,12 +10,7 @@
|
|||
|
||||
networking = {
|
||||
hostName = "ribbon";
|
||||
firewall.enable = false;
|
||||
};
|
||||
|
||||
users.users.imnyang.openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOHP3Z+AYrRh9f8TYyqChKfeyNm3lOe0F75AwRHTTaxD imnyang@mizuki"
|
||||
];
|
||||
|
||||
system.stateVersion = "25.11";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,34 +1,14 @@
|
|||
{ inputs, ... }:
|
||||
{
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
imports = [ "${inputs.self}/modules/home/fish.nix" ];
|
||||
|
||||
shellAliases = {
|
||||
# 디렉토리 네비게이션
|
||||
".." = "cd ..";
|
||||
"..." = "cd ../..";
|
||||
|
||||
# ls 별칭
|
||||
ls = "eza --icons=always";
|
||||
ll = "eza --icons=always -l";
|
||||
la = "eza --icons=always -a";
|
||||
lla = "eza --icons=always -la";
|
||||
|
||||
# NixOS 관련
|
||||
rebuild = "nr";
|
||||
update = "nix flake update";
|
||||
clean = "sudo nix-collect-garbage -d";
|
||||
};
|
||||
|
||||
interactiveShellInit = ''
|
||||
set -g fish_greeting ""
|
||||
set -g fish_color_command blue
|
||||
set -g fish_color_error red
|
||||
set -g fish_color_param cyan
|
||||
'';
|
||||
programs.fish.shellAliases = {
|
||||
rebuild = "nr";
|
||||
update = "nix flake update";
|
||||
clean = "sudo nix-collect-garbage -d";
|
||||
};
|
||||
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
settings = {
|
||||
format = "$username@$hostname:$directory$character";
|
||||
add_newline = false;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{ inputs, ... }:
|
||||
let
|
||||
errorHandlers = ''
|
||||
handle_errors {
|
||||
|
|
@ -119,62 +118,11 @@ let
|
|||
"whs.imnya.ng"
|
||||
];
|
||||
|
||||
cloudflareIpRanges = [
|
||||
"103.21.244.0/22"
|
||||
"103.22.200.0/22"
|
||||
"103.31.4.0/22"
|
||||
"104.16.0.0/13"
|
||||
"104.24.0.0/14"
|
||||
"108.162.192.0/18"
|
||||
"131.0.72.0/22"
|
||||
"141.101.64.0/18"
|
||||
"162.158.0.0/15"
|
||||
"172.64.0.0/13"
|
||||
"173.245.48.0/20"
|
||||
"188.114.96.0/20"
|
||||
"190.93.240.0/20"
|
||||
"197.234.240.0/22"
|
||||
"198.41.128.0/17"
|
||||
"2400:cb00::/32"
|
||||
"2606:4700::/32"
|
||||
"2803:f800::/32"
|
||||
"2405:b500::/32"
|
||||
"2405:8100::/32"
|
||||
"2a06:98c0::/29"
|
||||
"2c0f:f248::/32"
|
||||
];
|
||||
in
|
||||
{
|
||||
imports = [ "${inputs.self}/modules/mizukios/features/caddy/common.nix" ];
|
||||
|
||||
services.caddy = {
|
||||
enable = true;
|
||||
email = "imnyang@pm.me";
|
||||
openFirewall = true;
|
||||
package = pkgs.caddy.withPlugins {
|
||||
plugins = [
|
||||
"github.com/caddy-dns/cloudflare@v0.2.4"
|
||||
"github.com/aksdb/caddy-cgi/v2@v2.2.6"
|
||||
"github.com/shift72/caddy-geo-ip@v0.6.0"
|
||||
"github.com/lolPants/caddy-requestid@v1.1.2"
|
||||
"github.com/WeidiDeng/caddy-cloudflare-ip@v0.0.0-20231130002422-f53b62aa13cb"
|
||||
"github.com/caddyserver/ntlm-transport@v0.1.2"
|
||||
"github.com/ueffel/caddy-brotli@v1.6.0"
|
||||
"github.com/RussellLuo/caddy-ext/ratelimit@v0.3.0"
|
||||
"github.com/neodyme-labs/user_agent_parse@v0.0.1"
|
||||
];
|
||||
hash = "sha256-r4MgRk8HpKYx7f8FmA3PKgD/5ZNTIHpQvlE+zRbP0lw=";
|
||||
};
|
||||
|
||||
globalConfig = ''
|
||||
admin unix//run/caddy/admin.socket
|
||||
storage file_system /var/lib/caddy
|
||||
servers {
|
||||
trusted_proxies static ${builtins.concatStringsSep " " cloudflareIpRanges}
|
||||
client_ip_headers Cf-Connecting-Ip
|
||||
}
|
||||
debug
|
||||
'';
|
||||
|
||||
|
||||
virtualHosts =
|
||||
builtins.listToAttrs (
|
||||
map (host: {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
{ pkgs, ... }:
|
||||
{ inputs, ... }:
|
||||
|
||||
{
|
||||
imports = [ "${inputs.self}/modules/mizukios/features/caddy/common.nix" ];
|
||||
|
||||
services.caddy = {
|
||||
enable = true;
|
||||
# globalConfig = ''
|
||||
# servers {
|
||||
# trusted_proxies static cloudflare
|
||||
|
|
@ -29,20 +30,5 @@
|
|||
virtualHosts."report.dazzle.st".extraConfig = ''
|
||||
respond 204
|
||||
'';
|
||||
|
||||
package = pkgs.caddy.withPlugins {
|
||||
plugins = [
|
||||
"github.com/caddy-dns/cloudflare@v0.2.2"
|
||||
"github.com/aksdb/caddy-cgi/v2@v2.2.6"
|
||||
"github.com/shift72/caddy-geo-ip@v0.6.0"
|
||||
"github.com/lolPants/caddy-requestid@v1.1.2"
|
||||
"github.com/WeidiDeng/caddy-cloudflare-ip@v0.0.0-20231130002422-f53b62aa13cb"
|
||||
"github.com/caddyserver/ntlm-transport@v0.1.2"
|
||||
"github.com/ueffel/caddy-brotli@v1.6.0"
|
||||
"github.com/RussellLuo/caddy-ext/ratelimit@v0.3.0"
|
||||
"github.com/neodyme-labs/user_agent_parse@v0.0.1"
|
||||
];
|
||||
hash = "sha256-z9/LF2gws+H0pKL6F62QfklD0W8DKWCccnXLOOs3+jY=";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
{ pkgs, ... }:
|
||||
{ inputs, ... }:
|
||||
{
|
||||
imports = [ "${inputs.self}/modules/mizukios/features/caddy/common.nix" ];
|
||||
|
||||
services.caddy = {
|
||||
enable = true;
|
||||
virtualHosts."http://natsu.icn.mizuki.guru".extraConfig = ''
|
||||
respond "우응" 200
|
||||
'';
|
||||
|
|
@ -108,19 +109,5 @@
|
|||
reverse_proxy /* 127.0.0.1:8080
|
||||
'';
|
||||
|
||||
package = pkgs.caddy.withPlugins {
|
||||
plugins = [
|
||||
"github.com/caddy-dns/cloudflare@v0.2.2"
|
||||
"github.com/aksdb/caddy-cgi/v2@v2.2.6"
|
||||
"github.com/shift72/caddy-geo-ip@v0.6.0"
|
||||
"github.com/lolPants/caddy-requestid@v1.1.2"
|
||||
"github.com/WeidiDeng/caddy-cloudflare-ip@v0.0.0-20231130002422-f53b62aa13cb"
|
||||
"github.com/caddyserver/ntlm-transport@v0.1.2"
|
||||
"github.com/ueffel/caddy-brotli@v1.6.0"
|
||||
"github.com/RussellLuo/caddy-ext/ratelimit@v0.3.0"
|
||||
"github.com/neodyme-labs/user_agent_parse@v0.0.1"
|
||||
];
|
||||
hash = "sha256-z9/LF2gws+H0pKL6F62QfklD0W8DKWCccnXLOOs3+jY=";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
22
modules/home/fish.nix
Normal file
22
modules/home/fish.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{ ... }:
|
||||
{
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
|
||||
shellAliases = {
|
||||
".." = "cd ..";
|
||||
"..." = "cd ../..";
|
||||
ls = "eza --icons=always";
|
||||
ll = "eza --icons=always -l";
|
||||
la = "eza --icons=always -a";
|
||||
lla = "eza --icons=always -la";
|
||||
};
|
||||
|
||||
interactiveShellInit = ''
|
||||
set -g fish_greeting ""
|
||||
set -g fish_color_command blue
|
||||
set -g fish_color_error red
|
||||
set -g fish_color_param cyan
|
||||
'';
|
||||
};
|
||||
}
|
||||
14
modules/home/starship.nix
Normal file
14
modules/home/starship.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{ ... }:
|
||||
{
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
settings = {
|
||||
add_newline = false;
|
||||
directory = {
|
||||
style = "fg:#fbb6c4";
|
||||
format = "[$path]($style)";
|
||||
truncation_length = 3;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -11,7 +11,16 @@
|
|||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
auto-optimise-store = true;
|
||||
# Optimising on every store write causes heavy random I/O during builds.
|
||||
# Run the optimisation separately during the scheduled maintenance window.
|
||||
auto-optimise-store = false;
|
||||
# Keep system builds responsive on machines with many CPU cores.
|
||||
max-jobs = 4;
|
||||
};
|
||||
|
||||
nix.optimise = {
|
||||
automatic = true;
|
||||
dates = [ "03:45" ];
|
||||
};
|
||||
|
||||
nix.settings.trusted-users = [
|
||||
|
|
|
|||
13
modules/mizukios/desktop.nix
Normal file
13
modules/mizukios/desktop.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{ inputs, ... }:
|
||||
{
|
||||
imports = [
|
||||
"${inputs.self}/modules/mizukios/features/system/boot.nix"
|
||||
"${inputs.self}/modules/mizukios/features/fonts.nix"
|
||||
"${inputs.self}/modules/mizukios/features/packages.nix"
|
||||
"${inputs.self}/modules/mizukios/features/plasma.nix"
|
||||
"${inputs.self}/modules/mizukios/features/system/sound.nix"
|
||||
"${inputs.self}/modules/mizukios/features/catppuccin.nix"
|
||||
];
|
||||
|
||||
networking.networkmanager.enable = true;
|
||||
}
|
||||
58
modules/mizukios/features/caddy/common.nix
Normal file
58
modules/mizukios/features/caddy/common.nix
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
let
|
||||
cloudflareIpRanges = [
|
||||
"103.21.244.0/22"
|
||||
"103.22.200.0/22"
|
||||
"103.31.4.0/22"
|
||||
"104.16.0.0/13"
|
||||
"104.24.0.0/14"
|
||||
"108.162.192.0/18"
|
||||
"131.0.72.0/22"
|
||||
"141.101.64.0/18"
|
||||
"162.158.0.0/15"
|
||||
"172.64.0.0/13"
|
||||
"173.245.48.0/20"
|
||||
"188.114.96.0/20"
|
||||
"190.93.240.0/20"
|
||||
"197.234.240.0/22"
|
||||
"198.41.128.0/17"
|
||||
"2400:cb00::/32"
|
||||
"2606:4700::/32"
|
||||
"2803:f800::/32"
|
||||
"2405:b500::/32"
|
||||
"2405:8100::/32"
|
||||
"2a06:98c0::/29"
|
||||
"2c0f:f248::/32"
|
||||
];
|
||||
in
|
||||
{
|
||||
services.caddy = {
|
||||
enable = true;
|
||||
email = "imnyang@pm.me";
|
||||
openFirewall = true;
|
||||
package = pkgs.caddy.withPlugins {
|
||||
plugins = [
|
||||
"github.com/caddy-dns/cloudflare@v0.2.4"
|
||||
"github.com/aksdb/caddy-cgi/v2@v2.2.6"
|
||||
"github.com/shift72/caddy-geo-ip@v0.6.0"
|
||||
"github.com/lolPants/caddy-requestid@v1.1.2"
|
||||
"github.com/WeidiDeng/caddy-cloudflare-ip@v0.0.0-20231130002422-f53b62aa13cb"
|
||||
"github.com/caddyserver/ntlm-transport@v0.1.2"
|
||||
"github.com/ueffel/caddy-brotli@v1.6.0"
|
||||
"github.com/RussellLuo/caddy-ext/ratelimit@v0.3.0"
|
||||
"github.com/neodyme-labs/user_agent_parse@v0.0.1"
|
||||
];
|
||||
hash = "sha256-r4MgRk8HpKYx7f8FmA3PKgD/5ZNTIHpQvlE+zRbP0lw=";
|
||||
};
|
||||
globalConfig = ''
|
||||
admin unix//run/caddy/admin.socket
|
||||
storage file_system /var/lib/caddy
|
||||
servers {
|
||||
trusted_proxies static ${builtins.concatStringsSep " " cloudflareIpRanges}
|
||||
client_ip_headers Cf-Connecting-Ip
|
||||
}
|
||||
debug
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
@ -11,29 +11,38 @@ pkgs.writeShellApplication {
|
|||
];
|
||||
|
||||
text = ''
|
||||
set -e
|
||||
set -euo pipefail
|
||||
|
||||
TARGET_NAME="''${1:-$(hostname)}"
|
||||
TARGET_NAME="$(hostname -s)"
|
||||
FLAKE_PATH="."
|
||||
UPLOAD_CACHE=true
|
||||
UPLOAD_CACHE=false
|
||||
MAX_JOBS="''${NIX_BUILD_MAX_JOBS:-4}"
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
--upload) UPLOAD_CACHE=true ;;
|
||||
--no-upload) UPLOAD_CACHE=false ;;
|
||||
--help|-h)
|
||||
echo "사용법: nr [호스트명] [--upload|--no-upload]"
|
||||
exit 0
|
||||
;;
|
||||
-*)
|
||||
echo "알 수 없는 옵션입니다: $1" >&2
|
||||
exit 2
|
||||
;;
|
||||
*) TARGET_NAME="$1" ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
EXTRA_BUILD_FLAGS=()
|
||||
BUILD_FLAGS=(--max-jobs "$MAX_JOBS")
|
||||
if [ "$TARGET_NAME" = "kazusa" ]; then
|
||||
EXTRA_BUILD_FLAGS+=("--max-substituter-jobs" "2")
|
||||
BUILD_FLAGS+=("--max-substitution-jobs" "2")
|
||||
fi
|
||||
|
||||
echo "시스템 빌드 중... $TARGET_NAME"
|
||||
# shellcheck disable=SC2086
|
||||
BUILD_PATH=$(nom build "$FLAKE_PATH#nixosConfigurations.$TARGET_NAME.config.system.build.toplevel" \
|
||||
"''${EXTRA_BUILD_FLAGS[@]}" \
|
||||
"''${BUILD_FLAGS[@]}" \
|
||||
--print-out-paths --no-link)
|
||||
|
||||
echo "스위치 중..."
|
||||
|
|
|
|||
|
|
@ -6,16 +6,40 @@ pkgs.writeShellApplication {
|
|||
nix-output-monitor
|
||||
openssh
|
||||
coreutils
|
||||
nix
|
||||
attic-client
|
||||
];
|
||||
|
||||
text = ''
|
||||
set -e
|
||||
set -euo pipefail
|
||||
|
||||
TARGET_NAME=""
|
||||
if [ $# -gt 0 ]; then
|
||||
TARGET_NAME="$1"
|
||||
fi
|
||||
FLAKE_PATH="."
|
||||
UPLOAD_CACHE=false
|
||||
MAX_JOBS="''${NIX_BUILD_MAX_JOBS:-4}"
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
--upload) UPLOAD_CACHE=true ;;
|
||||
--no-upload) UPLOAD_CACHE=false ;;
|
||||
--help|-h)
|
||||
echo "사용법: nrr <호스트명> [--upload|--no-upload]"
|
||||
exit 0
|
||||
;;
|
||||
-*)
|
||||
echo "알 수 없는 옵션입니다: $1" >&2
|
||||
exit 2
|
||||
;;
|
||||
*)
|
||||
if [ -n "$TARGET_NAME" ]; then
|
||||
echo "호스트명은 하나만 지정할 수 있습니다." >&2
|
||||
exit 2
|
||||
fi
|
||||
TARGET_NAME="$1"
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
declare -A HOST_MAP
|
||||
HOST_MAP["hikari"]="10.11.8.100"
|
||||
|
|
@ -43,17 +67,20 @@ pkgs.writeShellApplication {
|
|||
fi
|
||||
|
||||
echo "시스템 빌드 중..."
|
||||
BUILD_PATH=$(nom build "$FLAKE_PATH#nixosConfigurations.$TARGET_NAME.config.system.build.toplevel" --print-out-paths --no-link --eval-cache --accept-flake-config)
|
||||
BUILD_PATH=$(nom build "$FLAKE_PATH#nixosConfigurations.$TARGET_NAME.config.system.build.toplevel" \
|
||||
--max-jobs "$MAX_JOBS" --print-out-paths --no-link)
|
||||
|
||||
echo "시스템 복사 중... ($BUILD_PATH -> $TARGET_IP)"
|
||||
nix copy --to "ssh://imnyang@$TARGET_IP" "$BUILD_PATH"
|
||||
nix copy --substitute-on-destination --to "ssh://imnyang@$TARGET_IP" "$BUILD_PATH"
|
||||
|
||||
echo "스위치 중..."
|
||||
# shellcheck disable=SC2029
|
||||
ssh "imnyang@$TARGET_IP" "sudo nix-env --profile /nix/var/nix/profiles/system --set \"$BUILD_PATH\" && sudo $BUILD_PATH/bin/switch-to-configuration switch"
|
||||
|
||||
echo "캐시 업로드 중..."
|
||||
attic push imnyang "$BUILD_PATH" || echo "푸시 실패"
|
||||
if [ "$UPLOAD_CACHE" = true ]; then
|
||||
echo "캐시 업로드 중..."
|
||||
attic push imnyang "$BUILD_PATH" || echo "푸시 실패"
|
||||
fi
|
||||
|
||||
echo "배포 완료!"
|
||||
'';
|
||||
|
|
|
|||
6
modules/mizukios/features/remote/authorized-keys.nix
Normal file
6
modules/mizukios/features/remote/authorized-keys.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ ... }:
|
||||
{
|
||||
users.users.imnyang.openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOHP3Z+AYrRh9f8TYyqChKfeyNm3lOe0F75AwRHTTaxD imnyang@mizuki"
|
||||
];
|
||||
}
|
||||
9
modules/mizukios/machine.nix
Normal file
9
modules/mizukios/machine.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{ inputs, ... }:
|
||||
{
|
||||
imports = [
|
||||
./base
|
||||
"${inputs.self}/modules/mizukios/features/remote/ssh.nix"
|
||||
];
|
||||
|
||||
networking.firewall.enable = false;
|
||||
}
|
||||
Loading…
Reference in a new issue