treewide: migrate packages to NUR

This commit is contained in:
Guanran Wang 2024-02-27 15:38:36 +08:00
parent a8661a3af4
commit dfa1ebc37f
Signed by: nyancat
SSH key fingerprint: SHA256:8oWGKciPALWut/6WA27oFKofX+6Wtc0gQnsefXLQx/8
15 changed files with 39 additions and 194 deletions

View file

@ -1,12 +1,12 @@
{ {
inputs,
pkgs, pkgs,
config,
... ...
}: { }: {
services.clash = { services.clash = {
enable = true; enable = true;
package = pkgs.clash-meta; package = pkgs.clash-meta;
webui = inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.metacubexd; webui = config.nur.repos.guanran928.metacubexd;
}; };
### System proxy settings ### System proxy settings

View file

@ -344,6 +344,21 @@
"type": "github" "type": "github"
} }
}, },
"nur": {
"locked": {
"lastModified": 1709018801,
"narHash": "sha256-H2oaTPFy+3XXeLpLc81u75xGHuvjoEEZ905aVYB/NA0=",
"owner": "nix-community",
"repo": "NUR",
"rev": "050fba3242dfec4f41ce7942b75100b84cb48247",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "NUR",
"type": "github"
}
},
"nvfetcher": { "nvfetcher": {
"inputs": { "inputs": {
"flake-compat": [ "flake-compat": [
@ -421,6 +436,7 @@
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixpkgs-stable": "nixpkgs-stable", "nixpkgs-stable": "nixpkgs-stable",
"nur": "nur",
"nvfetcher": "nvfetcher", "nvfetcher": "nvfetcher",
"pre-commit-hooks-nix": "pre-commit-hooks-nix", "pre-commit-hooks-nix": "pre-commit-hooks-nix",
"rust-overlay": "rust-overlay", "rust-overlay": "rust-overlay",

View file

@ -60,6 +60,9 @@
url = "github:jacekszymanski/nixcasks"; url = "github:jacekszymanski/nixcasks";
inputs.nixpkgs.follows = "nixpkgs-stable"; inputs.nixpkgs.follows = "nixpkgs-stable";
}; };
nur = {
url = "github:nix-community/NUR";
};
sops-nix = { sops-nix = {
url = "github:Mic92/sops-nix"; url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";

View file

@ -1,4 +1,5 @@
{ {
config,
pkgs, pkgs,
inputs, inputs,
... ...
@ -14,7 +15,7 @@
fcitx5-pinyin-moegirl fcitx5-pinyin-moegirl
fcitx5-pinyin-zhwiki fcitx5-pinyin-zhwiki
]) ])
++ (with inputs.self.packages.${pkgs.stdenv.hostPlatform.system}; [ ++ (with config.nur.repos.guanran928; [
fcitx5-tokyonight fcitx5-tokyonight
]); ]);
}; };

View file

@ -1,7 +1,7 @@
{ {
pkgs, pkgs,
lib, lib,
inputs, config,
... ...
}: { }: {
programs.mpv = { programs.mpv = {
@ -19,7 +19,7 @@
thumbfast thumbfast
sponsorblock sponsorblock
]) ])
++ (with inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.mpvScripts; [ ++ (with config.nur.repos.guanran928.mpvScripts; [
modernx modernx
]) ])
++ lib.optionals pkgs.stdenv.hostPlatform.isLinux (with pkgs.mpvScripts; [ ++ lib.optionals pkgs.stdenv.hostPlatform.isLinux (with pkgs.mpvScripts; [
@ -28,7 +28,7 @@
}; };
# I dont know how to handle the font # I dont know how to handle the font
xdg.configFile = with inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.mpvScripts; { xdg.configFile = with config.nur.repos.guanran928.mpvScripts; {
"mpv/fonts/Material-Design-Iconic-Font.ttf".source = "${modernx}/share/mpv/fonts/Material-Design-Iconic-Font.ttf"; "mpv/fonts/Material-Design-Iconic-Font.ttf".source = "${modernx}/share/mpv/fonts/Material-Design-Iconic-Font.ttf";
"mpv/fonts/Material-Design-Iconic-Round.ttf".source = "${modernx}/share/mpv/fonts/Material-Design-Iconic-Round.ttf"; "mpv/fonts/Material-Design-Iconic-Round.ttf".source = "${modernx}/share/mpv/fonts/Material-Design-Iconic-Round.ttf";
}; };

View file

@ -1,11 +1,7 @@
{ {config, ...}: {
pkgs,
inputs,
...
}: {
services.picom = { services.picom = {
enable = true; enable = true;
package = inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.picom-ft-labs; package = config.nur.repos.guanran928.picom-ft-labs;
settings = { settings = {
# Animations # Animations
animations = true; animations = true;

View file

@ -28,6 +28,7 @@
# Default applications # Default applications
imports = [ imports = [
inputs.self.homeManagerModules.default inputs.self.homeManagerModules.default
inputs.nur.hmModules.nur
./applications/git ./applications/git
./applications/gpg ./applications/gpg

View file

@ -11,13 +11,14 @@
./nix ./nix
# Flake modules # Flake modules
inputs.self.nixosModules.default
inputs.disko.nixosModules.disko inputs.disko.nixosModules.disko
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
inputs.impermanence.nixosModules.impermanence inputs.impermanence.nixosModules.impermanence
inputs.lanzaboote.nixosModules.lanzaboote inputs.lanzaboote.nixosModules.lanzaboote
inputs.sops-nix.nixosModules.sops
inputs.nix-gaming.nixosModules.pipewireLowLatency inputs.nix-gaming.nixosModules.pipewireLowLatency
inputs.nur.nixosModules.nur
inputs.self.nixosModules.default
inputs.sops-nix.nixosModules.sops
]; ];
nixpkgs.overlays = [ nixpkgs.overlays = [

View file

@ -1,7 +1,6 @@
{ {
pkgs, pkgs,
config, config,
inputs,
... ...
}: { }: {
### home-manager ### home-manager
@ -11,7 +10,7 @@
enable = true; enable = true;
package = pkgs.clash-meta; package = pkgs.clash-meta;
configFile = config.sops.templates."clash.yaml".path; configFile = config.sops.templates."clash.yaml".path;
webui = inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.metacubexd; webui = config.nur.repos.guanran928.metacubexd;
}; };
systemd.services.clash.serviceConfig.ExecStartPre = [ systemd.services.clash.serviceConfig.ExecStartPre = [

View file

@ -1,7 +1,7 @@
pkgs: { _pkgs: {
fcitx5-tokyonight = pkgs.callPackage ./fcitx5-tokyonight {}; # fcitx5-tokyonight = pkgs.callPackage ./fcitx5-tokyonight {};
metacubexd = pkgs.callPackage ./metacubexd {}; # metacubexd = pkgs.callPackage ./metacubexd {};
mpvScripts.modernx = pkgs.callPackage ./mpvScripts/modernx {}; # mpvScripts.modernx = pkgs.callPackage ./mpvScripts/modernx {};
picom-ft-labs = pkgs.callPackage ./picom-ft-labs {}; # picom-ft-labs = pkgs.callPackage ./picom-ft-labs {};
v2ray-rules-dat = pkgs.callPackage ./v2ray-rules-dat {}; # v2ray-rules-dat = pkgs.callPackage ./v2ray-rules-dat {};
} }

View file

@ -1,39 +0,0 @@
{
lib,
stdenvNoCC,
fetchFromGitHub,
nix-update-script,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "fcitx5-tokyonight";
version = "unstable-2024-01-28";
src = fetchFromGitHub {
owner = "ch3n9w";
repo = "fcitx5-Tokyonight";
rev = "f7454ab387d6b071ee12ff7ee819f0c7030fdf2c";
hash = "sha256-swOy0kDZUdqtC2sPSZEBLnHSs8dpQ/QfFMObI6BARfo=";
};
dontConfigure = true;
dontBuild = true;
installPhase = ''
install -Dm644 Tokyonight-Day/{arrow.png,panel.png,radio.png} -t $out/share/${finalAttrs.pname}/
for _variant in Tokyonight-Day Tokyonight-Storm; do
mkdir -p $out/share/fcitx5/themes/$_variant/
ln -s $out/share/${finalAttrs.pname}/arrow.png $out/share/fcitx5/themes/$_variant/arrow.png
ln -s $out/share/${finalAttrs.pname}/radio.png $out/share/fcitx5/themes/$_variant/radio.png
install -Dm644 $_variant/theme.conf $out/share/fcitx5/themes/$_variant/theme.conf
done
'';
passthru.updateScript = nix-update-script {};
meta = with lib; {
description = "Fcitx5 theme using TokyoNight colorscheme";
homepage = "https://github.com/ch3n9w/fcitx5-Tokyonight";
license = licenses.gpl3;
platforms = platforms.all;
};
})

View file

@ -1,33 +0,0 @@
{
lib,
stdenvNoCC,
fetchurl,
nix-update-script,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "metacubexd";
version = "1.135.0";
src = fetchurl {
url = "https://github.com/MetaCubeX/metacubexd/releases/download/v${finalAttrs.version}/compressed-dist.tgz";
hash = "sha256-37+oAO7vt57mO0G2L3+NcO2ndpxs3PP4+ogVNnWoGBc=";
};
dontConfigure = true;
dontBuild = true;
sourceRoot = ".";
installPhase = ''
mkdir -p $out
cp -r ./* $out
'';
passthru.updateScript = nix-update-script {};
meta = with lib; {
description = "Clash.Meta Dashboard, The Official One, XD";
homepage = "https://github.com/MetaCubeX/metacubexd";
license = licenses.mit;
platforms = platforms.all;
};
})

View file

@ -1,41 +0,0 @@
{
lib,
stdenvNoCC,
fetchFromGitHub,
nix-update-script,
}:
# TODO: use buildLua
# error: evaluation aborted with the following error message: 'lib.customisation.callPackageWith: Function called without required argument "buildLua"
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "modernx";
version = "0.2.7.6";
# zydezu's fork
src = fetchFromGitHub {
owner = "zydezu";
repo = "ModernX";
rev = finalAttrs.version;
hash = "sha256-WWwnxhFMDjlQb0+5+hD9CRe/BYt4CWHw3JGZOI3IQiE=";
};
dontConfigure = true;
dontBuild = true;
installPhase = ''
install -Dm644 modernx.lua $out/share/mpv/scripts/modernx.lua
# I dont know how to handle the font...
install -Dm644 Material-Design-Iconic-Font.ttf $out/share/mpv/fonts/Material-Design-Iconic-Font.ttf
install -Dm644 Material-Design-Iconic-Round.ttf $out/share/mpv/fonts/Material-Design-Iconic-Round.ttf
'';
passthru.scriptName = "modernx.lua";
passthru.updateScript = nix-update-script {};
meta = with lib; {
description = "A modern OSC UI replacement for MPV that retains the functionality of the default OSC. (@zydezu's fork)";
homepage = "https://github.com/zydezu/ModernX/";
license = licenses.gpl2; # https://github.com/maoiscat/mpv-osc-modern/issues/43
platforms = platforms.all;
};
})

View file

@ -1,23 +0,0 @@
{
picom,
pcre2,
fetchFromGitHub,
}:
picom.overrideAttrs (old: {
pname = "picom-ft-labs";
version = "unstable-2024-02-17";
src = fetchFromGitHub {
owner = "FT-Labs";
repo = "picom";
rev = "df4c6a3d9b11e14ed7f3142540babea4c775ddb1";
sha256 = "sha256-FmORxY7SLFnAmtQyC82sK36RoUBa94rJ7BsDXjXUCXk=";
};
buildInputs = old.buildInputs ++ [pcre2];
meta = {
description = "A fork of Picom with more than 10 unique animation supported picom fork (open window, tag change, fading ...)";
homepage = "https://github.com/FT-Labs/picom";
};
})

View file

@ -1,36 +0,0 @@
{
lib,
stdenvNoCC,
fetchurl,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "v2ray-rules-dat";
version = "202402242208";
srcs = [
(fetchurl {
url = "https://github.com/Loyalsoldier/${finalAttrs.pname}/releases/download/${finalAttrs.version}/geoip.dat";
hash = "sha256-NxnsYH80dPAq6Cd0z0G5dBmdyOH1/rOEe4Mjxu9vlQc=";
})
(fetchurl {
url = "https://github.com/Loyalsoldier/${finalAttrs.pname}/releases/download/${finalAttrs.version}/geosite.dat";
hash = "sha256-edPBydJ7pbf9hG92q5GewFxHgjI8qEBQh3N2GQ9JH30=";
})
];
dontConfigure = true;
dontBuild = true;
dontUnpack = true;
installPhase = ''
install -Dm644 ${builtins.elemAt finalAttrs.srcs 0} $out/share/v2ray/geoip.dat
install -Dm644 ${builtins.elemAt finalAttrs.srcs 1} $out/share/v2ray/geosite.dat
'';
meta = with lib; {
description = "Enhanced edition of V2Ray rules dat files";
homepage = "https://github.com/Loyalsoldier/v2ray-rules-dat";
license = licenses.gpl3;
platforms = platforms.all;
};
})