Skip to content

Commit

Permalink
treewide: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
linyinfeng committed Dec 10, 2024
1 parent 6e780f4 commit ecbfc53
Show file tree
Hide file tree
Showing 21 changed files with 65 additions and 249 deletions.
2 changes: 1 addition & 1 deletion devshell/patches.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ let
name = "update-patches";
text = ''
cd "$PRJ_ROOT/patches"
# TODO broken on newest commits
# currently nothing
'';
};
in
Expand Down
4 changes: 2 additions & 2 deletions devshell/prepare/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ let
imports =
suites.server
++ (with profiles; [
# TODO
# PLACEHOLDER
]);
config = lib.mkMerge [
{
# TODO
# PLACEHOLDER
}
# stateVersion
Expand Down
51 changes: 0 additions & 51 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 0 additions & 11 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,6 @@

impermanence.url = "github:nix-community/impermanence";

typhon.url = "github:typhon-ci/typhon";
typhon.inputs.crane.follows = "crane";
typhon.inputs.flake-compat.follows = "flake-compat";
typhon.inputs.nixpkgs.follows = "nixpkgs";

# TODO use upstream
# nixos-riscv.url = "github:nickcao/nixos-riscv";
nixos-riscv.url = "github:linyinfeng/nixos-riscv";
nixos-riscv.inputs.nixpkgs.follows = "nixpkgs-riscv";
nixos-riscv.inputs.nixos-hardware.follows = "nixos-hardware";

# home-manager modules

emacs-overlay.url = "github:nix-community/emacs-overlay";
Expand Down
3 changes: 1 addition & 2 deletions flake/hosts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ let
inputs.ace-bot.nixosModules.ace-bot
inputs.commit-notifier.nixosModules.commit-notifier
inputs.angrr.nixosModules.angrr
inputs.typhon.nixosModules.default
inputs.lanzaboote.nixosModules.lanzaboote
inputs.niri-flake.nixosModules.niri

Expand Down Expand Up @@ -420,7 +419,7 @@ in
(
{ ... }:
{
# TODO mobile-nixos tests `config.nixpkgs.localSystem`
# mobile-nixos tests `config.nixpkgs.localSystem`
nixpkgs.system = "aarch64-linux";
}
)
Expand Down
55 changes: 2 additions & 53 deletions flake/nixpkgs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -70,51 +70,13 @@ let
lanzaboote = inputs.lanzaboote.overlays.default final prev;
})
(final: prev: {
# TODO broken with auto-allocate-uids
ccacheStdenv = final.stdenv;
# # ccache
# ccacheCacheDir = "/var/cache/ccache";
# ccacheLogDir = "/var/log/ccache";
# ccacheWrapper = prev.ccacheWrapper.override {
# extraConfig = ''
# export CCACHE_COMPRESS=1
# export CCACHE_UMASK=007
# if [ -d "${final.ccacheCacheDir}" ]; then
# export CCACHE_DIR="${final.ccacheCacheDir}"
# else
# export CCACHE_DIR="/tmp/ccache"
# mkdir -p "$CCACHE_DIR"
# echo "ccacheWrapper: \"${final.ccacheCacheDir}\" is not a directory, cache in \"$CCACHE_DIR\"" >&2
# fi
# if [ -d "${final.ccacheLogDir}" ]; then
# export CCACHE_LOGFILE="${final.ccacheLogDir}/ccache.log"
# fi
# if [ ! -w "$CCACHE_DIR" ]; then
# echo "ccacheWrapper: '$CCACHE_DIR' is not accessible for user $(whoami)" >&2
# exit 1
# fi
# '';
# };
# ccacheTest = final.ccacheStdenv.mkDerivation {
# name = "test-ccache";
# src = builtins.toFile "hello-world.c" ''
# #include <stdio.h>
# int main() { printf("hello, world\n"); }
# '';
# dontUnpack = true;
# env.NIX_DEBUG = 1;
# buildPhase = "cc $src -o hello";
# installPhase = "install -D hello $out/bin/hello";
# };

# adjustment
nixVersions = prev.nixVersions // {
selected = final.nixVersions.latest;
};
nix = final.nixVersions.selected;
gnuradio = prev.gnuradio.override {
unwrapped = prev.gnuradio.unwrapped.override {
stdenv = final.ccacheStdenv;
soapysdr = final.soapysdr-with-plugins;
};
};
Expand All @@ -128,7 +90,6 @@ let
waydroid = prev.waydroid.overrideAttrs (old: {
patches = (old.patches or [ ]) ++ [ ../patches/waydroid-mount-nix-and-run-binfmt.patch ];
});
linuxManualConfig = prev.linuxManualConfig.override { stdenv = final.ccacheStdenv; };
blender = prev.blender.override {
cudaSupport = true;
};
Expand Down Expand Up @@ -170,9 +131,7 @@ in
nixpkgs = {
config = {
allowUnfree = true;
# TODO wait for mautrix-telegram update
# TODO wait for matrix-qq update
# TODO wait for logseq update
# TODO wait for mautrix-telegram, matrix-qq, and logseq update
allowInsecurePredicate =
p:
(p.pname or null) == "olm"
Expand All @@ -182,7 +141,7 @@ in
"27"
"28"
]
); # for dependency of logseq
);
};
overlays =
let
Expand All @@ -199,16 +158,6 @@ in
(earlyFixes overlayNixpkgsArgs) ++ packages ++ (lateFixes overlayNixpkgsArgs);
};
}
(lib.mkIf (system == "riscv64-linux") {
# cross from x86_64-linux
nixpkgs.path = inputs.nixpkgs-riscv;
nixpkgs.localSystem = {
system = "x86_64-linux";
};
nixpkgs.crossSystem = {
inherit system;
};
})
(lib.mkIf (system == "loongarch64-linux") {
# cross from x86_64-linux
nixpkgs.localSystem = {
Expand Down
9 changes: 0 additions & 9 deletions home-manager/profiles/emacs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,6 @@ let
{
# currently nothing
# inherit (lEpkgs) ;
# TODO broken on v4.0.4
emacsql = epkgs.emacsql.overrideAttrs (_old: {
src = pkgs.fetchFromGitHub {
owner = "magit";
repo = "emacsql";
rev = "v4.0.3";
hash = "sha256-MaL3t+2MhWOE6eLmt8m4ImpsKeNeUZ4S8zEoQVu51ZY=";
};
});
}
);
};
Expand Down
3 changes: 1 addition & 2 deletions nixos/hosts/mtl0/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ in
services.minio
services.vaultwarden
services.gitweb
# TODO broken https://github.com/NixOS/nixpkgs/issues/262907#issuecomment-2018578833
# services.seafile
services.seafile
services.commit-notifier
services.pastebin
services.http-test
Expand Down
2 changes: 0 additions & 2 deletions nixos/hosts/nuc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ in
services.smartd
services.postgresql
services.hydra
# TODO broken
# services.typhon
programs.service-mail
programs.tg-send
users.yinfeng
Expand Down
3 changes: 0 additions & 3 deletions nixos/profiles/boot/kernel/intel.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,12 @@ in
linux_intel_fn =
{
buildLinux,
ccacheStdenv,
lib,
...
}@args:
buildLinux (
args
// {
# build with ccacheStdenv
stdenv = ccacheStdenv;
inherit version;
modDirVersion = lib.versions.pad 3 version;
extraMeta.branch = lib.versions.majorMinor version;
Expand Down
3 changes: 0 additions & 3 deletions nixos/profiles/boot/kernel/sdm845-mainline/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,12 @@ in
linux_sdm845_fn =
{
buildLinux,
ccacheStdenv,
lib,
...
}@args:
buildLinux (
args
// {
# build with ccacheStdenv
stdenv = ccacheStdenv;
inherit version;
modDirVersion = "${lib.versions.pad 3 version}-sdm845";
extraMeta.branch = lib.versions.majorMinor version;
Expand Down
37 changes: 37 additions & 0 deletions nixos/profiles/programs/ccache/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,41 @@ in
rotate = 1;
};
};
nixpkgs.overlays = [
(final: prev: {
ccacheCacheDir = "/var/cache/ccache";
ccacheLogDir = "/var/log/ccache";
ccacheWrapper = prev.ccacheWrapper.override {
extraConfig = ''
export CCACHE_COMPRESS=1
export CCACHE_UMASK=007
if [ -d "${final.ccacheCacheDir}" ]; then
export CCACHE_DIR="${final.ccacheCacheDir}"
else
export CCACHE_DIR="/tmp/ccache"
mkdir -p "$CCACHE_DIR"
echo "ccacheWrapper: \"${final.ccacheCacheDir}\" is not a directory, cache in \"$CCACHE_DIR\"" >&2
fi
if [ -d "${final.ccacheLogDir}" ]; then
export CCACHE_LOGFILE="${final.ccacheLogDir}/ccache.log"
fi
if [ ! -w "$CCACHE_DIR" ]; then
echo "ccacheWrapper: '$CCACHE_DIR' is not accessible for user $(whoami)" >&2
exit 1
fi
'';
};
ccacheTest = final.ccacheStdenv.mkDerivation {
name = "test-ccache";
src = builtins.toFile "hello-world.c" ''
#include <stdio.h>
int main() { printf("hello, world\n"); }
'';
dontUnpack = true;
env.NIX_DEBUG = 1;
buildPhase = "cc $src -o hello";
installPhase = "install -D hello $out/bin/hello";
};
})
];
}
2 changes: 1 addition & 1 deletion nixos/profiles/services/nextcloud/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ in
onlyoffice
memories
previewgenerator
# maps # TODO wait for support on nextcloud 30
maps
;
};
notify_push = {
Expand Down
1 change: 0 additions & 1 deletion nixos/profiles/services/nuc-proxy/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
inherit (config.security.acme.tfCerts."li7g_com".nginxSettings) sslCertificate sslCertificateKey;
serverAliases = [
"hydra-proxy.*"
"typhon-proxy.*"
];
locations."/" = {
proxyPass = "https://nuc";
Expand Down
15 changes: 4 additions & 11 deletions nixos/profiles/services/telegraf-http/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -56,24 +56,17 @@ let
code = 200;
}
];
# typhon = [
# {
# url = "https://typhon.ts.li7g.com";
# code = 200;
# }
# ];
dst = [ ];
smtp = [ ];
teamspeak = [ ];
"shanghai.derp" = [ ];
};
overrides = {
box = [
# TODO broken https://github.com/NixOS/nixpkgs/issues/262907#issuecomment-2018578833
# {
# url = "https://box.li7g.com/accounts/login/?next=/";
# code = 200;
# }
{
url = "https://box.li7g.com/accounts/login/?next=/";
code = 200;
}
];
tar = [
{
Expand Down
Loading

0 comments on commit ecbfc53

Please sign in to comment.