Compare commits

..

No commits in common. "c19f0ef0e12b74c624e9ae8547ef32b0c9e278f2" and "faf34f2718fa51ad22d3c3962734cb37bc49979c" have entirely different histories.

17 changed files with 164 additions and 119 deletions

View file

@ -27,11 +27,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1723426710, "lastModified": 1723080788,
"narHash": "sha256-yrS9al6l3fYfFfvovnyBWnyELDQOdfKyai4K/jKgoBw=", "narHash": "sha256-C5LbM5VMdcolt9zHeLQ0bYMRjUL+N+AL5pK7/tVTdes=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "0d510fe40b56ed74907a021d7e1ffd0042592914", "rev": "ffc1f95f6c28e1c6d1e587b51a2147027a3e45ed",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -122,11 +122,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1723399884, "lastModified": 1723015306,
"narHash": "sha256-97wn0ihhGqfMb8WcUgzzkM/TuAxce2Gd20A8oiruju4=", "narHash": "sha256-jQnFEtH20/OsDPpx71ntZzGdRlpXhUENSQCGTjn//NA=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "086f619dd991a4d355c07837448244029fc2d9ab", "rev": "b3d5ea65d88d67d4ec578ed11d4d2d51e3de525e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -251,16 +251,16 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1723603349, "lastModified": 1723316219,
"narHash": "sha256-VMg6N7MryOuvSJ8Sj6YydarnUCkL7cvMdrMcnsJnJCE=", "narHash": "sha256-2B9qh8QBvw3kV/8cHc7ZJcrbVsRwP8wKjkwPXTSz76Y=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "daf7bb95821b789db24fc1ac21f613db0c1bf2cb", "rev": "bef98989a27429e1cb9e3d9c25701ba2da742af2",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "nixpkgs-unstable", "ref": "nixos-unstable-small",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
@ -323,11 +323,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1723602049, "lastModified": 1723343015,
"narHash": "sha256-Z/noCSn9WPkv7O77dWKLcBxe4Ub4bWyNzsL5JhjaQfw=", "narHash": "sha256-oS8Qhpo71B/6OOsuVBFJbems7RKD/5e3TN2AdXhwMjg=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "ea0bf33a11a26a62c60123c49d96011da396602c", "rev": "ed4fe9af3814694d59c572649e881a6aa6eba533",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -346,11 +346,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1723501126, "lastModified": 1722897572,
"narHash": "sha256-N9IcHgj/p1+2Pvk8P4Zc1bfrMwld5PcosVA0nL6IGdE=", "narHash": "sha256-3m/iyyjCdRBF8xyehf59QlckIcmShyTesymSb+N4Ap4=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "be0eec2d27563590194a9206f551a6f73d52fa34", "rev": "8ae477955dfd9cbf5fa4eb82a8db8ddbb94e79d9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -381,11 +381,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1723454642, "lastModified": 1723303070,
"narHash": "sha256-S0Gvsenh0II7EAaoc9158ZB4vYyuycvMGKGxIbERNAM=", "narHash": "sha256-krGNVA30yptyRonohQ+i9cnK+CfCpedg6z3qzqVJcTs=",
"owner": "numtide", "owner": "numtide",
"repo": "treefmt-nix", "repo": "treefmt-nix",
"rev": "349de7bc435bdff37785c2466f054ed1766173be", "rev": "14c092e0326de759e16b37535161b3cb9770cea3",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -7,7 +7,7 @@
# `nixpkgs-unstable` contains less(?) jobs, and usually updates faster. # `nixpkgs-unstable` contains less(?) jobs, and usually updates faster.
# #
# REFERENCE: https://discourse.nixos.org/t/differences-between-nix-channels/13998/5 # REFERENCE: https://discourse.nixos.org/t/differences-between-nix-channels/13998/5
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
disko = { disko = {
url = "github:nix-community/disko"; url = "github:nix-community/disko";

View file

@ -1,22 +1,25 @@
{pkgs, ...}: { {pkgs, ...}: {
home.packages = with pkgs; [ home.packages = with pkgs; [
# lsp
alejandra alejandra
colmena
comma
deadnix deadnix
nh
nil nil
nix-diff statix
nix-index
# nixpkgs PRs
nix-init nix-init
nix-output-monitor
nix-tree
nix-update nix-update
nixfmt-rfc-style nixfmt-rfc-style
nixpkgs-review nixpkgs-review
nurl
# misc
colmena
comma
nh
nix-index
nix-output-monitor
nix-tree
sops sops
statix
]; ];
# nh # nh

View file

@ -35,8 +35,12 @@
checkConfig = false; # wtf? checkConfig = false; # wtf?
wrapperFeatures.gtk = true; wrapperFeatures.gtk = true;
systemd.xdgAutostart = true; systemd.xdgAutostart = true;
xwayland = false;
config = { config = {
### Startup
startup = [
{command = "systemctl --user import-environment PATH";}
];
### Visuals ### Visuals
output."*".bg = "${inputs.self.legacyPackages.${pkgs.stdenv.hostPlatform.system}.background} fill"; output."*".bg = "${inputs.self.legacyPackages.${pkgs.stdenv.hostPlatform.system}.background} fill";
bars = [ bars = [

View file

@ -9,7 +9,7 @@
daemonize = true; daemonize = true;
show-failed-attempts = true; show-failed-attempts = true;
show-keyboard-layout = true; show-keyboard-layout = true;
image = toString inputs.self.legacyPackages.${pkgs.stdenv.hostPlatform.system}.background; image = toString inputs.self.legacyPackages.${pkgs.stdenv.hostPlatform.system}.background.dark;
scaling = "fill"; scaling = "fill";
}; };
}; };

View file

@ -71,6 +71,13 @@
runHook postInstall runHook postInstall
''; '';
}) })
(source-sans.overrideAttrs {
installPhase = ''
runHook preInstall
install -Dm444 VF/*.otf -t $out/share/fonts/variable
runHook postInstall
'';
})
(source-serif.overrideAttrs { (source-serif.overrideAttrs {
installPhase = '' installPhase = ''
runHook preInstall runHook preInstall
@ -80,44 +87,29 @@
}) })
source-han-sans-vf-otf source-han-sans-vf-otf
source-han-serif-vf-otf source-han-serif-vf-otf
noto-fonts
noto-fonts-color-emoji noto-fonts-color-emoji
]; ];
fontconfig = { fontconfig.defaultFonts = {
defaultFonts = { emoji = [
emoji = [ "Noto Color Emoji"
"Noto Color Emoji" ];
]; # Append emoji font for Qt apps, they might use the monochrome emoji
# Append emoji font for Qt apps, they might use the monochrome emoji monospace = [
monospace = [ "JetBrains Mono"
"JetBrains Mono" "Source Han Sans SC VF"
"Source Han Sans SC VF" "Symbols Nerd Font"
"Symbols Nerd Font" "Noto Color Emoji"
"Noto Color Emoji" ];
]; sansSerif = [
sansSerif = [ "Inter Variable"
"Inter Variable" "Source Han Sans SC VF"
"Source Han Sans SC VF" "Noto Color Emoji"
"Noto Color Emoji" ];
]; serif = [
serif = [ "Source Serif 4 Variable"
"Source Serif 4 Variable" "Source Han Serif SC VF"
"Source Han Serif SC VF" "Noto Color Emoji"
"Noto Color Emoji" ];
];
};
# GitHub perfers Noto Sans...
localConf = ''
<selectfont>
<rejectfont>
<pattern>
<patelt name="family">
<string>Noto Sans</string>
</patelt>
</pattern>
</rejectfont>
</selectfont>
'';
}; };
}; };
@ -129,7 +121,10 @@
services.greetd = { services.greetd = {
enable = true; enable = true;
settings.default_session.command = "${lib.getExe pkgs.greetd.tuigreet} --cmd ${pkgs.writeShellScript "sway" '' settings.default_session.command = "${lib.getExe pkgs.greetd.tuigreet} --cmd ${pkgs.writeShellScript "sway" ''
dbus-update-activation-environment --all --systemd while read -r l; do
eval export $l
done < <(/run/current-system/systemd/lib/systemd/user-environment-generators/30-systemd-environment-d-generator)
exec systemd-cat --identifier=sway sway exec systemd-cat --identifier=sway sway
''}"; ''}";
}; };

View file

@ -1,4 +1,8 @@
{pkgs, ...}: { {
pkgs,
inputs,
...
}: {
imports = imports =
[ [
./theme.nix ./theme.nix
@ -34,6 +38,7 @@
loupe loupe
mousai mousai
seahorse seahorse
inputs.self.legacyPackages.${pkgs.stdenv.hostPlatform.system}.scripts.lofi
]; ];
programs.obs-studio.enable = true; programs.obs-studio.enable = true;

View file

@ -85,30 +85,26 @@ id.ny4.dev {
element.ny4.dev { element.ny4.dev {
import default import default
root * @element@ root * @element@
header X-Frame-Options SAMEORIGIN;
header X-Content-Type-Options nosniff;
header X-XSS-Protection "1; mode=block";
header Content-Security-Policy "frame-ancestors 'self'";
file_server file_server
} }
cinny.ny4.dev { cinny.ny4.dev {
import default import default
@index { @index {
not path /index.html not path /index.html
not path /public/* not path /public/*
not path /assets/* not path /assets/*
not path /config.json not path /config.json
not path /manifest.json not path /manifest.json
not path /pdf.worker.min.js not path /pdf.worker.min.js
not path /olm.wasm not path /olm.wasm
path /* path /*
} }
root * @cinny@ root * @cinny@
rewrite /*/olm.wasm /olm.wasm rewrite /*/olm.wasm /olm.wasm
rewrite @index /index.html rewrite @index /index.html
file_server file_server
} }
@ -126,8 +122,3 @@ reddit.ny4.dev {
import default import default
reverse_proxy localhost:9400 reverse_proxy localhost:9400
} }
vault.ny4.dev {
import default
reverse_proxy localhost:9500
}

View file

@ -17,7 +17,6 @@
./services/ntfy.nix ./services/ntfy.nix
./services/pixivfe.nix ./services/pixivfe.nix
./services/searx.nix ./services/searx.nix
./services/vaultwarden.nix
]; ];
time.timeZone = "Asia/Tokyo"; time.timeZone = "Asia/Tokyo";
@ -48,9 +47,6 @@
"miniflux/environment" = { "miniflux/environment" = {
restartUnits = ["miniflux.service"]; restartUnits = ["miniflux.service"];
}; };
"vaultwarden/environment" = {
restartUnits = ["vaultwarden.service"];
};
}; };
### Services ### Services

View file

@ -6,8 +6,6 @@ pixivfe:
environment: ENC[AES256_GCM,data:/Q/rShBXlXkWOOP+7OhKtKTSrp2zNizMaAOyKfWbKgJMHTjNfmMtRuGKRez9KXM5MDIMIF9iJSQ=,iv:whIAkaWiZcZT4HfmJw4qA+fbQ9zHFp+kTuHxQDE3XoU=,tag:FroLTMtNwGlvZw3osftj3A==,type:str] environment: ENC[AES256_GCM,data:/Q/rShBXlXkWOOP+7OhKtKTSrp2zNizMaAOyKfWbKgJMHTjNfmMtRuGKRez9KXM5MDIMIF9iJSQ=,iv:whIAkaWiZcZT4HfmJw4qA+fbQ9zHFp+kTuHxQDE3XoU=,tag:FroLTMtNwGlvZw3osftj3A==,type:str]
miniflux: miniflux:
environment: ENC[AES256_GCM,data:eT1rVeXbDANk/+9xmxmTHvMNofyplNGvVFgTj4lFQlJSHTi+br1qfg0tddf5aCtE8cNGt0fNm63qguI2Df/+KWENhb0vCpjRG7zryfBhEwMP5jkVgDnaHYolS1z3OmhlEpE=,iv:tWAUCtlk8wDGWGmn7j00QOVwjPYDkTPDGpyxd1pP6ig=,tag:gLNdzK9GZ/m5mWL5YNrzyQ==,type:str] environment: ENC[AES256_GCM,data:eT1rVeXbDANk/+9xmxmTHvMNofyplNGvVFgTj4lFQlJSHTi+br1qfg0tddf5aCtE8cNGt0fNm63qguI2Df/+KWENhb0vCpjRG7zryfBhEwMP5jkVgDnaHYolS1z3OmhlEpE=,iv:tWAUCtlk8wDGWGmn7j00QOVwjPYDkTPDGpyxd1pP6ig=,tag:gLNdzK9GZ/m5mWL5YNrzyQ==,type:str]
vaultwarden:
environment: ENC[AES256_GCM,data:+pcUVL7yVXKVp57/feHHWmSuH/2B0hLtADxZWCQOOMG+M3UQh+4dHA5debiv,iv:Zy6xn4Z4VwVXfWWjVeCYY/gRnDp//7yUPLbtLuABFPY=,tag:LxEc31YhgyjEhDrqoJxCJw==,type:str]
sops: sops:
kms: [] kms: []
gcp_kms: [] gcp_kms: []
@ -32,8 +30,8 @@ sops:
R1ZMMG1jWnljNWl5Nk5MU3RCMlFPYjgKL1ScxzF0D1R18H+oe6dlxUGlL9myHEr3 R1ZMMG1jWnljNWl5Nk5MU3RCMlFPYjgKL1ScxzF0D1R18H+oe6dlxUGlL9myHEr3
3HBPoapKCSQ/cT7Xma4bsWD1AVJIf1Ak+MeCs9ItGwKAcnd9JYZ9KA== 3HBPoapKCSQ/cT7Xma4bsWD1AVJIf1Ak+MeCs9ItGwKAcnd9JYZ9KA==
-----END AGE ENCRYPTED FILE----- -----END AGE ENCRYPTED FILE-----
lastmodified: "2024-08-12T12:55:54Z" lastmodified: "2024-07-18T09:46:47Z"
mac: ENC[AES256_GCM,data:H1zm+Rk9F9SkRbANU4GYjhZpys3e5qQNBBsdIbgXD3AZTAKZVyemT6Vb8k0ufkfzQ98L0Xrm/S1JQFvcyaZqRHv+C2GW3F34FlSS4IOtaJz9IgVIdvaM4WvaOTtpC5B+5CKnA/oBPOmhEBCdi2LIjzrUltEzKpemWHkIIT2eHQA=,iv:1RCjLEz0W+tHQep4EguweYKSfePXa1VE3+gzlcFsAug=,tag:Oonqihfe83l5SNOmLjOPYg==,type:str] mac: ENC[AES256_GCM,data:EJsQO/XsF8SpyEP8s9u1DXQkSsqodknF9ibl94/kOOIutx9ML+L0ltYA3+/eW17K9Mwvy6CyojKiQLiYgL2RLJd1zxZKedmp+l3klu1im8Wocwh073nemHIR1J6H5hoE6y36tDCXRrMDbWIfMjvlp6FlhFsI/n3Na1iCDall6mA=,iv:O9Y0j5G3sE67Bfz0MhcPYYpU71cGgtIdde8a1WQiigs=,tag:eNIvBVu7LPnC5s2f3MzptQ==,type:str]
pgp: [] pgp: []
unencrypted_suffix: _unencrypted unencrypted_suffix: _unencrypted
version: 3.9.0 version: 3.9.0

View file

@ -1,17 +0,0 @@
{config, ...}: {
services.vaultwarden = {
enable = true;
environmentFile = config.sops.secrets."vaultwarden/environment".path;
config = {
DOMAIN = "https://vault.ny4.dev";
IP_HEADER = "X-Forwarded-For";
ROCKET_ADDRESS = "127.0.0.1";
ROCKET_PORT = 9500;
EMERGENCY_ACCESS_ALLOWED = false;
SENDS_ALLOWED = false;
SIGNUPS_ALLOWED = false;
ORG_CREATION_USERS = "none";
};
};
}

View file

@ -36,6 +36,7 @@
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
unzip unzip
wget
tree tree
file file
htop htop

View file

@ -10,7 +10,7 @@
webui = pkgs.metacubexd; webui = pkgs.metacubexd;
}; };
systemd.services.mihomo.preStart = '' systemd.services.mihomo.serviceConfig.preStart = ''
${pkgs.coreutils}/bin/ln -sf ${pkgs.v2ray-geoip}/share/v2ray/geoip.dat /var/lib/private/mihomo/GeoIP.dat ${pkgs.coreutils}/bin/ln -sf ${pkgs.v2ray-geoip}/share/v2ray/geoip.dat /var/lib/private/mihomo/GeoIP.dat
${pkgs.coreutils}/bin/ln -sf ${pkgs.v2ray-domain-list-community}/share/v2ray/geosite.dat /var/lib/private/mihomo/GeoSite.dat ${pkgs.coreutils}/bin/ln -sf ${pkgs.v2ray-domain-list-community}/share/v2ray/geosite.dat /var/lib/private/mihomo/GeoSite.dat
''; '';

24
pkgs/background.nix Normal file
View file

@ -0,0 +1,24 @@
{
fetchurl,
imagemagick,
runCommandLocal,
}:
runCommandLocal "49983419_p0.jpg" {
nativeBuildInputs = [imagemagick];
# https://www.pixiv.net/en/artworks/49983419
image = fetchurl {
url = "https://i.pximg.net/img-original/img/2015/04/23/12/43/35/49983419_p0.jpg";
hash = "sha256-JZ5VmsjVjZfHXpx3JxzAyYzZppZmgH38AiAA+B0TDiw=";
curlOptsList = ["-e" "https://www.pixiv.net/"];
};
outputs = ["out" "dark"];
} ''
magick $image -crop 3500x1600+0+100 $out
magick $image \
-crop 3500x1600+0+100 \
-blur 8x8 \
-brightness-contrast -10,0 \
$dark
''

View file

@ -1,10 +1,20 @@
# NOTE: 301: All packages are migrated to `github:Guanran928/nur-packages`, # NOTE: 301: All packages are migrated to `github:Guanran928/nur-packages`,
# only keeping some packages that only fits for personal use. # only keeping some packages that only fits for personal use.
pkgs: let pkgs: let
inherit (pkgs) callPackage; inherit (pkgs) lib callPackage;
in { in {
# https://github.com/NixOS/nixpkgs/pull/308720 # https://github.com/NixOS/nixpkgs/pull/308720
pixivfe = callPackage ./pixivfe.nix {}; pixivfe = callPackage ./pixivfe.nix {};
background = pkgs.nixos-artwork.wallpapers.nineish-dark-gray.src; background = callPackage ./background.nix {};
scripts = lib.makeScope pkgs.newScope (self: let
inherit (self) callPackage;
in {
# util
makeScript = callPackage ./scripts/makeScript.nix {};
# scripts
lofi = callPackage ./scripts/lofi.nix {};
});
} }

14
pkgs/scripts/lofi.nix Normal file
View file

@ -0,0 +1,14 @@
{
makeScript,
coreutils,
mpv,
fetchurl,
}:
makeScript {
name = "lofi";
runtimeInputs = [coreutils mpv];
src = fetchurl {
url = "https://raw.githubusercontent.com/lime-desu/bin/69422c37582c5914863997c75c268791a0de136e/lofi";
hash = "sha256-hT+S/rqOHUYnnFcSDFfQht4l1DGasz1L3wDHKUWLraA=";
};
}

View file

@ -0,0 +1,21 @@
{
lib,
runtimeShell,
runCommandLocal,
makeBinaryWrapper,
}: {
name,
src,
runtimeInputs ? [],
}:
# FIXME: incorrect argv0
runCommandLocal name {
inherit src;
nativeBuildInputs = [makeBinaryWrapper];
meta.mainProgram = name;
} ''
install -Dm755 $src $out/bin/.$name
makeBinaryWrapper ${runtimeShell} $out/bin/$name \
--add-flags $out/bin/.$name \
--prefix PATH : ${lib.makeBinPath runtimeInputs}
''