Merge remote-tracking branch 'origin/master' into kakoune-package

This commit is contained in:
Natsu Kagami 2024-10-15 17:44:16 +02:00
commit c726f21983
Signed by: nki
GPG key ID: 55A032EB38B49ADB
8 changed files with 74 additions and 103 deletions

View file

@ -55,16 +55,16 @@
"nixpkgs": "nixpkgs_4" "nixpkgs": "nixpkgs_4"
}, },
"locked": { "locked": {
"lastModified": 1718214198, "lastModified": 1728224242,
"narHash": "sha256-/qKPeE2Ptweaf+rHOvdW0TUDLwN9D93MMgDoU4fTzEA=", "narHash": "sha256-mQLfRAun2G/LDnw3jyFGJbOqpxh2PL8IGzFELRfAgAI=",
"owner": "famedly", "owner": "famedly",
"repo": "conduit", "repo": "conduit",
"rev": "7a5b8930134cf7ea5ff9880e6fa468b2b3e05c98", "rev": "f8d7ef04e664580e882bac852877b68e7bd3ab1e",
"type": "gitlab" "type": "gitlab"
}, },
"original": { "original": {
"owner": "famedly", "owner": "famedly",
"ref": "v0.8.0", "ref": "v0.9.0",
"repo": "conduit", "repo": "conduit",
"type": "gitlab" "type": "gitlab"
} }
@ -232,11 +232,11 @@
"nixpkgs": "nixpkgs_7" "nixpkgs": "nixpkgs_7"
}, },
"locked": { "locked": {
"lastModified": 1723470164, "lastModified": 1728598146,
"narHash": "sha256-ZWcDD4HTmFtEJgEA2Ydg2mA+yu0FVcfEHbCGVXDatfw=", "narHash": "sha256-8zAvVSR3chBSJ7YKW+MYC1mrDxtZDFBPVobfO4KPXzg=",
"ref": "dtth-fork", "ref": "dtth-fork",
"rev": "c72bd47bbd18523b951b3fa73c789629504d0eb3", "rev": "fc6bd96aef92d7796d9c7663ac23e3fa837f8ddb",
"revCount": 2721, "revCount": 3218,
"type": "git", "type": "git",
"url": "ssh://gitea@git.dtth.ch/nki/phanpy" "url": "ssh://gitea@git.dtth.ch/nki/phanpy"
}, },
@ -485,11 +485,11 @@
"systems": "systems_3" "systems": "systems_3"
}, },
"locked": { "locked": {
"lastModified": 1710146030, "lastModified": 1726560853,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -742,11 +742,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1727383923, "lastModified": 1728337164,
"narHash": "sha256-4/vacp3CwdGoPf8U4e/N8OsGYtO09WTcQK5FqYfJbKs=", "narHash": "sha256-VdRTjJFyq4Q9U7Z/UoC2Q5jK8vSo6E86lHc2OanXtvc=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "ffe2d07e771580a005e675108212597e5b367d2d", "rev": "038630363e7de57c36c417fd2f5d7c14773403e4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1022,11 +1022,11 @@
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1727492312, "lastModified": 1728409405,
"narHash": "sha256-oRkgc+DosM3HIl9el98TxF2rtliKHCNVw00nlQC7xYM=", "narHash": "sha256-kk530XBUGDpt0DQbyUb3yDpSddPqF9PA5KTo/nsmmg0=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "4471f9f67fe0f95f5fec4cc2ebac59fe32af2b62", "rev": "1366d1af8f58325602280e43ed6233849fb92216",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1134,11 +1134,11 @@
}, },
"nixpkgs_7": { "nixpkgs_7": {
"locked": { "locked": {
"lastModified": 1723175592, "lastModified": 1728492678,
"narHash": "sha256-M0xJ3FbDUc4fRZ84dPGx5VvgFsOzds77KiBMW/mMTnI=", "narHash": "sha256-9UTxR8eukdg+XZeHgxW5hQA9fIKHsKCdOIUycTryeVw=",
"owner": "nixOS", "owner": "nixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "5e0ca22929f3342b19569b21b2f3462f053e497b", "rev": "5633bcff0c6162b9e4b5f1264264611e950c8ec7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1549,11 +1549,11 @@
"rust-overlay": "rust-overlay_4" "rust-overlay": "rust-overlay_4"
}, },
"locked": { "locked": {
"lastModified": 1726330095, "lastModified": 1728746553,
"narHash": "sha256-5Qhb4stOM8gbasfALX7Zaw7Q6OZZm2PjBC/8dYAOR8g=", "narHash": "sha256-BlZpmTt6wyMIpJvd5nEWGgqJQbtjVTzBlYYQVShZ7Io=",
"owner": "natsukagami", "owner": "natsukagami",
"repo": "youmubot", "repo": "youmubot",
"rev": "76fd6c803d9c50a3ad677218dad249f596efe760", "rev": "c5354e30ad40f67938deed1deb5ea92bb168a586",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -47,7 +47,7 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
dtth-phanpy.url = "git+ssh://gitea@git.dtth.ch/nki/phanpy?ref=dtth-fork"; dtth-phanpy.url = "git+ssh://gitea@git.dtth.ch/nki/phanpy?ref=dtth-fork";
conduit.url = "gitlab:famedly/conduit/v0.8.0"; conduit.url = "gitlab:famedly/conduit/v0.9.0";
nix-gaming.url = github:fufexan/nix-gaming; nix-gaming.url = github:fufexan/nix-gaming;
# --- Sources # --- Sources

View file

@ -28,6 +28,7 @@
fx # JSON viewer fx # JSON viewer
glow # Markdown viewer glow # Markdown viewer
nix-output-monitor # Nice nix output formatting nix-output-monitor # Nice nix output formatting
unstable.scala-next
## PDF Processors ## PDF Processors
poppler_utils poppler_utils
## htop replacement ## htop replacement

View file

@ -61,19 +61,18 @@ in
# Simplify nix usage! # Simplify nix usage!
nx = { nx = {
body = '' body = ''
set impure argparse -s 'h/help' 'impure' 'u/unstable' 'g/git' -- $argv
if test $argv[1] = "--impure" if set -q _flag_help || test (count $argv) -eq 0
set impure "--impure" echo "nx [--impure] [-u/--unstable/-g/--git] {package} [args...]"
set argv $argv[2..]
end
if test (count $argv) -gt 0
nix run $impure nixpkgs#$argv[1] -- $argv[2..]
else
echo "nx [--impure] {package} [args...]"
return 1 return 1
else
set -q _flag_impure && set impure "--impure"
set nixpkgs "nixpkgs"
set -q _flag_unstable && set nixpkgs "nixpkgs-unstable"
set -q _flag_git && set nixpkgs "github:nixOS/nixpkgs/nixpkgs-unstable"
nix run $impure $nixpkgs"#"$argv[1] -- $argv[2..]
end end
''; '';
wraps = "nix run";
description = "Runs an app from the nixpkgs store."; description = "Runs an app from the nixpkgs store.";
}; };
@ -81,25 +80,35 @@ in
description = "Spawns a shell from the given nixpkgs packages"; description = "Spawns a shell from the given nixpkgs packages";
wraps = "nix shell"; wraps = "nix shell";
body = '' body = ''
set impure function help
if test $argv[1] = "--impure" echo "nsh [--impure] [--impure] [-u/--unstable/-g/--git] {package}* [-c command args...]"
set impure "--impure"
set argv $argv[2..]
end end
if test (count $argv) -gt 0 argparse -s 'h/help' 'impure' 'u/unstable' 'g/git' -- $argv
set minusc (contains -i -- "-c" $argv) if set -q _flag_help || test (count $argv) -eq 0
if test -z $minusc help
nix shell $impure nixpkgs#$argv -c fish return 0
else if test $minusc -eq (count $argv) end
echo "nsh [--impure] {packages} [-c command args...]" set packages $argv
set minusc (contains -i -- "-c" $argv)
if test -n "$minusc"
if test $minusc -eq 1
help
return 1 return 1
else
nix shell $impure nixpkgs#$argv[..(math $minusc - 1)] $argv[$minusc..]
end end
set packages $argv[..(math $minusc - 1)]
set argv $argv[(math $minusc + 1)..]
else else
echo "nsh [--impure] {packages} [-c command args...]" set argv "fish" "-i"
end
if test (count $packages) -eq 0
help
return 1 return 1
end end
set -q _flag_impure && set impure "--impure"
set nixpkgs "nixpkgs"
set -q _flag_unstable && set nixpkgs "nixpkgs-unstable"
set -q _flag_git && set nixpkgs "github:nixOS/nixpkgs/nixpkgs-unstable"
nix shell $impure $nixpkgs"#"$packages --command $argv
''; '';
}; };
# Grep stuff # Grep stuff

View file

@ -2,10 +2,20 @@
let let
cfg = config.nki.programs.kitty; cfg = config.nki.programs.kitty;
theme = { lib, options, config, ... }: {
programs.kitty = lib.mkIf config.nki.programs.kitty.enable (
if builtins.hasAttr "themeFile" options.programs.kitty then {
themeFile = "ayu_light";
} else {
theme = "Ayu Light";
}
);
};
in in
with lib; with lib;
{ {
imports = [ ./darwin.nix ./linux.nix ./tabs.nix ]; imports = [ theme ./darwin.nix ./linux.nix ./tabs.nix ];
options.nki.programs.kitty = { options.nki.programs.kitty = {
enable = mkEnableOption "Enable kitty"; enable = mkEnableOption "Enable kitty";
@ -50,8 +60,6 @@ with lib;
font.name = "Fantasque Sans Mono"; font.name = "Fantasque Sans Mono";
font.size = cfg.fontSize; font.size = cfg.fontSize;
themeFile = "ayu_light";
settings = settings =
let let
# Background color and transparency # Background color and transparency

View file

@ -74,6 +74,8 @@ with lib;
global.port = instance.port; global.port = instance.port;
global.allow_registration = instance.allow_registration; global.allow_registration = instance.allow_registration;
global.database_path = "/mnt/data/${srvName}/"; global.database_path = "/mnt/data/${srvName}/";
global.well_known_client = "https://${instance.host}";
global.well_known_server = "${instance.host}:443";
}); });
in in
{ {
@ -114,61 +116,12 @@ with lib;
)) ))
cfg.instances); cfg.instances);
# Serving .well-known files
# This is a single .well-known/matrix/server file that points to the server,
# which is NOT on port 8448 since Cloudflare doesn't allow us to route HTTPS
# through that port.
config.services.nginx = mkIf cfg.enable
{
enable = true;
virtualHosts = lib.attrsets.mapAttrs'
(name: instance: lib.attrsets.nameValuePair "conduit-${name}-well-known" {
listen = [{ addr = "127.0.0.1"; port = instance.well-known_port; }];
# Check https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/docs/configuring-well-known.md
# for the file structure.
root = pkgs.symlinkJoin
{
name = "well-known-files-for-conduit-${name}";
paths = [
(pkgs.writeTextDir ".well-known/matrix/client" (builtins.toJSON {
"m.homeserver".base_url = "https://${instance.host}";
"org.matrix.msc3575.proxy".url = "https://${instance.host}";
}))
(pkgs.writeTextDir ".well-known/matrix/server" (builtins.toJSON {
"m.server" = "${instance.host}:443";
}))
];
};
extraConfig =
# Enable CORS from anywhere since we want all clients to find us out
''
add_header 'Access-Control-Allow-Origin' "*";
'' +
# Force returning values to be JSON data
''
default_type application/json;
'';
})
cfg.instances;
};
config.cloud.traefik.hosts = mkIf cfg.enable ( config.cloud.traefik.hosts = mkIf cfg.enable (
(lib.attrsets.mapAttrs' (lib.attrsets.mapAttrs'
(name: instance: lib.attrsets.nameValuePair "conduit-${name}" ({ (name: instance: lib.attrsets.nameValuePair "conduit-${name}" ({
inherit (instance) host port noCloudflare; inherit (instance) host port noCloudflare;
})) }))
cfg.instances) cfg.instances)
// (lib.attrsets.mapAttrs'
(name: instance: lib.attrsets.nameValuePair "conduit-${name}-well-known" (
let
server_name = if instance.server_name == "" then instance.host else instance.server_name;
in
{
port = instance.well-known_port;
filter = "Host(`${server_name}`) && PathPrefix(`/.well-known`)";
}
))
cfg.instances)
); );
} }

View file

@ -38,7 +38,7 @@ let
}; };
accounts = { pkgs, ... }: mkIf (config.common.linux.enable && !pkgs.stdenv.isAarch64) { accounts = { pkgs, ... }: mkIf (config.common.linux.enable && !pkgs.stdenv.isAarch64) {
environment.systemPackages = with pkgs; [ glib gnome-control-center ]; environment.systemPackages = [ pkgs.glib (pkgs.gnome-control-center or pkgs.gnome.gnome-control-center) ];
services.accounts-daemon.enable = true; services.accounts-daemon.enable = true;
services.gnome.gnome-online-accounts.enable = true; services.gnome.gnome-online-accounts.enable = true;
# programs.evolution.enable = true; # programs.evolution.enable = true;

View file

@ -25,7 +25,7 @@ let
overlay-versioning = final: prev: { overlay-versioning = final: prev: {
gotosocial = prev.gotosocial.overrideAttrs (attrs: rec { gotosocial = prev.gotosocial.overrideAttrs (attrs: rec {
version = "0.16.0"; version = "0.17.0-rc3";
ldflags = [ ldflags = [
"-s" "-s"
"-w" "-w"
@ -35,13 +35,13 @@ let
web-assets = final.fetchurl { web-assets = final.fetchurl {
url = "https://github.com/superseriousbusiness/gotosocial/releases/download/v${version}/gotosocial_${version}_web-assets.tar.gz"; url = "https://github.com/superseriousbusiness/gotosocial/releases/download/v${version}/gotosocial_${version}_web-assets.tar.gz";
hash = "sha256-aZQpd5KvoZvXEMVzGbWrtGsc+P1JStjZ6U5mX6q7Vb0="; hash = "sha256-Uwltr5syOnDZOgMc2L/iedxiMMKXmULzm0SAs3W0SXQ=";
}; };
src = final.fetchFromGitHub { src = final.fetchFromGitHub {
owner = "superseriousbusiness"; owner = "superseriousbusiness";
repo = "gotosocial"; repo = "gotosocial";
rev = "v${version}"; rev = "v${version}";
hash = "sha256-QoG09+jmq5e5vxDVtkhY35098W/9B1HsYTuUnz43LV4="; hash = "sha256-c7CJFQWTMCBZuzI/Mf5PJuCWY1NKW4LLMAJem3TTJvM=";
}; };
postInstall = '' postInstall = ''
tar xf ${web-assets} tar xf ${web-assets}