Compare commits
15 commits
3e09f07c77
...
5d98924ea1
Author | SHA1 | Date | |
---|---|---|---|
Simon Bruder | 5d98924ea1 | ||
Simon Bruder | b6a903551e | ||
Simon Bruder | 91ec565702 | ||
Simon Bruder | ad89732961 | ||
Simon Bruder | 47c5bd5338 | ||
Simon Bruder | 71308a9284 | ||
Simon Bruder | 81b3d4590a | ||
Simon Bruder | aa7cf807f2 | ||
Simon Bruder | 60577ad4ea | ||
Simon Bruder | a445953d46 | ||
Simon Bruder | f81a86235d | ||
Simon Bruder | 4f184a142c | ||
Simon Bruder | 8c317b76bf | ||
Simon Bruder | f32e2a5842 | ||
Simon Bruder | 81e22d4eba |
49
flake.lock
49
flake.lock
|
@ -79,19 +79,20 @@
|
|||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
],
|
||||
"utils": "utils"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1667907331,
|
||||
"narHash": "sha256-bHkAwkYlBjkupPUFcQjimNS8gxWSWjOTevEuwdnp5m0=",
|
||||
"lastModified": 1670253003,
|
||||
"narHash": "sha256-/tJIy4+FbsQyslq1ipyicZ2psOEd8dvl4OJ9lfisjd0=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "6639e3a837fc5deb6f99554072789724997bc8e5",
|
||||
"rev": "0e8125916b420e41bf0d23a0aa33fadd0328beb3",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"ref": "release-22.05",
|
||||
"ref": "release-22.11",
|
||||
"repo": "home-manager",
|
||||
"type": "github"
|
||||
}
|
||||
|
@ -202,11 +203,27 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1669920164,
|
||||
"narHash": "sha256-+3DM3bi/c/6MSCGDwAqqlpYHhOuKTL0bH7Xf4UmScdI=",
|
||||
"lastModified": 1670543317,
|
||||
"narHash": "sha256-4mMR56rtxKr+Gwz399jFr4i76SQZxsLWxxyfQlPXRm0=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "97e88a936cf18bc8a2c6cf65e4ec8d423e4cb743",
|
||||
"rev": "7a6a010c3a1d00f8470a5ca888f2f927f1860a19",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-22.11",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-2205": {
|
||||
"locked": {
|
||||
"lastModified": 1670538458,
|
||||
"narHash": "sha256-mvKmBkdlhzsMBtnzYXjYn08EGw9rFBEE9hp4Uqgol1Q=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "99ec06122f481588abafd91f2710d80a5320efe6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -339,6 +356,7 @@
|
|||
"nix-pre-commit-hooks": "nix-pre-commit-hooks",
|
||||
"nixos-hardware": "nixos-hardware",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nixpkgs-2205": "nixpkgs-2205",
|
||||
"nixpkgs-overlay": "nixpkgs-overlay",
|
||||
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||
"password-hash-self-service": "password-hash-self-service",
|
||||
|
@ -390,6 +408,21 @@
|
|||
"repo": "sops-nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"utils": {
|
||||
"locked": {
|
||||
"lastModified": 1667395993,
|
||||
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
|
|
|
@ -4,10 +4,11 @@
|
|||
inputs = {
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-22.05";
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11";
|
||||
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
nixpkgs-2205.url = "github:nixos/nixpkgs/nixos-22.05";
|
||||
|
||||
home-manager.url = "github:nix-community/home-manager/release-22.05";
|
||||
home-manager.url = "github:nix-community/home-manager/release-22.11";
|
||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
krops.url = "github:Mic92/krops";
|
||||
|
|
|
@ -14,15 +14,10 @@ in
|
|||
|
||||
rootUrl = "https://git.sbruder.de/";
|
||||
appName = "sbrudergit";
|
||||
cookieSecure = true;
|
||||
log.level = "Warn";
|
||||
lfs = {
|
||||
enable = true;
|
||||
};
|
||||
enableUnixSocket = true;
|
||||
ssh = {
|
||||
clonePort = 2022;
|
||||
};
|
||||
database.type = "postgres";
|
||||
mailerPasswordFile = config.sops.secrets.gitea-mail.path;
|
||||
settings = {
|
||||
|
@ -43,6 +38,7 @@ in
|
|||
# internal ssh server
|
||||
BUILTIN_SSH_SERVER_USER = "git";
|
||||
START_SSH_SERVER = true;
|
||||
SSH_PORT = 2022;
|
||||
SSH_SERVER_HOST_KEYS = "ssh/gitea.ed25519,ssh/gitea.rsa";
|
||||
};
|
||||
service = {
|
||||
|
@ -53,11 +49,15 @@ in
|
|||
};
|
||||
session = {
|
||||
PROVIDER = "file";
|
||||
COOKIE_SECURE = true;
|
||||
};
|
||||
log = {
|
||||
LEVEL = "Warn";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ cfg.ssh.clonePort ];
|
||||
networking.firewall.allowedTCPPorts = [ cfg.settings.server.SSH_PORT ];
|
||||
|
||||
services.nginx.virtualHosts."git.sbruder.de" = {
|
||||
enableACME = true;
|
||||
|
|
|
@ -5,19 +5,28 @@ in
|
|||
{
|
||||
services.grafana = {
|
||||
enable = true;
|
||||
settings = {
|
||||
server = {
|
||||
# grafana supports sockets, but no permission management (always 660 grafana:grafana)
|
||||
addr = "127.0.0.1";
|
||||
port = 3002;
|
||||
http_addr = "127.0.0.1";
|
||||
http_port = 3002;
|
||||
domain = "grafana.sbruder.de";
|
||||
rootUrl = "https://%(domain)s/";
|
||||
};
|
||||
database = {
|
||||
type = "postgres";
|
||||
host = "/run/postgresql";
|
||||
user = "grafana";
|
||||
};
|
||||
analytics = {
|
||||
reporting_enabled = false;
|
||||
check_for_updates = false;
|
||||
check_for_plugin_updates = false;
|
||||
};
|
||||
};
|
||||
provision = {
|
||||
enable = true;
|
||||
datasources = [
|
||||
datasources.settings.datasources = [
|
||||
{
|
||||
name = "Prometheus";
|
||||
type = "prometheus";
|
||||
|
@ -26,18 +35,17 @@ in
|
|||
}
|
||||
];
|
||||
};
|
||||
analytics.reporting.enable = false;
|
||||
};
|
||||
|
||||
systemd.services.grafana.after = [ "postgresql.service" ];
|
||||
|
||||
services.postgresql = {
|
||||
enable = true;
|
||||
ensureDatabases = [ cfg.database.name ];
|
||||
ensureDatabases = [ cfg.settings.database.name ];
|
||||
ensureUsers = [
|
||||
{
|
||||
name = cfg.database.user;
|
||||
ensurePermissions = { "DATABASE ${cfg.database.name}" = "ALL PRIVILEGES"; };
|
||||
name = cfg.settings.database.user;
|
||||
ensurePermissions = { "DATABASE ${cfg.settings.database.name}" = "ALL PRIVILEGES"; };
|
||||
}
|
||||
];
|
||||
};
|
||||
|
@ -47,7 +55,7 @@ in
|
|||
forceSSL = true;
|
||||
|
||||
locations = {
|
||||
"/".proxyPass = "http://${cfg.addr}:${toString cfg.port}";
|
||||
"/".proxyPass = "http://${cfg.settings.server.http_addr}:${toString cfg.settings.server.http_port}";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ in
|
|||
|
||||
services.hedgedoc = {
|
||||
enable = true;
|
||||
configuration = {
|
||||
settings = {
|
||||
host = "127.0.0.1";
|
||||
port = 3001;
|
||||
db = {
|
||||
|
@ -50,13 +50,13 @@ in
|
|||
};
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"d ${cfg.configuration.uploadsPath} 0700 hedgedoc hedgedoc - -"
|
||||
"d ${cfg.settings.uploadsPath} 0700 hedgedoc hedgedoc - -"
|
||||
];
|
||||
|
||||
services.nginx.virtualHosts."pad.sbruder.de" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
|
||||
locations."/".proxyPass = "http://${cfg.configuration.host}:${toString cfg.configuration.port}";
|
||||
locations."/".proxyPass = "http://${cfg.settings.host}:${toString cfg.settings.port}";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ in
|
|||
group = "signald";
|
||||
};
|
||||
|
||||
systemd.services.signald.serviceConfig.ExecStart = lib.mkForce "${pkgs.unstable.signald}/bin/signald -d /var/lib/signald -s ${config.services.signald.socketPath}";
|
||||
systemd.services.signald.serviceConfig.ExecStart = lib.mkForce "${pkgs.signald}/bin/signald -d /var/lib/signald -s ${config.services.signald.socketPath}";
|
||||
|
||||
services.postgresql = {
|
||||
enable = true;
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
lib.mkIf config.sbruder.gui.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
AusweisApp2
|
||||
];
|
||||
|
||||
# required for SaC (smartphone as cardreader)
|
||||
networking.firewall.allowedUDPPorts = [ 24727 ];
|
||||
programs.ausweisapp = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{ config, lib, options, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Options that affect multiple modules
|
||||
|
@ -122,17 +122,15 @@
|
|||
|
||||
# Allow users to set allow_other for fuse mounts
|
||||
programs.fuse.userAllowOther = true;
|
||||
|
||||
i18n.supportedLocales = (options.i18n.supportedLocales.default) ++ (lib.optionals config.sbruder.full [
|
||||
"de_DE.UTF-8/UTF-8"
|
||||
]);
|
||||
}
|
||||
(lib.mkIf config.sbruder.full {
|
||||
services.fwupd.enable = true;
|
||||
})
|
||||
(lib.mkIf (!config.sbruder.full) {
|
||||
# Adapted from nixpkgs/nixos/modules/profiles/minimal.nix
|
||||
i18n.supportedLocales = map
|
||||
(locale: locale + "/UTF-8")
|
||||
((lib.singleton config.i18n.defaultLocale)
|
||||
++ (lib.attrValues config.i18n.extraLocaleSettings));
|
||||
|
||||
documentation.enable = lib.mkDefault false;
|
||||
})
|
||||
];
|
||||
|
|
|
@ -1,9 +1,74 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
iosevka-sbruder = pkgs.iosevka.override {
|
||||
privateBuildPlan = {
|
||||
family = "Iosevka sbruder";
|
||||
spacing = "normal";
|
||||
serifs = "sans";
|
||||
no-cv-ss = false;
|
||||
export-glyph-names = true;
|
||||
|
||||
variants = {
|
||||
inherits = "ss20";
|
||||
|
||||
design = {
|
||||
capital-g = "toothless-rounded-serifless-hooked";
|
||||
four = "closed";
|
||||
six = "closed-contour";
|
||||
eight = "two-circles";
|
||||
nine = "closed-contour";
|
||||
number-sign = "upright-tall";
|
||||
percent = "dots";
|
||||
lig-ltgteq = "slanted";
|
||||
};
|
||||
};
|
||||
|
||||
weights = {
|
||||
regular = {
|
||||
shape = 400;
|
||||
menu = 400;
|
||||
css = 400;
|
||||
};
|
||||
bold = {
|
||||
shape = 700;
|
||||
menu = 700;
|
||||
css = 700;
|
||||
};
|
||||
};
|
||||
|
||||
slopes = {
|
||||
upright = {
|
||||
angle = 0;
|
||||
shape = "upright";
|
||||
menu = "upright";
|
||||
css = "normal";
|
||||
};
|
||||
italic = {
|
||||
angle = 9.4;
|
||||
shape = "italic";
|
||||
menu = "italic";
|
||||
css = "italic";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
set = "sbruder";
|
||||
};
|
||||
|
||||
iosevka-sbruder-nerd-font = pkgs.runCommand "iosevka-sbruder-nerd-font" { } ''
|
||||
${pkgs.parallel}/bin/parallel \
|
||||
${pkgs.nerd-font-patcher}/bin/nerd-font-patcher \
|
||||
--adjust-line-height \
|
||||
--complete \
|
||||
--careful \
|
||||
--outputdir $out \
|
||||
::: ${iosevka-sbruder}/share/fonts/truetype/*.ttf
|
||||
'';
|
||||
in
|
||||
lib.mkIf config.sbruder.gui.enable {
|
||||
fonts = {
|
||||
fonts = with pkgs; [
|
||||
(nerdfonts.override { fonts = [ "Iosevka" ]; }) # default monospace font
|
||||
iosevka-sbruder-nerd-font
|
||||
] ++ lib.optionals config.sbruder.full [
|
||||
google-fonts # google font collection (free)
|
||||
lmodern # Latin Modern for non-latex applications
|
||||
|
|
|
@ -15,10 +15,12 @@ lib.mkIf config.sbruder.gui.enable {
|
|||
xdg-desktop-portal-wlr
|
||||
xdg-desktop-portal-gtk
|
||||
];
|
||||
gtkUsePortal = true;
|
||||
};
|
||||
};
|
||||
|
||||
# can have side effects (https://github.com/NixOS/nixpkgs/pull/179204)
|
||||
environment.sessionVariables.GTK_USE_PORTAL = "1";
|
||||
|
||||
services.upower.enable = true;
|
||||
|
||||
# steam (and other high quality software) still ships 32 bit binaries
|
||||
|
|
|
@ -21,9 +21,6 @@ let
|
|||
in
|
||||
{
|
||||
nix = {
|
||||
# nix with flake support
|
||||
package = pkgs.nixFlakes;
|
||||
|
||||
registry = with inputs; {
|
||||
nixpkgs.flake = nixpkgs;
|
||||
nixpkgs-unstable.flake = nixpkgs-unstable;
|
||||
|
@ -33,18 +30,20 @@ in
|
|||
"nixpkgs=${inputs.nixpkgs}"
|
||||
"nixpkgs-overlays=${overlaysCompat}"
|
||||
];
|
||||
|
||||
settings = {
|
||||
# Make sudoers trusted nix users
|
||||
trustedUsers = [ "@wheel" ];
|
||||
trusted-users = [ "@wheel" ];
|
||||
|
||||
# On-the-fly optimisation of nix store
|
||||
autoOptimiseStore = true;
|
||||
extraOptions = ''
|
||||
experimental-features = nix-command flakes
|
||||
'' + lib.optionalString config.sbruder.full ''
|
||||
auto-optimise-store = true;
|
||||
|
||||
experimental-features = "nix-command flakes";
|
||||
} // (lib.optionalAttrs config.sbruder.full {
|
||||
# Keep output of derivations with gc root
|
||||
keep-outputs = true
|
||||
keep-derivations = true
|
||||
'';
|
||||
keep-outputs = true;
|
||||
keep-derivations = true;
|
||||
});
|
||||
|
||||
# Make nix build in background less noticeable
|
||||
daemonCPUSchedPolicy = "batch";
|
||||
|
@ -61,6 +60,12 @@ in
|
|||
overlays
|
||||
system;
|
||||
};
|
||||
_2205 = import nixpkgs-2205 {
|
||||
inherit (config.nixpkgs)
|
||||
config
|
||||
overlays
|
||||
system;
|
||||
};
|
||||
})
|
||||
];
|
||||
|
||||
|
|
|
@ -30,24 +30,6 @@ in
|
|||
'';
|
||||
});
|
||||
|
||||
# adapted from https://github.com/NixOS/nixpkgs/pull/85790
|
||||
# TODO: Remove when memtest86+ ≥ 5.31b is in nixpkgs
|
||||
memtest86plus = prev.memtest86plus.overrideAttrs (o: o // rec {
|
||||
version = "5.31b";
|
||||
|
||||
src = prev.fetchurl {
|
||||
url = "https://www.memtest.org/download/${version}/memtest86+-${version}.tar.gz";
|
||||
sha256 = "028zrch87ggajlb5xx1c2ab85ggl9qldpibf45735sy0haqzyiki";
|
||||
};
|
||||
|
||||
NIX_CFLAGS_COMPILE = null;
|
||||
|
||||
buildFlags = [ ];
|
||||
|
||||
doCheck = prev.stdenv.isi686;
|
||||
checkTarget = "run_self_test";
|
||||
});
|
||||
|
||||
vimPlugins = prev.vimPlugins // {
|
||||
# TODO: Remove once (if?) https://github.com/LnL7/vim-nix/pull/28 lands
|
||||
vim-nix = prev.vimPlugins.vim-nix.overrideAttrs (o: {
|
||||
|
|
|
@ -44,7 +44,7 @@ in
|
|||
|
||||
signature.text = signaturePersonal;
|
||||
|
||||
aerc.enable = true;
|
||||
aerc-sbruder.enable = true;
|
||||
mbsync = {
|
||||
enable = true;
|
||||
#flatten = ".";
|
||||
|
@ -79,7 +79,7 @@ in
|
|||
|
||||
signature.text = signaturePersonal;
|
||||
|
||||
aerc.enable = true;
|
||||
aerc-sbruder.enable = true;
|
||||
};
|
||||
tu-dresden = rec {
|
||||
realName = "Simon Bruder";
|
||||
|
@ -106,7 +106,7 @@ in
|
|||
|
||||
signature.text = signaturePersonal;
|
||||
|
||||
aerc.enable = true;
|
||||
aerc-sbruder.enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,23 +1,20 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
package = pkgs.aerc;
|
||||
in
|
||||
|
||||
{
|
||||
options = {
|
||||
accounts.email.accounts = lib.mkOption {
|
||||
type = lib.types.attrsOf (lib.types.submodule {
|
||||
options.aerc.enable = lib.mkEnableOption "aerc";
|
||||
options.aerc-sbruder.enable = lib.mkEnableOption "aerc (custom implementation)";
|
||||
});
|
||||
};
|
||||
};
|
||||
config = {
|
||||
home.packages = [
|
||||
package
|
||||
];
|
||||
programs.aerc = {
|
||||
enable = true;
|
||||
|
||||
xdg.configFile = {
|
||||
"aerc/accounts.conf".text = lib.generators.toINI { } (lib.mapAttrs
|
||||
# incomplete support for all configuration options!
|
||||
extraAccounts =
|
||||
(lib.mapAttrs
|
||||
(name: accountConfig: with accountConfig; let
|
||||
quoteMailAddress = lib.replaceChars [ "@" "\\" ] [ "%40" "%5C" ];
|
||||
# home-manager has no way to set if an account requires AUTH LOGIN
|
||||
|
@ -41,12 +38,12 @@ in
|
|||
from = "${realName} <${address}>";
|
||||
smtp-starttls = if smtp.tls.useStartTls then "yes" else "no";
|
||||
copy-to = "Sent";
|
||||
signature-file = pkgs.writeText "signature-${name}" signature.text;
|
||||
signature-file = toString (pkgs.writeText "signature-${name}" signature.text);
|
||||
pgp-key-id = gpg.key;
|
||||
pgp-auto-sign = gpg.signByDefault;
|
||||
pgp-opportunistic-encrypt = gpg.encryptByDefault;
|
||||
} // (lib.optionalAttrs notmuch.enable {
|
||||
query-map = pkgs.writeText "aerc-query-map" ''
|
||||
query-map = toString (pkgs.writeText "aerc-query-map" ''
|
||||
Archive=not tag:inbox and not tag:sent
|
||||
Git=tag:git
|
||||
INBOX=tag:inbox
|
||||
|
@ -56,7 +53,7 @@ in
|
|||
Trash=tag:deleted
|
||||
eBay Kleinanzeigen=tag:kleinanzeigen
|
||||
eBay=tag:ebay
|
||||
'';
|
||||
'');
|
||||
exclude-tags = lib.concatStringsSep "," [
|
||||
"archived"
|
||||
"deleted"
|
||||
|
@ -64,10 +61,10 @@ in
|
|||
];
|
||||
}))
|
||||
(lib.filterAttrs
|
||||
(_: config: config.aerc.enable)
|
||||
(_: config: config.aerc-sbruder.enable)
|
||||
config.accounts.email.accounts));
|
||||
|
||||
"aerc/aerc.conf".text = lib.generators.toINI { } {
|
||||
extraConfig = {
|
||||
general = {
|
||||
pgp-provider = "gpg"; # internal does not work
|
||||
|
||||
|
@ -124,10 +121,10 @@ in
|
|||
};
|
||||
|
||||
filters = {
|
||||
"subject,~^\\[PATCH" = "awk -f ${package}/share/aerc/filters/hldiff";
|
||||
"subject,~^\\[PATCH" = "awk -f ${pkgs.aerc}/share/aerc/filters/hldiff";
|
||||
"text/plain" = "${./colorize}"; # taken from upstream and patched
|
||||
"text/html" = "html"; # internal filter
|
||||
"text/calendar" = "${pkgs.python3.withPackages (ps: with ps; [ vobject ])}/bin/python ${package}/share/aerc/filters/show-ics-details.py"; # hacky fix for broken nix support
|
||||
"text/calendar" = "${pkgs.python3.withPackages (ps: with ps; [ vobject ])}/bin/python ${pkgs.aerc}/share/aerc/filters/show-ics-details.py"; # hacky fix for broken nix support
|
||||
};
|
||||
|
||||
triggers = {
|
||||
|
@ -137,8 +134,8 @@ in
|
|||
templates = { };
|
||||
};
|
||||
|
||||
"aerc/binds.conf".text = lib.generators.toINIWithGlobalSection { } {
|
||||
globalSection = {
|
||||
extraBinds = {
|
||||
global = {
|
||||
# Binds are of the form <key sequence> = <command to run>
|
||||
# To use '=' in a key sequence, substitute it with "Eq": "<Ctrl+Eq>"
|
||||
# If you wish to bind #, you can wrap the key sequence in quotes: "#" = quit
|
||||
|
@ -147,7 +144,6 @@ in
|
|||
"<C-t>" = ":term<Enter>";
|
||||
};
|
||||
|
||||
sections = {
|
||||
messages = {
|
||||
"q" = ":quit<Enter>";
|
||||
|
||||
|
@ -272,12 +268,9 @@ in
|
|||
"<C-n>" = ":next-tab<Enter>";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
"aerc/stylesets/default".text = lib.concatStrings
|
||||
(lib.mapAttrsToList
|
||||
(k: v: "${k} = ${if lib.isBool v then (if v then "true" else "false") else toString v}\n")
|
||||
{
|
||||
stylesets = {
|
||||
default = {
|
||||
"*.selected.reverse" = true;
|
||||
|
||||
"title.reverse" = true;
|
||||
|
@ -303,7 +296,15 @@ in
|
|||
"tab.fg" = 0;
|
||||
|
||||
"completion_default.bg" = 0;
|
||||
});
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
#quoteMailAddress = lib.replaceChars [ "@" "\\" ] [ "%40" "%5C" ];
|
||||
## home-manager has no way to set if an account requires AUTH LOGIN
|
||||
## this emulats this by setting a list of known providers that do require it
|
||||
#requiresLogin = lib.elem
|
||||
# (lib.elemAt (lib.strings.splitString "@" address) 1)
|
||||
# [ "mailbox.tu-dresden.de" ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ in
|
|||
|
||||
config = {
|
||||
# Main application font
|
||||
osd-font = "Iosevka Nerd Font";
|
||||
osd-font = "monospace";
|
||||
|
||||
# Subtitles (adapted from https://github.com/LightArrowsEXE/dotfiles/blob/75973b6c8493368bbdee6e8e632964045fcf22ec/mpv/.config/mpv/mpv.conf#L76)
|
||||
sub-bold = true;
|
||||
|
|
|
@ -49,19 +49,19 @@ in
|
|||
haskell-language-server
|
||||
rnix-lsp
|
||||
rust-analyzer
|
||||
# very ugly, but required to make non-yapf/autopep8 formatters work
|
||||
((python3.override {
|
||||
packageOverrides = _: prev: {
|
||||
python-lsp-server = prev.python-lsp-server.override {
|
||||
withAutopep8 = false;
|
||||
withYapf = false;
|
||||
};
|
||||
};
|
||||
}).withPackages (ps: with ps; [
|
||||
(python3.withPackages (ps: with ps; [
|
||||
pyls-isort
|
||||
#pylsp-mypy # FIXME
|
||||
pylsp-mypy
|
||||
python-lsp-black
|
||||
python-lsp-server
|
||||
|
||||
# pylsp optional dependencies
|
||||
flake8
|
||||
mccabe
|
||||
pycodestyle
|
||||
pydocstyle
|
||||
pyflakes
|
||||
pylint
|
||||
]))
|
||||
nodePackages."@tailwindcss/language-server"
|
||||
universal-ctags
|
||||
|
@ -83,7 +83,7 @@ in
|
|||
neogit
|
||||
nvim-cmp
|
||||
nvim-lspconfig
|
||||
(nvim-solarized-lua.overrideAttrs (o: o // { patches = (o.patches or [ ]) ++ [ (pkgs.fetchpatch { url = "https://github.com/sbruder/nvim-solarized-lua/commit/1de58a19498097f43f32a91038f6bc3a524e8110.patch"; sha256 = "sha256-r1Q62C7VllYIfbhsNlW26opA98PIwoPz5cvXmbpAOy0="; }) ]; }))
|
||||
nvim-solarized-lua
|
||||
nvim-treesitter
|
||||
nvim-web-devicons
|
||||
plenary-nvim
|
||||
|
@ -91,6 +91,7 @@ in
|
|||
rust-vim
|
||||
tagbar
|
||||
telescope-nvim
|
||||
telescope-ui-select-nvim
|
||||
trouble-nvim
|
||||
vim-fugitive
|
||||
vim-illuminate
|
||||
|
|
|
@ -9,7 +9,7 @@ local map = vim.api.nvim_set_keymap
|
|||
local function noremap(mode, lhs, rhs, opts)
|
||||
local options = { noremap = true }
|
||||
if opts then options = vim.tbl_extend('force', options, opts) end
|
||||
vim.api.nvim_set_keymap(mode, lhs, rhs, options)
|
||||
vim.keymap.set(mode, lhs, rhs, options)
|
||||
end
|
||||
|
||||
local function associate_filetype(glob, ft)
|
||||
|
@ -53,6 +53,7 @@ opt.shiftwidth = 0 -- shift width = tab width
|
|||
opt.joinspaces = false -- no double spaces when joining
|
||||
opt.clipboard = 'unnamedplus' -- use system clipboard
|
||||
opt.modeline = true
|
||||
opt.mouse = ''; -- I want the mouse to only interact with the terminal, not vim
|
||||
|
||||
cmd([[
|
||||
autocmd BufReadPost * if line("'\"") >= 1 && line("'\"") <= line("$") && &ft !~# 'commit' | exe "normal! g`\"" | endif
|
||||
|
@ -174,6 +175,7 @@ require('diffview').setup {}
|
|||
|
||||
-- Fuzzy finder/option picker
|
||||
require('telescope').setup {}
|
||||
require("telescope").load_extension("ui-select")
|
||||
|
||||
-- Completion/Snippets
|
||||
local cmp = require('cmp')
|
||||
|
@ -249,34 +251,31 @@ for type, icon in pairs({ Error = ' ', Warn = ' ', Hint = ' ', Info = '
|
|||
end
|
||||
|
||||
local on_attach = function(client, bufnr)
|
||||
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
|
||||
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
|
||||
|
||||
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
buf_set_keymap('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
|
||||
buf_set_keymap('n', 'gd', '<cmd>lua require("telescope.builtin").lsp_definitions()<CR>', opts)
|
||||
buf_set_keymap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
|
||||
buf_set_keymap('n', 'gi', '<cmd>lua require("telescope.builtin").lsp_implementations()<CR>', opts)
|
||||
buf_set_keymap('n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
|
||||
buf_set_keymap('n', '<Leader>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
|
||||
buf_set_keymap('n', '<Leader>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
|
||||
buf_set_keymap('n', '<Leader>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
|
||||
buf_set_keymap('n', '<Leader>D', '<cmd>lua require("telescope.builtin").lsp_type_definitions()<CR>', opts)
|
||||
buf_set_keymap('n', '<Leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
|
||||
buf_set_keymap('n', '<Leader>ca', '<cmd>lua require("telescope.builtin").lsp_code_actions()<CR>', opts)
|
||||
buf_set_keymap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
|
||||
buf_set_keymap('n', '<Leader>d', '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>', opts)
|
||||
buf_set_keymap('n', '[d', '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', opts)
|
||||
buf_set_keymap('n', ']d', '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>', opts)
|
||||
buf_set_keymap('n', '<Leader>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts)
|
||||
buf_set_keymap('n', '<Leader>f', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts)
|
||||
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts)
|
||||
vim.keymap.set('n', 'gd', require("telescope.builtin").lsp_definitions, opts)
|
||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
|
||||
vim.keymap.set('n', 'gi', require("telescope.builtin").lsp_implementations, opts)
|
||||
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts)
|
||||
vim.keymap.set('n', '<Leader>wa', vim.lsp.buf.add_workspace_folder, opts)
|
||||
vim.keymap.set('n', '<Leader>wr', vim.lsp.buf.remove_workspace_folder, opts)
|
||||
vim.keymap.set('n', '<Leader>wl', function() print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end, opts)
|
||||
vim.keymap.set('n', '<Leader>D', require("telescope.builtin").lsp_type_definitions, opts)
|
||||
vim.keymap.set('n', '<Leader>rn', vim.lsp.buf.rename, opts)
|
||||
vim.keymap.set('n', '<Leader>ca', vim.lsp.buf.code_action, opts)
|
||||
vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts)
|
||||
vim.keymap.set('n', '<Leader>d', vim.diagnostic.open_float, opts)
|
||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
|
||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
|
||||
vim.keymap.set('n', '<Leader>q', vim.diagnostic.setloclist, opts)
|
||||
vim.keymap.set('n', '<Leader>f', function() vim.lsp.buf.format{ async = true } end, opts)
|
||||
|
||||
require('illuminate').on_attach(client)
|
||||
buf_set_keymap('n', '<a-n>', '<cmd>lua require("illuminate").next_reference{wrap=true}<CR>', { noremap = true })
|
||||
buf_set_keymap('n', '<a-p>', '<cmd>lua require("illuminate").next_reference{reverse=true,wrap=true}<CR>', { noremap = true })
|
||||
vim.keymap.set('n', '<a-n>', function() require("illuminate").next_reference{wrap=true} end, opts)
|
||||
vim.keymap.set('n', '<a-p>', function() require("illuminate").next_reference{reverse=true,wrap=true} end, opts)
|
||||
end
|
||||
|
||||
lsp.gopls.setup {
|
||||
|
|
|
@ -151,7 +151,7 @@ in
|
|||
hunspellDicts.de-de
|
||||
hunspellDicts.en-gb-ise # dictionary
|
||||
libreoffice # office suite
|
||||
unstable.rnote # notebook
|
||||
rnote # notebook
|
||||
xournalpp # notebook
|
||||
xsane # scanning tool
|
||||
|
||||
|
|
|
@ -248,23 +248,7 @@ in
|
|||
extraConfig = ''
|
||||
# Cursor
|
||||
seat seat0 xcursor_theme Adwaita
|
||||
'' + (
|
||||
let
|
||||
environmentVariables = lib.concatStringsSep " " [
|
||||
"DBUS_SESSION_BUS_ADDRESS"
|
||||
"DISPLAY"
|
||||
"SWAYSOCK"
|
||||
"WAYLAND_DISPLAY"
|
||||
];
|
||||
in
|
||||
''
|
||||
# From https://github.com/swaywm/sway/wiki#gtk-applications-take-20-seconds-to-start
|
||||
exec systemctl --user import-environment ${environmentVariables} && \
|
||||
hash dbus-update-activation-environment 2>/dev/null && \
|
||||
dbus-update-activation-environment --systemd ${environmentVariables} && \
|
||||
systemctl --user start sway-session.target
|
||||
''
|
||||
) + (lib.optionalString clamshellHack ''
|
||||
'' + (lib.optionalString clamshellHack ''
|
||||
bindswitch --reload --locked lid:on output eDP-1 disable
|
||||
bindswitch --reload --locked lid:off output eDP-1 enable
|
||||
|
||||
|
|
|
@ -8,7 +8,8 @@ in
|
|||
Install.WantedBy = [ "sway-session.target" ];
|
||||
|
||||
Service = {
|
||||
ExecStart = "${pkgs.swaynotificationcenter}/bin/swaync";
|
||||
# FIXME: use new version (currently system style discovery fails)
|
||||
ExecStart = "${pkgs._2205.swaynotificationcenter}/bin/swaync";
|
||||
Restart = "on-failure";
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
* {
|
||||
border-radius: 0;
|
||||
border: none;
|
||||
font-family: "Iosevka Nerd Font";
|
||||
font-family: "monospace";
|
||||
font-size: 12px;
|
||||
min-height: 0;
|
||||
transition-property: none;
|
||||
|
|
|
@ -232,7 +232,7 @@ in
|
|||
|
||||
|
||||
def khal(args):
|
||||
completed = subprocess.run(["khal"] + args, capture_output=True)
|
||||
completed = subprocess.run(["${pkgs.khal}/bin/khal"] + args, capture_output=True)
|
||||
assert completed.returncode == 0
|
||||
return completed.stdout.decode("utf-8")
|
||||
|
||||
|
@ -285,9 +285,9 @@ in
|
|||
dnd-none = "${thinsp}";
|
||||
};
|
||||
return-type = "json";
|
||||
exec = "${pkgs.swaynotificationcenter}/bin/swaync-client -swb";
|
||||
on-click = "${pkgs.swaynotificationcenter}/bin/swaync-client -t -sw";
|
||||
on-click-right = "${pkgs.swaynotificationcenter}/bin/swaync-client -d -sw";
|
||||
exec = "${pkgs._2205.swaynotificationcenter}/bin/swaync-client -swb";
|
||||
on-click = "${pkgs._2205.swaynotificationcenter}/bin/swaync-client -t -sw";
|
||||
on-click-right = "${pkgs._2205.swaynotificationcenter}/bin/swaync-client -d -sw";
|
||||
escape = true;
|
||||
};
|
||||
};
|
||||
|
@ -307,7 +307,8 @@ in
|
|||
Service = {
|
||||
# ensure sway is already started, otherwise workspaces will not work
|
||||
ExecStartPre = "${config.wayland.windowManager.sway.package}/bin/swaymsg";
|
||||
ExecStart = "${pkgs.waybar}/bin/waybar";
|
||||
# FIXME: use new version (currently mpd widget does not toggle playback)
|
||||
ExecStart = "${pkgs._2205.waybar}/bin/waybar";
|
||||
ExecReload = "${pkgs.utillinux}/bin/kill -SIGUSR2 $MAINPID";
|
||||
Restart = "on-failure";
|
||||
RestartSec = "1s";
|
||||
|
|
|
@ -68,7 +68,7 @@ let
|
|||
in
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
unstable.khal
|
||||
khal
|
||||
khard
|
||||
vdirsyncer
|
||||
];
|
||||
|
|
|
@ -1,52 +0,0 @@
|
|||
From 3ded2fd2f67357b986821a36d815853b16c19411 Mon Sep 17 00:00:00 2001
|
||||
From: Simon Bruder <simon@sbruder.de>
|
||||
Date: Tue, 9 Aug 2022 00:55:55 +0200
|
||||
Subject: [PATCH] feat(directory): allow disabling repo integration
|
||||
|
||||
If the directory is a network mount, this can be slowing starship down
|
||||
which makes the shell feel unresponsive.
|
||||
---
|
||||
src/configs/directory.rs | 2 ++
|
||||
src/modules/directory.rs | 6 +++++-
|
||||
2 files changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/configs/directory.rs b/src/configs/directory.rs
|
||||
index 32c72fb6..fce3fd76 100644
|
||||
--- a/src/configs/directory.rs
|
||||
+++ b/src/configs/directory.rs
|
||||
@@ -21,6 +21,7 @@ pub struct DirectoryConfig<'a> {
|
||||
pub truncation_symbol: &'a str,
|
||||
pub home_symbol: &'a str,
|
||||
pub use_os_path_sep: bool,
|
||||
+ pub disable_repo: bool,
|
||||
}
|
||||
|
||||
impl<'a> Default for DirectoryConfig<'a> {
|
||||
@@ -41,6 +42,7 @@ impl<'a> Default for DirectoryConfig<'a> {
|
||||
truncation_symbol: "",
|
||||
home_symbol: "~",
|
||||
use_os_path_sep: true,
|
||||
+ disable_repo: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
diff --git a/src/modules/directory.rs b/src/modules/directory.rs
|
||||
index 873dfde9..03c31314 100644
|
||||
--- a/src/modules/directory.rs
|
||||
+++ b/src/modules/directory.rs
|
||||
@@ -51,7 +51,11 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
|
||||
|
||||
// Attempt repository path contraction (if we are in a git repository)
|
||||
// Otherwise use the logical path, automatically contracting
|
||||
- let repo = context.get_repo().ok();
|
||||
+ let repo = if config.disable_repo {
|
||||
+ None
|
||||
+ } else {
|
||||
+ context.get_repo().ok()
|
||||
+ };
|
||||
let dir_string = if config.truncate_to_repo {
|
||||
repo.and_then(|r| r.workdir.as_ref())
|
||||
.filter(|&root| root != &home_dir)
|
||||
--
|
||||
2.36.0
|
||||
|
|
@ -55,22 +55,10 @@ in
|
|||
nix-direnv = {
|
||||
enable = true;
|
||||
};
|
||||
config = {
|
||||
whitelist = {
|
||||
exact = [
|
||||
"${config.home.homeDirectory}/mounts/.envrc"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
nix-index.enable = true;
|
||||
starship = {
|
||||
enable = true;
|
||||
package = pkgs.starship.overrideAttrs (o: o // {
|
||||
patches = o.patches ++ [
|
||||
./0001-feat-directory-allow-disabling-repo-integration.patch
|
||||
];
|
||||
});
|
||||
settings = {
|
||||
add_newline = false;
|
||||
};
|
||||
|
@ -134,14 +122,4 @@ in
|
|||
];
|
||||
};
|
||||
};
|
||||
|
||||
home.file."mounts/.envrc".text = ''
|
||||
export STARSHIP_CONFIG=${(pkgs.formats.toml { }).generate "starship-config-network" (config.programs.starship.settings // {
|
||||
directory.disable_repo = true; # custom option, patched (see above)
|
||||
git_branch.disabled = true;
|
||||
git_commit.disabled = true;
|
||||
git_state.disabled = true;
|
||||
git_status.disabled = true;
|
||||
})}
|
||||
'';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue