This commit is contained in:
암냥 2026-07-25 07:16:27 +09:00
commit fb7b785ae7
No known key found for this signature in database
5 changed files with 149 additions and 239 deletions

View file

@ -21,7 +21,6 @@
"${inputs.self}/modules/home/devtool/neovim.nix"
"${inputs.self}/modules/home/devtool/ghostty.nix"
"${inputs.self}/modules/home/devtool/zed.nix"
"${inputs.self}/modules/home/firefox-devedition.nix"
./config/git.nix
./config/shell.nix
];

View file

@ -11,9 +11,6 @@
"signal"
"zoom"
# Browsers
"firefox@developer-edition"
# Productivity and design
"camo-studio"
"proton-drive"

View file

@ -12,6 +12,7 @@ nixpkgs.lib.nixosSystem {
# ./services/attic.nix
./services/caddy.nix
./services/forgejo-runner.nix
./services/limbo.nix
./services/stream.nix
# ./services/harmonia.nix
./configuration.nix

View file

@ -0,0 +1,24 @@
{ pkgs, ... }:
{
systemd.services.limbo = {
description = "Minecraft Limbo Server";
after = [ "network-online.target" ];
wants = [ "network-online.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "simple";
User = "imnyang";
Group = "users";
WorkingDirectory = "/home/imnyang/minecraft/limbo";
ExecStart = "/home/imnyang/minecraft/limbo/pico_limbo --config /home/imnyang/minecraft/limbo/server.toml";
Restart = "always";
RestartSec = 5;
};
};
networking.firewall.allowedTCPPorts = [
25565
];
}

View file

@ -1,15 +1,30 @@
{ pkgs, lib, ... }:
{ pkgs, ... }:
let
inherit (pkgs.stdenv.hostPlatform) isDarwin isLinux;
extensionUrl = "https://git.mizuki.guru/imnyang/thisiswindowsfigma/releases/download/v1.0.0/d168a70cb6a24fe4a478-1.0.0.xpi";
extensionId = "figma-windows-ua-spoofer@imnyang.local";
in
{
programs.firefox = {
enable = true;
package = pkgs.firefox-devedition;
profileName = "imnyang";
darwinProfilePath = "Profiles/${profileName}";
policies = {
DisableAppUpdate = true;
ExtensionSettings = {
${extensionId} = {
installation_mode = "force_installed";
install_url = extensionUrl;
};
};
};
firefoxSettings = {
profiles.imnyang = {
id = 0;
name = "imnyang";
isDefault = true;
settings = {
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
"browser.uidensity" = 0;
"browser.theme.dark-private-windows" = false;
@ -119,35 +134,6 @@ let
}
}
'';
userJs = lib.concatStringsSep "\n" (
lib.mapAttrsToList (name: value: ''user_pref(${builtins.toJSON name}, ${builtins.toJSON value});'') firefoxSettings
) + "\n";
in
lib.mkMerge [
(lib.mkIf isLinux {
programs.firefox = {
enable = true;
package = pkgs.firefox-devedition;
policies = {
DisableAppUpdate = true;
ExtensionSettings = {
${extensionId} = {
installation_mode = "force_installed";
install_url = extensionUrl;
};
};
};
profiles.${profileName} = {
id = 0;
name = profileName;
path = "${profileName}.default";
isDefault = true;
settings = firefoxSettings;
inherit userChrome userContent;
};
};
@ -158,101 +144,4 @@ lib.mkMerge [
"x-scheme-handler/about" = [ "firefox-devedition.desktop" ];
"x-scheme-handler/unknown" = [ "firefox-devedition.desktop" ];
};
})
(lib.mkIf isDarwin {
home.activation.configureFirefoxDeveloperEdition = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
firefox_dir="$HOME/Library/Application Support/Firefox"
profiles_ini="$firefox_dir/profiles.ini"
mkdir -p "$firefox_dir/Profiles"
profile_info=""
if [ -f "$profiles_ini" ]; then
profile_info=$(
awk '
function flush() {
if (in_profile && path != "") {
if (is_default == "1") {
print is_relative "|" path
found = 1
exit
}
if (first == "") {
first = is_relative "|" path
}
}
}
BEGIN { in_profile = 0; is_relative = "1" }
/^\\[Profile[0-9]+\\]$/ { flush(); in_profile = 1; path = ""; is_default = "0"; is_relative = "1"; next }
/^\\[/ { flush(); in_profile = 0; next }
in_profile && /^Path=/ { path = substr($0, 6); next }
in_profile && /^Default=1$/ { is_default = "1"; next }
in_profile && /^IsRelative=/ { is_relative = substr($0, 12); next }
END {
if (!found) {
flush()
}
if (!found && first != "") {
print first
}
}
' "$profiles_ini"
)
fi
if [ -n "$profile_info" ]; then
is_relative="''${profile_info%%|*}"
profile_path="''${profile_info#*|}"
if [ "$is_relative" = "1" ]; then
profile_dir="$firefox_dir/$profile_path"
else
profile_dir="$profile_path"
fi
else
profile_dir="$firefox_dir/${darwinProfilePath}"
cat > "$profiles_ini" <<'EOF'
[Profile0]
Name=${profileName}
IsRelative=1
Path=${darwinProfilePath}
Default=1
[General]
StartWithLastProfile=1
Version=2
EOF
fi
mkdir -p "$profile_dir/chrome"
cp ${pkgs.writeText "firefox-devedition-user.js" userJs} "$profile_dir/user.js"
cp ${pkgs.writeText "firefox-devedition-userChrome.css" userChrome} "$profile_dir/chrome/userChrome.css"
cp ${pkgs.writeText "firefox-devedition-userContent.css" userContent} "$profile_dir/chrome/userContent.css"
'';
home.file = {
"Library/Preferences/org.mozilla.firefoxdeveloperedition.plist".text = ''
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>EnterprisePoliciesEnabled</key>
<true/>
<key>DisableAppUpdate</key>
<true/>
<key>ExtensionSettings</key>
<dict>
<key>${extensionId}</key>
<dict>
<key>installation_mode</key>
<string>force_installed</string>
<key>install_url</key>
<string>${extensionUrl}</string>
</dict>
</dict>
</dict>
</plist>
'';
};
})
]
}