Compare commits
6 commits
ec117d1dac
...
30512e5772
Author | SHA1 | Date | |
---|---|---|---|
30512e5772 | |||
ae8f0f2433 | |||
cebe5df3d0 | |||
2ea64a046c | |||
611d8cd4c5 | |||
fdec3cf0a8 |
18 changed files with 88 additions and 112 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,2 +1,4 @@
|
|||
result
|
||||
result-*
|
||||
|
||||
.DS_Store
|
||||
|
|
|
@ -127,7 +127,7 @@ in {
|
|||
|
||||
# naive but works(tm)
|
||||
# "http://127.0.0.1:1234/" -> "127.0.0.1 1234"
|
||||
proxy = builtins.replaceStrings ["http://" ":" "/"] ["" " " ""] cfg.proxy.httpProxy;
|
||||
proxy = lib.replaceStrings ["http://" ":" "/"] ["" " " ""] cfg.proxy.httpProxy;
|
||||
in
|
||||
lib.concatMapStrings (x: ''
|
||||
${networksetup} -setwebproxystate "${x}" on
|
||||
|
|
|
@ -36,7 +36,7 @@ in {
|
|||
### launchd service
|
||||
# TODO: not run as root user
|
||||
launchd.daemons."mihomo" = {
|
||||
command = builtins.concatStringsSep " " [
|
||||
command = lib.concatStringsSep " " [
|
||||
(lib.getExe cfg.package)
|
||||
"-d /etc/mihomo"
|
||||
(lib.optionalString (cfg.webui != null) "-ext-ui ${cfg.webui}")
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{lib, ...}: {
|
||||
# Allow unfree applications
|
||||
nixpkgs.config.allowUnfreePredicate = pkg:
|
||||
builtins.elem (lib.getName pkg) [
|
||||
lib.elem (lib.getName pkg) [
|
||||
"keka"
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,15 +1,10 @@
|
|||
{
|
||||
programs.eza = {
|
||||
enable = true;
|
||||
git = true;
|
||||
icons = true;
|
||||
extraOptions = ["--header"];
|
||||
# Fish have builtin aliases for `ls`, alias `ls` to `eza` is the only thing we want to do
|
||||
#enableAliases = true;
|
||||
};
|
||||
|
||||
home.shellAliases = {
|
||||
"ls" = "eza";
|
||||
"tree" = "ls --tree";
|
||||
"tree" = "eza --tree";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,20 +1,9 @@
|
|||
{
|
||||
programs.i3status-rust = {
|
||||
enable = true;
|
||||
bars = {
|
||||
default = {
|
||||
bars.default = {
|
||||
icons = "material-nf";
|
||||
blocks = [
|
||||
### Monitor
|
||||
{
|
||||
block = "disk_space";
|
||||
path = "/nix";
|
||||
}
|
||||
{block = "memory";}
|
||||
{block = "cpu";}
|
||||
{block = "load";}
|
||||
|
||||
### Stuff that I actually need
|
||||
{block = "backlight";}
|
||||
{block = "sound";}
|
||||
{block = "battery";}
|
||||
|
@ -22,5 +11,4 @@
|
|||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,20 +1,10 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
inputs,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
# https://www.pixiv.net/en/artworks/49983419
|
||||
image = pkgs.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/"];
|
||||
};
|
||||
# Crop 100px on top and bottom
|
||||
background = pkgs.runCommandLocal "49983419_p0.jpg" {} ''
|
||||
${lib.getExe pkgs.imagemagick} convert ${image} -crop 3500x1600+0+100 $out
|
||||
'';
|
||||
in {
|
||||
}: {
|
||||
imports = [
|
||||
../i3status-rust
|
||||
../kanshi
|
||||
|
@ -56,7 +46,7 @@ in {
|
|||
];
|
||||
|
||||
### Visuals
|
||||
output."*".bg = "${background} fill";
|
||||
output."*".bg = "${inputs.self.legacyPackages.${pkgs.stdenv.hostPlatform.system}.background} fill";
|
||||
bars = [
|
||||
{
|
||||
statusCommand = "${lib.getExe pkgs.i3status-rust} $HOME/.config/i3status-rust/config-default.toml";
|
||||
|
@ -139,7 +129,7 @@ in {
|
|||
}
|
||||
//
|
||||
# workspace binds
|
||||
builtins.listToAttrs (builtins.concatMap (x: [
|
||||
lib.listToAttrs (lib.concatMap (x: [
|
||||
{
|
||||
name = "${modifier}+${x}";
|
||||
value = "workspace ${x}";
|
||||
|
@ -148,7 +138,7 @@ in {
|
|||
name = "${modifier}+Shift+${x}";
|
||||
value = "move container to workspace ${x}";
|
||||
}
|
||||
]) (builtins.genList (x: toString (x + 1)) 9));
|
||||
]) (lib.genList (x: toString (x + 1)) 9));
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,39 +1,16 @@
|
|||
{pkgs, ...}: {
|
||||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
programs.swaylock = {
|
||||
enable = true;
|
||||
package = pkgs.swaylock-effects;
|
||||
settings = {
|
||||
daemonize = true;
|
||||
screenshots = true;
|
||||
clock = true;
|
||||
indicator = true;
|
||||
|
||||
# i forgot which colorscheme is this
|
||||
# TODO: switch to tokyonight
|
||||
line-color = "cdd6f4ff";
|
||||
text-color = "cdd6f4ff";
|
||||
inside-color = "1e1e2eff";
|
||||
ring-color = "313244ff";
|
||||
|
||||
line-ver-color = "cdd6f4ff";
|
||||
text-ver-color = "cdd6f4ff";
|
||||
inside-ver-color = "1e1e2eff";
|
||||
ring-ver-color = "313244ff";
|
||||
|
||||
line-clear-color = "cdd6f4ff";
|
||||
text-clear-color = "cdd6f4ff";
|
||||
inside-clear-color = "1e1e2eff";
|
||||
ring-clear-color = "313244ff";
|
||||
|
||||
line-wrong-color = "cdd6f4ff";
|
||||
text-wrong-color = "313244ff";
|
||||
inside-wrong-color = "f38ba8ff";
|
||||
ring-wrong-color = "313244ff";
|
||||
|
||||
key-hl-color = "cba6f7ff";
|
||||
effect-blur = "7x5";
|
||||
effect-vignette = "0.5:0.5";
|
||||
fade-in = 0.2;
|
||||
show-failed-attempts = true;
|
||||
show-keyboard-layout = true;
|
||||
image = toString inputs.self.legacyPackages.${pkgs.stdenv.hostPlatform.system}.background.dark;
|
||||
scaling = "fill";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
allowNonSource = false;
|
||||
allowNonSourcePredicate = pkg:
|
||||
builtins.elem (lib.getName pkg) [
|
||||
lib.elem (lib.getName pkg) [
|
||||
"adoptopenjdk-hotspot-bin"
|
||||
"cargo-bootstrap"
|
||||
"cef-binary"
|
||||
|
@ -18,7 +18,7 @@
|
|||
|
||||
allowUnfree = false;
|
||||
allowUnfreePredicate = pkg:
|
||||
builtins.elem (lib.getName pkg) [
|
||||
lib.elem (lib.getName pkg) [
|
||||
"fcitx5-pinyin-minecraft"
|
||||
"fcitx5-pinyin-moegirl"
|
||||
"libXNVCtrl"
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
allowNonSource = false;
|
||||
allowNonSourcePredicate = pkg:
|
||||
builtins.elem (lib.getName pkg) [
|
||||
lib.elem (lib.getName pkg) [
|
||||
"adoptopenjdk-hotspot-bin"
|
||||
"cargo-bootstrap"
|
||||
"minecraft-server"
|
||||
|
@ -17,7 +17,7 @@
|
|||
|
||||
allowUnfree = false;
|
||||
allowUnfreePredicate = pkg:
|
||||
builtins.elem (lib.getName pkg) [
|
||||
lib.elem (lib.getName pkg) [
|
||||
"broadcom-sta"
|
||||
"minecraft-server"
|
||||
];
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
######## Secrets
|
||||
sops = {
|
||||
secrets = builtins.mapAttrs (_name: value: value // {sopsFile = ./secrets.yaml;}) {
|
||||
secrets = lib.mapAttrs (_name: value: value // {sopsFile = ./secrets.yaml;}) {
|
||||
"synapse/secret" = {
|
||||
restartUnits = ["matrix-synapse.service"];
|
||||
owner = config.systemd.services.matrix-synapse.serviceConfig.User;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
nixpkgs.config = {
|
||||
allowNonSource = false;
|
||||
allowNonSourcePredicate = pkg:
|
||||
builtins.elem (lib.getName pkg) [
|
||||
lib.elem (lib.getName pkg) [
|
||||
"adoptopenjdk-hotspot-bin"
|
||||
"cargo-bootstrap"
|
||||
"rustc-bootstrap"
|
||||
|
@ -13,7 +13,7 @@
|
|||
|
||||
allowUnfree = false;
|
||||
allowUnfreePredicate = pkg:
|
||||
builtins.elem (lib.getName pkg) [
|
||||
lib.elem (lib.getName pkg) [
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -31,8 +31,7 @@
|
|||
boot.kernelPackages = pkgs.linuxPackages;
|
||||
|
||||
### Secrets
|
||||
sops = {
|
||||
secrets = builtins.mapAttrs (_name: value: value // {sopsFile = ./secrets.yaml;}) {
|
||||
sops.secrets = lib.mapAttrs (_name: value: value // {sopsFile = ./secrets.yaml;}) {
|
||||
"hysteria/auth" = {
|
||||
restartUnits = ["hysteria.service"];
|
||||
};
|
||||
|
@ -46,7 +45,6 @@
|
|||
restartUnits = ["miniflux.service"];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
### Services
|
||||
networking.firewall.allowedUDPPorts = [443]; # hysteria
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
};
|
||||
|
||||
### sops-nix
|
||||
sops.secrets = builtins.mapAttrs (_name: value:
|
||||
sops.secrets = lib.mapAttrs (_name: value:
|
||||
value
|
||||
// {
|
||||
restartUnits = ["mihomo.service"];
|
||||
|
@ -42,7 +42,7 @@
|
|||
sops.templates."clash.yaml".file = let
|
||||
convert = url: "https://sub.maoxiongnet.com/sub?target=clash&list=true&url=${url}";
|
||||
substituteV2 = {src, ...} @ args: let
|
||||
args' = builtins.removeAttrs args ["src"];
|
||||
args' = lib.removeAttrs args ["src"];
|
||||
in
|
||||
pkgs.substitute {
|
||||
inherit src;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{lib, ...}: {
|
||||
sops.secrets = builtins.mapAttrs (_name: value: value // {sopsFile = ./secrets.yaml;}) {
|
||||
sops.secrets = lib.mapAttrs (_name: value: value // {sopsFile = ./secrets.yaml;}) {
|
||||
"wireless/wangxiaobo".path = "/var/lib/iwd/wangxiaobo.psk";
|
||||
"wireless/ImmortalWrt".path = "/var/lib/iwd/ImmortalWrt.psk";
|
||||
};
|
||||
|
|
|
@ -24,33 +24,33 @@ in {
|
|||
sway-unwrapped = addPatches prev.sway-unwrapped [
|
||||
# text_input: Implement input-method popups
|
||||
# https://github.com/swaywm/sway/pull/7226
|
||||
(prev.fetchpatch rec {
|
||||
(prev.fetchpatch2 rec {
|
||||
name = "0001-text_input-Implement-input-method-popups.patch";
|
||||
url = "https://aur.archlinux.org/cgit/aur.git/plain/${name}?h=sway-im&id=b8434b3ad9e8c6946dbf7b14b0f7ef5679452b94";
|
||||
hash = "sha256-A+rBaWMWs616WllVoo21AJaf9lxg/oCG0b9tHLfuJII=";
|
||||
hash = "sha256-aO21HgHVccD8vOlffcenSAn2spW7iEs0nTa5Tmebe3o=";
|
||||
})
|
||||
(prev.fetchpatch rec {
|
||||
(prev.fetchpatch2 rec {
|
||||
name = "0002-chore-fractal-scale-handle.patch";
|
||||
url = "https://aur.archlinux.org/cgit/aur.git/plain/${name}?h=sway-im&id=b8434b3ad9e8c6946dbf7b14b0f7ef5679452b94";
|
||||
hash = "sha256-YOFm0A4uuRSuiwnvF9xbp8Wl7oGicFGnq61vLegqJ0E=";
|
||||
hash = "sha256-QuV8J0sqh5L9kyYEOTDjWlPNKVb6zolG/cHO+wq2Qa8=";
|
||||
})
|
||||
(prev.fetchpatch rec {
|
||||
(prev.fetchpatch2 rec {
|
||||
name = "0003-chore-left_pt-on-method-popup.patch";
|
||||
url = "https://aur.archlinux.org/cgit/aur.git/plain/${name}?h=sway-im&id=b8434b3ad9e8c6946dbf7b14b0f7ef5679452b94";
|
||||
hash = "sha256-PzhQBRpyB1WhErn05UBtBfaDW5bxnQLRKWu8jy7dEiM=";
|
||||
hash = "sha256-4zvVbAdxK05UWy+QMsHPHrVBwmO5279GqhYgJUPsCNI=";
|
||||
})
|
||||
|
||||
# Tray D-Bus Menu
|
||||
# https://github.com/swaywm/sway/pull/6249
|
||||
(prev.fetchpatch {
|
||||
(prev.fetchpatch2 {
|
||||
name = "0001-Tray-Implement-dbusmenu.patch";
|
||||
url = "https://github.com/NickHu/sway/commit/0fc5d7aed84415a77b718ca9dc3c0b3ad2c05b02.patch";
|
||||
hash = "sha256-1KuGZGwyGJK8KO4OngS+tWKV/3Yu++bCNnp+xTrlGoY=";
|
||||
hash = "sha256-eosg6m2P6e8NRXjOAQL3SZg+Yc4Av9Wd+LOy0G3+xkA=";
|
||||
})
|
||||
(prev.fetchpatch {
|
||||
(prev.fetchpatch2 {
|
||||
name = "0002-Tray-dont-invoke-dbus-menu-when-tray-is-disabled.patch";
|
||||
url = "https://github.com/NickHu/sway/commit/03c14421354e54332e12f78d029dcaa9919fd161.patch";
|
||||
hash = "sha256-GhBlCnk7aB6s57wV1FNOPAt6s0oJxLgf2bMw+8ktn8A=";
|
||||
hash = "sha256-8RGtpfN/tnkA7nuGdXGHoKUoKVeG7brSQR6V4RU3z88=";
|
||||
})
|
||||
];
|
||||
};
|
||||
|
|
24
pkgs/background.nix
Normal file
24
pkgs/background.nix
Normal 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
|
||||
''
|
|
@ -6,6 +6,8 @@ in {
|
|||
# https://github.com/NixOS/nixpkgs/pull/308720
|
||||
pixivfe = callPackage ./pixivfe.nix {};
|
||||
|
||||
background = callPackage ./background.nix {};
|
||||
|
||||
scripts = lib.makeScope pkgs.newScope (self: let
|
||||
inherit (self) callPackage;
|
||||
in {
|
||||
|
|
Loading…
Reference in a new issue