diff --git a/flake-parts/agenix/pubkeys.nix b/flake-parts/agenix/pubkeys.nix index 4cdf567..d31ecdb 100644 --- a/flake-parts/agenix/pubkeys.nix +++ b/flake-parts/agenix/pubkeys.nix @@ -20,7 +20,7 @@ in { common = { }; hosts = { - spinorbundle = { + jetbundle = { users = { root = { sshKey = null; @@ -32,7 +32,19 @@ in }; }; }; - jetbundle = { + remotebundle = { + users = { + root = { + sshKey = null; + authorizedKeys = [ tsandrini ]; # TODO only temporary + }; + tsandrini = { + sshKey = null; + authorizedKeys = [ tsandrini ]; + }; + }; + }; + spinorbundle = { users = { root = { sshKey = null; diff --git a/flake-parts/agenix/secrets/common/accounts/.gitignore b/flake-parts/agenix/secrets/common/accounts/.gitignore new file mode 100644 index 0000000..f935021 --- /dev/null +++ b/flake-parts/agenix/secrets/common/accounts/.gitignore @@ -0,0 +1 @@ +!.gitignore diff --git a/flake-parts/agenix/secrets/hosts/remotebundle/.gitignore b/flake-parts/agenix/secrets/hosts/remotebundle/.gitignore new file mode 100644 index 0000000..f935021 --- /dev/null +++ b/flake-parts/agenix/secrets/hosts/remotebundle/.gitignore @@ -0,0 +1 @@ +!.gitignore diff --git a/flake-parts/agenix/secrets/hosts/remotebundle/mailserver/.gitignore b/flake-parts/agenix/secrets/hosts/remotebundle/mailserver/.gitignore new file mode 100644 index 0000000..f935021 --- /dev/null +++ b/flake-parts/agenix/secrets/hosts/remotebundle/mailserver/.gitignore @@ -0,0 +1 @@ +!.gitignore diff --git a/flake-parts/agenix/secrets/hosts/remotebundle/mailserver/business-at-tsandrini-dot-sh.age b/flake-parts/agenix/secrets/hosts/remotebundle/mailserver/business-at-tsandrini-dot-sh.age new file mode 100644 index 0000000..da11e57 --- /dev/null +++ b/flake-parts/agenix/secrets/hosts/remotebundle/mailserver/business-at-tsandrini-dot-sh.age @@ -0,0 +1,7 @@ +age-encryption.org/v1 +-> ssh-ed25519 VC7Vrg QBdkTElx5B7UJbRLJryMBelgcfbbLWjQ66uo/cP75Xc +KPwr0L4lhnqdgFETgnXRcR4obsFhHw9Z2Q5kCZHYNvY +-> ssh-ed25519 ot5CBw /EBGKeVVExrU7unhMlSi9XLTFT7Q9OCb6bzSWoctDms +kNPifrDnr//9s2CkQrGW7MnsDxCPazdP+0B7KWN4tEE +--- Mg0HNjPuweKGtQB7qDmcv72nu0XCwGgANxAwZTvluUA +͓@ƭ#p\4NʋXqoG`$IC<#8qBS4֜s}?fIWa`;uPp,ŕ \ No newline at end of file diff --git a/flake-parts/agenix/secrets/hosts/remotebundle/mailserver/newsletters-at-tsandrini-dot-sh.age b/flake-parts/agenix/secrets/hosts/remotebundle/mailserver/newsletters-at-tsandrini-dot-sh.age new file mode 100644 index 0000000..0a25e87 --- /dev/null +++ b/flake-parts/agenix/secrets/hosts/remotebundle/mailserver/newsletters-at-tsandrini-dot-sh.age @@ -0,0 +1,7 @@ +age-encryption.org/v1 +-> ssh-ed25519 VC7Vrg xwjduHgvA9qB/rnt8WUJlYFAunVRLaLThCi1d5vpWRs +0Zq53bCsAykmmVdqJixG3y14ZYMLAQ32liyb2vWgijQ +-> ssh-ed25519 ot5CBw S51ufa0rNr1ICYeMd0549w4sAFzvn/lryBBwvY3r81U ++Gue9DkZ4NKHTdB761GKS2VPyWv4laK5OPmSPHuZ/ig +--- ZgQ80KCXT0J6ySFK02R5XYfY3/yLjDCZ7JJWHZcBEXU +L&"1-t>DWԊ9H̋1N#.CQKr[ u6lj;4Qy{T$wJd| \ No newline at end of file diff --git a/flake-parts/agenix/secrets/hosts/remotebundle/mailserver/rspamd-ui-basic-auth-file.age b/flake-parts/agenix/secrets/hosts/remotebundle/mailserver/rspamd-ui-basic-auth-file.age new file mode 100644 index 0000000..6d298a4 --- /dev/null +++ b/flake-parts/agenix/secrets/hosts/remotebundle/mailserver/rspamd-ui-basic-auth-file.age @@ -0,0 +1,7 @@ +age-encryption.org/v1 +-> ssh-ed25519 VC7Vrg rs7sbkHH5xXcBUuTrWp9w9F5og4QprI6lOVOEtcnTAg +EZT3LsbbbURq1seuPFhXPe+geTkMxddC5TTsKJ7XwBU +-> ssh-ed25519 ot5CBw 6l/BC/jiR9qnY/3OHO64JTElCf2Yrgpw5RySUFlHzTw +qi1joDDl7LdPelfadyHYeSfNgxMcMVo5czhqSfYUcnA +--- JXgzf+gpglI8cPiNqERMkx4kviBmsfaBBlYnkC4wLps +*[ݨndIFK pvr0GP/*QMb! ?c&#UHc{0} \ No newline at end of file diff --git a/flake-parts/agenix/secrets/hosts/remotebundle/mailserver/security-at-tsandrini-dot-sh.age b/flake-parts/agenix/secrets/hosts/remotebundle/mailserver/security-at-tsandrini-dot-sh.age new file mode 100644 index 0000000..6c63182 Binary files /dev/null and b/flake-parts/agenix/secrets/hosts/remotebundle/mailserver/security-at-tsandrini-dot-sh.age differ diff --git a/flake-parts/agenix/secrets/hosts/remotebundle/mailserver/shopping-at-tsandrini-dot-sh.age b/flake-parts/agenix/secrets/hosts/remotebundle/mailserver/shopping-at-tsandrini-dot-sh.age new file mode 100644 index 0000000..1b70825 --- /dev/null +++ b/flake-parts/agenix/secrets/hosts/remotebundle/mailserver/shopping-at-tsandrini-dot-sh.age @@ -0,0 +1,7 @@ +age-encryption.org/v1 +-> ssh-ed25519 VC7Vrg rNFErBgckTPtjQXLomAQbzCA/JuzXdzZdovhaTSxtH4 +U1Mkef8SBnmj7OHcsmKFdn6RzP9MleU7r/KEwW7GEyQ +-> ssh-ed25519 ot5CBw K8CVm27rEoa8BLiCGuTxiGBSlajHrdGGWkInM11980Q +3jeWAx2o36/o9G8pZDCd+Cltperrb30mGZ+6aXACTVo +--- BB156ALXxwovqjSrMHexoH9nUH4FrXP9VjwPLeav2zA +I;6(u+R&$ͱeSTUrѡe\-L2iV{@8Sw,!*;xDܒ]OY tF \ No newline at end of file diff --git a/flake-parts/agenix/secrets/hosts/remotebundle/mailserver/t-at-tsandrini-dot-sh.age b/flake-parts/agenix/secrets/hosts/remotebundle/mailserver/t-at-tsandrini-dot-sh.age new file mode 100644 index 0000000..402b831 --- /dev/null +++ b/flake-parts/agenix/secrets/hosts/remotebundle/mailserver/t-at-tsandrini-dot-sh.age @@ -0,0 +1,9 @@ +age-encryption.org/v1 +-> ssh-ed25519 VC7Vrg KO5d1yBJ/6elSFbGj2FoZdXemkS+yrhO/WtJ7tc5rxA +DPDjx17STuqPnh3B2JGyJdgHja/CQFdbZx/gst5pX2I +-> ssh-ed25519 ot5CBw 2/w45PxxUxyDtpJEPRp2id+DV9hIzxRvanhUuVILjXU +92usHhhiELZ87pC45SCaACe/P1NWsvoLP96zCmaX+44 +--- 16gFn3fp+ZgNNnQazxIXGRP1UjRMwvAzFbx59VMGTzw +p(+?2ţOZp? +i2 +Xrѽu1b@$ٵ;j 6g]t?W\BsBhA \ No newline at end of file diff --git a/flake-parts/agenix/secrets/hosts/remotebundle/users/.gitignore b/flake-parts/agenix/secrets/hosts/remotebundle/users/.gitignore new file mode 100644 index 0000000..f935021 --- /dev/null +++ b/flake-parts/agenix/secrets/hosts/remotebundle/users/.gitignore @@ -0,0 +1 @@ +!.gitignore diff --git a/flake-parts/agenix/secrets/hosts/remotebundle/users/root/.gitignore b/flake-parts/agenix/secrets/hosts/remotebundle/users/root/.gitignore new file mode 100644 index 0000000..f935021 --- /dev/null +++ b/flake-parts/agenix/secrets/hosts/remotebundle/users/root/.gitignore @@ -0,0 +1 @@ +!.gitignore diff --git a/flake-parts/agenix/secrets/hosts/remotebundle/users/root/system-password.age b/flake-parts/agenix/secrets/hosts/remotebundle/users/root/system-password.age new file mode 100644 index 0000000..fff108e Binary files /dev/null and b/flake-parts/agenix/secrets/hosts/remotebundle/users/root/system-password.age differ diff --git a/flake-parts/agenix/secrets/hosts/remotebundle/users/tsandrini/.gitignore b/flake-parts/agenix/secrets/hosts/remotebundle/users/tsandrini/.gitignore new file mode 100644 index 0000000..f935021 --- /dev/null +++ b/flake-parts/agenix/secrets/hosts/remotebundle/users/tsandrini/.gitignore @@ -0,0 +1 @@ +!.gitignore diff --git a/flake-parts/agenix/secrets/hosts/remotebundle/users/tsandrini/system-password.age b/flake-parts/agenix/secrets/hosts/remotebundle/users/tsandrini/system-password.age new file mode 100644 index 0000000..251cd21 --- /dev/null +++ b/flake-parts/agenix/secrets/hosts/remotebundle/users/tsandrini/system-password.age @@ -0,0 +1,8 @@ +age-encryption.org/v1 +-> ssh-ed25519 VC7Vrg MkIFJeCqC29p5GGhwY8t1+UH3RfEx1DZQF00itO/fwI +H4V9M26b+fWROM55DQ5+ls2oKYW0GL0TwHsdC5qmg7M +-> ssh-ed25519 ot5CBw Ce0eSEEroygi+HflxpEpfvR1CEdAUf2rLpeaMn98UwI ++WXB9HFmGYK2CITBzGYB/11Fgonahe/l3SACSmI0ZpI +--- 9m5BGUCBO+CiHTtnBJR6mfaB6WdwtlZYdNpxFxCtXts +`U;W_J uCe 4nEV=j8ZW/dЧa"QrjW=طM +΀뜂h0r9ζE 뺽'iOI֚iȒI(!- Xkdq )W \ No newline at end of file diff --git a/flake-parts/agenix/secrets/secrets.nix b/flake-parts/agenix/secrets/secrets.nix index 387b67a..24d52bb 100644 --- a/flake-parts/agenix/secrets/secrets.nix +++ b/flake-parts/agenix/secrets/secrets.nix @@ -15,27 +15,52 @@ let spinorbundle = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH1693g0EVyChehwAjJqkKLWD8ZysLbo9TbRZ2B9BcKe root@spinorbundle"; jetbundle = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAQpLfZTRGfeVkh0tTCZ7Ads5fwYnl3cIj34Fukkymhp root@jetbundle"; - # hosts = [jetbundle spinorbundle]; + remotebundle = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA/zORD7glqIeAJNnoW7PFKmZV1eJr46glrSvFDyWH2/ root@nixos"; tsandrini = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDWrK27cm+rAVKuwDjlJgCuy8Rftg2YOALwtnu7z3Ox1 tsandrini"; in -# users = [tsandrini]; { # ---------- # | COMMON | # ---------- + # "common/accounts/tomas-dot-sandrini-at-seznam-dot-cz.age".publicKeys = [ tsandrini ]; + # "common/accounts/wareczech-at-gmail-dot-com.age".publicKeys = [ tsandrini ]; # --------- # | HOSTS | # --------- - # I. #spinorbundle + # jetbundle + "hosts/jetbundle/users/root/system-password.age".publicKeys = [ jetbundle ] ++ [ tsandrini ]; + "hosts/jetbundle/users/tsandrini/system-password.age".publicKeys = [ jetbundle ] ++ [ tsandrini ]; + + # remotebundle + "hosts/remotebundle/users/root/system-password.age".publicKeys = [ remotebundle ] ++ [ tsandrini ]; + "hosts/remotebundle/users/tsandrini/system-password.age".publicKeys = [ + remotebundle + ] ++ [ tsandrini ]; + "hosts/remotebundle/mailserver/t-at-tsandrini-dot-sh.age".publicKeys = [ + remotebundle + ] ++ [ tsandrini ]; + "hosts/remotebundle/mailserver/business-at-tsandrini-dot-sh.age".publicKeys = [ + remotebundle + ] ++ [ tsandrini ]; + "hosts/remotebundle/mailserver/security-at-tsandrini-dot-sh.age".publicKeys = [ + remotebundle + ] ++ [ tsandrini ]; + "hosts/remotebundle/mailserver/shopping-at-tsandrini-dot-sh.age".publicKeys = [ + remotebundle + ] ++ [ tsandrini ]; + "hosts/remotebundle/mailserver/newsletters-at-tsandrini-dot-sh.age".publicKeys = [ + remotebundle + ] ++ [ tsandrini ]; + "hosts/remotebundle/mailserver/rspamd-ui-basic-auth-file.age".publicKeys = [ + remotebundle + ] ++ [ tsandrini ]; + + # spinorbundle "hosts/spinorbundle/users/root/system-password.age".publicKeys = [ spinorbundle ] ++ [ tsandrini ]; "hosts/spinorbundle/users/tsandrini/system-password.age".publicKeys = [ spinorbundle ] ++ [ tsandrini ]; - - # II. #jetbundle - "hosts/jetbundle/users/root/system-password.age".publicKeys = [ jetbundle ] ++ [ tsandrini ]; - "hosts/jetbundle/users/tsandrini/system-password.age".publicKeys = [ jetbundle ] ++ [ tsandrini ]; } diff --git a/flake-parts/deploy-rs/default.nix b/flake-parts/deploy-rs/default.nix new file mode 100644 index 0000000..87587e5 --- /dev/null +++ b/flake-parts/deploy-rs/default.nix @@ -0,0 +1,39 @@ +# --- flake-parts/deploy-rs/default.nix +# +# Author: tsandrini +# URL: https://github.com/tsandrini/tensorfiles +# License: MIT +# +# 888 .d888 d8b 888 +# 888 d88P" Y8P 888 +# 888 888 888 +# 888888 .d88b. 88888b. .d8888b .d88b. 888d888 888888 888 888 .d88b. .d8888b +# 888 d8P Y8b 888 "88b 88K d88""88b 888P" 888 888 888 d8P Y8b 88K +# 888 88888888 888 888 "Y8888b. 888 888 888 888 888 888 88888888 "Y8888b. +# Y88b. Y8b. 888 888 X88 Y88..88P 888 888 888 888 Y8b. X88 +# "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' +{ inputs, config, ... }: +let + inherit (inputs) deploy-rs; +in +{ + + flake.deploy.nodes = { + "remotebundle" = { + hostname = "37.205.15.242"; + + profiles.system = { + user = "root"; + sshUser = "tsandrini"; # TODO only for now + autoRollback = true; + magicRollback = true; + + path = deploy-rs.lib.x86_64-linux.activate.nixos config.flake.nixosConfigurations."remotebundle"; + }; + }; + }; + + flake.checks = builtins.mapAttrs ( + _system: deployLib: deployLib.deployChecks config.flake.deploy + ) deploy-rs.lib; +} diff --git a/flake-parts/homes/tsandrini@jetbundle/default.nix b/flake-parts/homes/tsandrini@jetbundle/default.nix index e44bef3..1cb5f39 100644 --- a/flake-parts/homes/tsandrini@jetbundle/default.nix +++ b/flake-parts/homes/tsandrini@jetbundle/default.nix @@ -44,7 +44,7 @@ home.packages = with pkgs; [ thunderbird # A full-featured e-mail client - beeper # Universal chat app. + # beeper # Universal chat app. armcord # Lightweight, alternative desktop client for Discord anki # Spaced repetition flashcard program libreoffice # Comprehensive, professional-quality productivity suite, a variant of openoffice.org diff --git a/flake-parts/hosts/default.nix b/flake-parts/hosts/default.nix index ae73bc2..532350a 100644 --- a/flake-parts/hosts/default.nix +++ b/flake-parts/hosts/default.nix @@ -20,6 +20,8 @@ ... }: let + inherit (inputs.flake-parts.lib) importApply; + mkHost = args: hostName: { @@ -27,6 +29,9 @@ let extraModules ? [ ], extraOverlays ? [ ], withHomeManager ? false, + hostImportArgs ? { + inherit inputs; + }, ... }: let @@ -48,7 +53,7 @@ let nixpkgs.config.allowUnfree = true; networking.hostName = hostName; } - ./${hostName} + (importApply ./${hostName} hostImportArgs) ] ++ extraModules # Disabled by default, therefore load every module and enable via attributes @@ -74,37 +79,58 @@ let in { flake.nixosConfigurations = { - spinorbundle = withSystem "x86_64-linux" ( + jetbundle = withSystem "x86_64-linux" ( args: - mkHost args "spinorbundle" { + mkHost args "jetbundle" { withHomeManager = true; extraOverlays = with inputs; [ nix-topology.overlays.default - neovim-nightly-overlay.overlays.default emacs-overlay.overlays.default nur.overlay + # neovim-nightly-overlay.overlays.default # (final: _prev: { nur = import inputs.nur { pkgs = final; }; }) ]; extraModules = with inputs; [ nur.nixosModules.nur - # nix-topology.nixosModules.default + nix-topology.nixosModules.default + # TODO remove when available https://github.com/NixOS/nixpkgs/pull/334638 + { nixpkgs.config.permittedInsecurePackages = [ "olm-3.2.16" ]; } ]; } ); - jetbundle = withSystem "x86_64-linux" ( + remotebundle = withSystem "x86_64-linux" ( args: - mkHost args "jetbundle" { + mkHost args "remotebundle" { + withHomeManager = true; + extraOverlays = with inputs; [ + nix-topology.overlays.default + # nur.overlay + # neovim-nightly-overlay.overlays.default + ]; + extraModules = with inputs; [ + nix-topology.nixosModules.default + # nur.nixosModules.nur + # TODO remove when available https://github.com/NixOS/nixpkgs/pull/334638 + { nixpkgs.config.permittedInsecurePackages = [ "olm-3.2.16" ]; } + ]; + } + ); + spinorbundle = withSystem "x86_64-linux" ( + args: + mkHost args "spinorbundle" { withHomeManager = true; extraOverlays = with inputs; [ nix-topology.overlays.default - neovim-nightly-overlay.overlays.default emacs-overlay.overlays.default nur.overlay + # neovim-nightly-overlay.overlays.default # (final: _prev: { nur = import inputs.nur { pkgs = final; }; }) ]; extraModules = with inputs; [ nur.nixosModules.nur - # nix-topology.nixosModules.default + nix-topology.nixosModules.default + # TODO remove when available https://github.com/NixOS/nixpkgs/pull/334638 + { nixpkgs.config.permittedInsecurePackages = [ "olm-3.2.16" ]; } ]; } ); diff --git a/flake-parts/hosts/jetbundle/default.nix b/flake-parts/hosts/jetbundle/default.nix index db48ae7..80fc047 100644 --- a/flake-parts/hosts/jetbundle/default.nix +++ b/flake-parts/hosts/jetbundle/default.nix @@ -12,7 +12,8 @@ # 888 88888888 888 888 "Y8888b. 888 888 888 888 888 888 88888888 "Y8888b. # Y88b. Y8b. 888 888 X88 Y88..88P 888 888 888 888 Y8b. X88 # "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' -{ pkgs, inputs, ... }: +{ inputs }: +{ pkgs, ... }: { # ----------------- # | SPECIFICATION | @@ -65,6 +66,11 @@ programs.shadow-nix.enable = true; tasks.system-autoupgrade.enable = false; + # Use the `nh` garbage collect to also collect .direnv and XDG profiles + # roots instead of the default ones. + tasks.nix-garbage-collect.enable = false; + programs.nh.enable = true; + system.users.usersSettings."root" = { agenixPassword.enable = true; }; @@ -83,16 +89,22 @@ }; }; - # Use the `nh` garbage collect to also collect .direnv and XDG profiles - # roots instead of the default ones. - tensorfiles.tasks.nix-garbage-collect.enable = false; - tensorfiles.programs.nh.enable = true; # TODO maybe use github:tsandrini/tensorfiles instead? programs.nh.flake = "/home/tsandrini/ProjectBundle/tsandrini/tensorfiles"; programs.shadow-client.forceDriver = "iHD"; - programs.zsh.enable = true; - users.defaultUserShell = pkgs.zsh; + programs.fish.enable = true; + users.defaultUserShell = pkgs.bash; + + programs.bash = { + interactiveShellInit = '' + if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]] + then + shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION="" + exec ${pkgs.fish}/bin/fish $LOGIN_OPTION + fi + ''; + }; programs.winbox.enable = true; @@ -107,8 +119,6 @@ }; # programs.steam.enable = true; # just trying it out - - networking.networkmanager.enable = true; networking.networkmanager.enableStrongSwan = true; services.xl2tpd.enable = true; services.strongswan = { @@ -140,6 +150,7 @@ tensorfiles.hm = { profiles.graphical-plasma.enable = true; + profiles.accounts.tsandrini.enable = true; security.agenix.enable = true; programs.pywal.enable = true; @@ -164,7 +175,7 @@ home.packages = with pkgs; [ thunderbird # A full-featured e-mail client - beeper # Universal chat app. + # beeper # Universal chat app. anki # Spaced repetition flashcard program libreoffice # Comprehensive, professional-quality productivity suite, a variant of openoffice.org texlive.combined.scheme-full # TeX Live environment @@ -173,6 +184,7 @@ ungoogled-chromium # An open source web browser from Google, with dependencies on Google web services removed zoom-us # Player for Z-Code, TADS and HUGO stories or games vesktop # Alternate client for Discord with Vencord built-in + gnucash # Free software for double entry accounting slack # Desktop client for Slack signal-desktop # Private, simple, and secure messenger diff --git a/flake-parts/hosts/remotebundle/.gitignore b/flake-parts/hosts/remotebundle/.gitignore new file mode 100644 index 0000000..f935021 --- /dev/null +++ b/flake-parts/hosts/remotebundle/.gitignore @@ -0,0 +1 @@ +!.gitignore diff --git a/flake-parts/hosts/remotebundle/default.nix b/flake-parts/hosts/remotebundle/default.nix new file mode 100644 index 0000000..43d5fef --- /dev/null +++ b/flake-parts/hosts/remotebundle/default.nix @@ -0,0 +1,129 @@ +# --- flake-parts/hosts/remotebundle/default.nix +# +# Author: tsandrini +# URL: https://github.com/tsandrini/tensorfiles +# License: MIT +# +# 888 .d888 d8b 888 +# 888 d88P" Y8P 888 +# 888 888 888 +# 888888 .d88b. 88888b. .d8888b .d88b. 888d888 888888 888 888 .d88b. .d8888b +# 888 d8P Y8b 888 "88b 88K d88""88b 888P" 888 888 888 d8P Y8b 88K +# 888 88888888 888 888 "Y8888b. 888 888 888 888 888 888 88888888 "Y8888b. +# Y88b. Y8b. 888 888 X88 Y88..88P 888 888 888 888 Y8b. X88 +# "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' +{ inputs }: +{ pkgs, ... }: +{ + # ----------------- + # | SPECIFICATION | + # ----------------- + # Model: Lenovo B51-80 + + # -------------------------- + # | ROLES & MODULES & etc. | + # -------------------------- + imports = with inputs; [ (vpsadminos + "/os/lib/nixos-container/vpsadminos.nix") ]; + + # ------------------------------ + # | ADDITIONAL SYSTEM PACKAGES | + # ------------------------------ + environment.systemPackages = with pkgs; [ ]; + + # ---------------------------- + # | ADDITIONAL USER PACKAGES | + # ---------------------------- + # home-manager.users.${user} = {home.packages = with pkgs; [];}; + + # --------------------- + # | ADDITIONAL CONFIG | + # --------------------- + + tensorfiles = { + profiles.headless.enable = true; + profiles.packages-extra.enable = true; + + services.mailserver.enable = true; + services.mailserver.roundcube.enable = true; + services.mailserver.rspamd-ui.enable = true; + + services.networking.networkmanager.enable = false; + security.agenix.enable = true; + tasks.system-autoupgrade.enable = false; + + # Use the `nh` garbage collect to also collect .direnv and XDG profiles + # roots instead of the default ones. + tasks.nix-garbage-collect.enable = false; + programs.nh.enable = true; + + system.users.usersSettings."root" = { + agenixPassword.enable = true; + }; + system.users.usersSettings."tsandrini" = { + isSudoer = true; + isNixTrusted = true; + agenixPassword.enable = true; + extraGroups = [ "input" ]; + }; + }; + + programs.fish.enable = true; + users.defaultUserShell = pkgs.bash; + + programs.bash = { + interactiveShellInit = '' + if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]] + then + shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION="" + exec ${pkgs.fish}/bin/fish $LOGIN_OPTION + fi + ''; + }; + + networking.firewall = { + allowedTCPPorts = [ + 80 + 443 + ]; + }; + + # services.caddy = { + # enable = true; + # virtualHosts."tsandrini.sh".extraConfig = '' + # encode gzip + # file_server + # root * ${ + # pkgs.runCommand "testdir" { } '' + # mkdir "$out" + # echo hello world > "$out/index.html" + # '' + # } + # ''; + # }; + + # services.openssh.settings.permitrootlogin = "yes"; + #users.extrausers.root.openssh.authorizedkeys.keys = + # [ "..." ]; + + systemd.extraConfig = '' + DefaultTimeoutStartSec=900s + ''; + + home-manager.users."tsandrini" = { + tensorfiles.hm = { + + profiles.headless.enable = true; + security.agenix.enable = true; + }; + + home.username = "tsandrini"; + home.homeDirectory = "/home/tsandrini"; + home.sessionVariables = { + DEFAULT_USERNAME = "tsandrini"; + DEFAULT_MAIL = "tomas.sandrini@seznam.cz"; + }; + programs.git.signing.key = "3E83AD690FA4F657"; + + home.packages = with pkgs; [ ]; + }; +} diff --git a/flake-parts/hosts/spinorbundle/default.nix b/flake-parts/hosts/spinorbundle/default.nix index 6568f14..e5e269b 100644 --- a/flake-parts/hosts/spinorbundle/default.nix +++ b/flake-parts/hosts/spinorbundle/default.nix @@ -12,12 +12,8 @@ # 888 88888888 888 888 "Y8888b. 888 888 888 888 888 888 88888888 "Y8888b. # Y88b. Y8b. 888 888 X88 Y88..88P 888 888 888 888 Y8b. X88 # "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' -{ - pkgs, - inputs, - system, - ... -}: +{ inputs }: +{ pkgs, system, ... }: { # ----------------- # | SPECIFICATION | @@ -92,8 +88,18 @@ programs.nh.flake = "/home/tsandrini/ProjectBundle/tsandrini/tensorfiles"; programs.shadow-client.forceDriver = "iHD"; - programs.zsh.enable = true; - users.defaultUserShell = pkgs.zsh; + programs.fish.enable = true; + users.defaultUserShell = pkgs.bash; + + programs.bash = { + interactiveShellInit = '' + if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]] + then + shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION="" + exec ${pkgs.fish}/bin/fish $LOGIN_OPTION + fi + ''; + }; programs.winbox.enable = true; @@ -146,7 +152,7 @@ # programs.spicetify.enable = true; # services.pywalfox-native.enable = true; services.keepassxc.enable = true; - services.activitywatch.enable = true; + # services.activitywatch.enable = true; }; services.syncthing = { @@ -164,7 +170,7 @@ home.packages = with pkgs; [ thunderbird # A full-featured e-mail client - beeper # Universal chat app. + # beeper # Universal chat app. anki # Spaced repetition flashcard program libreoffice # Comprehensive, professional-quality productivity suite, a variant of openoffice.org texlive.combined.scheme-full # TeX Live environment diff --git a/flake-parts/lib/default.nix b/flake-parts/lib/default.nix index caf4cc1..8a22fb6 100644 --- a/flake-parts/lib/default.nix +++ b/flake-parts/lib/default.nix @@ -23,5 +23,6 @@ inherit (attrsets) mapFilterAttrs; }; options = import ./options.nix { inherit lib; }; + strings = import ./strings.nix { inherit lib; }; }; } diff --git a/flake-parts/lib/maintainers.nix b/flake-parts/lib/maintainers.nix index 9b0a721..b5b70f4 100644 --- a/flake-parts/lib/maintainers.nix +++ b/flake-parts/lib/maintainers.nix @@ -15,7 +15,7 @@ _: { # tsandrini, owner of this repo tsandrini = { - email = "tomas.sandrini@seznam.cz"; + email = "t@tsandrini.sh"; name = "Tomáš Sandrini"; github = "tsandrini"; githubId = 21975189; diff --git a/flake-parts/lib/modules.nix b/flake-parts/lib/modules.nix index d6d0d7f..2dd2cec 100644 --- a/flake-parts/lib/modules.nix +++ b/flake-parts/lib/modules.nix @@ -23,6 +23,22 @@ rec { # mkForce = 50: # mkVMOverride = 10: used by ‘nixos-rebuild build-vm’ + /* + mkOverride function with a preset priority set for all of the + home-manager modules. + + *Type*: `mkOverrideAtModuleLevel :: AttrSet a -> { _type :: String; priority :: Int; content :: AttrSet a; }` + */ + mkOverrideAtNixvimModuleLevel = mkOverride 900; + + /* + mkOverride function with a preset priority set for all of the + home-manager profile modules. + + *Type*: `mkOverrideAtNixvimProfileLevel :: AttrSet a -> { _type :: String; priority :: Int; content :: AttrSet a; }` + */ + mkOverrideAtNixvimProfileLevel = mkOverride 800; + /* mkOverride function with a preset priority set for all of the home-manager modules. diff --git a/flake-parts/lib/options.nix b/flake-parts/lib/options.nix index ca31a92..11a899a 100644 --- a/flake-parts/lib/options.nix +++ b/flake-parts/lib/options.nix @@ -144,4 +144,32 @@ with builtins; Enables doing module level configurations via simple attrsets. ''; }; + + mkSubmodulesOption = + # (String -> AttrSet a) Function that, given a submodule name, yields all of the submodule related options for that given submodule + generatorFunction: + mkOption { + type = attrsOf ( + submodule ( + { name, ... }: + { + options = generatorFunction name; + } + ) + ); + default = { }; + example = { + "mySubmoduleKey" = { + myOption = false; + otherOption.name = "test1"; + }; + # just initialize the defaults + "myOtherSubmoduleKey" = { }; + }; + description = '' + Submodules configuration option submodule. + Enables doing module level configurations via simple attrsets. + ''; + }; + } diff --git a/flake-parts/lib/strings.nix b/flake-parts/lib/strings.nix new file mode 100644 index 0000000..9c100d8 --- /dev/null +++ b/flake-parts/lib/strings.nix @@ -0,0 +1,31 @@ +# --- flake-parts/lib/strings.nix +# +# Author: tsandrini +# URL: https://github.com/tsandrini/tensorfiles +# License: MIT +# +# 888 .d888 d8b 888 +# 888 d88P" Y8P 888 +# 888 888 888 +# 888888 .d88b. 88888b. .d8888b .d88b. 888d888 888888 888 888 .d88b. .d8888b +# 888 d8P Y8b 888 "88b 88K d88""88b 888P" 888 888 888 d8P Y8b 88K +# 888 88888888 888 888 "Y8888b. 888 888 888 888 888 888 88888888 "Y8888b. +# Y88b. Y8b. 888 888 X88 Y88..88P 888 888 888 888 Y8b. X88 +# "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' +{ lib }: +{ + sanitizeEmailForNixStorePath = + email: + let + lower = lib.strings.toLower email; + replaceAt = lib.strings.replaceStrings [ "@" ] [ "-at-" ]; + replaceDot = lib.strings.replaceStrings [ "." ] [ "-dot-" ]; + removeInvalid = + str: + lib.strings.concatStrings ( + lib.lists.filter (c: lib.strings.match "[a-z0-9_-]" c != null) (lib.strings.stringToCharacters str) + ); + in + removeInvalid (replaceDot (replaceAt lower)); + +} diff --git a/flake-parts/modules/home-manager/default.nix b/flake-parts/modules/home-manager/default.nix index f0d21d1..43dfec5 100644 --- a/flake-parts/modules/home-manager/default.nix +++ b/flake-parts/modules/home-manager/default.nix @@ -20,12 +20,13 @@ ... }: let + inherit (lib) mkOption types; inherit (inputs.flake-parts.lib) importApply; localFlake = self; in { - options.flake.homeModules = lib.mkOption { - type = with lib.types; lazyAttrsOf unspecified; + options.flake.homeModules = mkOption { + type = types.lazyAttrsOf types.unspecified; default = { }; }; @@ -39,6 +40,10 @@ in misc_xdg = importApply ./misc/xdg.nix { inherit localFlake; }; # -- profiles -- + profiles_accounts_tsandrini = importApply ./profiles/accounts/tsandrini.nix { + inherit localFlake; + inherit (config.agenix) secretsPath; + }; profiles_base = importApply ./profiles/base.nix { inherit localFlake; }; profiles_graphical-plasma = importApply ./profiles/graphical-plasma { inherit localFlake inputs; }; profiles_graphical-xmonad = importApply ./profiles/graphical-xmonad.nix { inherit localFlake; }; @@ -54,7 +59,7 @@ in programs_editors_emacs-doom = importApply ./programs/editors/emacs-doom.nix { inherit localFlake inputs; }; - programs_editors_neovim = importApply ./programs/editors/neovim.nix { inherit localFlake inputs; }; + programs_editors_neovim = importApply ./programs/editors/neovim.nix { inherit localFlake; }; programs_file-managers_lf = importApply ./programs/file-managers/lf { inherit localFlake; }; programs_file-managers_yazi = importApply ./programs/file-managers/yazi.nix { inherit localFlake; }; programs_git = importApply ./programs/git.nix { inherit localFlake; }; @@ -63,6 +68,7 @@ in programs_pywal = importApply ./programs/pywal.nix { inherit localFlake; }; programs_shadow-nix = importApply ./programs/shadow-nix.nix { inherit localFlake inputs; }; programs_shells_zsh = importApply ./programs/shells/zsh { inherit localFlake; }; + programs_shells_fish = importApply ./programs/shells/fish.nix { inherit localFlake; }; # programs_spicetify = importApply ./programs/spicetify.nix { inherit localFlake inputs; }; programs_ssh = importApply ./programs/ssh.nix { inherit (config.agenix) secretsPath pubkeys; @@ -71,7 +77,8 @@ in programs_terminals_alacritty = importApply ./programs/terminals/alacritty.nix { inherit localFlake; }; - programs_terminals_kitty = importApply ./programs/terminals/kitty.nix { + programs_terminals_kitty = importApply ./programs/terminals/kitty.nix { inherit localFlake; }; + programs_terminals_wezterm = importApply ./programs/terminals/wezterm.nix { inherit localFlake inputs; }; programs_thunderbird = importApply ./programs/thunderbird.nix { inherit localFlake; }; diff --git a/flake-parts/modules/home-manager/hardware/nixGL.nix b/flake-parts/modules/home-manager/hardware/nixGL.nix index 00e2422..5425991 100644 --- a/flake-parts/modules/home-manager/hardware/nixGL.nix +++ b/flake-parts/modules/home-manager/hardware/nixGL.nix @@ -20,9 +20,15 @@ system, ... }: -with builtins; -with lib; let + inherit (lib) + mkIf + mkMerge + mkOverride + types + mkEnableOption + mkOption + ; inherit (localFlake.lib.modules) isModuleLoadedAndEnabled; cfg = config.tensorfiles.hm.hardware.nixGL; @@ -49,13 +55,13 @@ let && (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.terminals.kitty"); in { - options.tensorfiles.hm.hardware.nixGL = with types; { + options.tensorfiles.hm.hardware.nixGL = { enable = mkEnableOption '' TODO ''; pkg = mkOption { - type = package; + type = types.package; inherit (inputs.nixGL.packages.${system}) default; description = '' NixGL binary that should be used for wrapping other graphical executables. diff --git a/flake-parts/modules/home-manager/misc/gtk.nix b/flake-parts/modules/home-manager/misc/gtk.nix index 8f8b531..66fa2b2 100644 --- a/flake-parts/modules/home-manager/misc/gtk.nix +++ b/flake-parts/modules/home-manager/misc/gtk.nix @@ -19,16 +19,15 @@ pkgs, ... }: -with builtins; -with lib; let + inherit (lib) mkIf mkMerge mkEnableOption; inherit (localFlake.lib.modules) mkOverrideAtHmModuleLevel; cfg = config.tensorfiles.hm.misc.gtk; _ = mkOverrideAtHmModuleLevel; in { - options.tensorfiles.hm.misc.gtk = with types; { + options.tensorfiles.hm.misc.gtk = { enable = mkEnableOption '' TODO ''; diff --git a/flake-parts/modules/home-manager/misc/xdg.nix b/flake-parts/modules/home-manager/misc/xdg.nix index 48ba798..a631bb8 100644 --- a/flake-parts/modules/home-manager/misc/xdg.nix +++ b/flake-parts/modules/home-manager/misc/xdg.nix @@ -14,41 +14,29 @@ # "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' { localFlake }: { config, lib, ... }: -with builtins; -with lib; let + inherit (lib) + mkIf + mkMerge + mkOverride + mkEnableOption + ; inherit (localFlake.lib.modules) mkOverrideAtHmModuleLevel; cfg = config.tensorfiles.hm.misc.xdg; _ = mkOverrideAtHmModuleLevel; defaultBrowser = - if cfg.defaultApplications.browser != null then - cfg.defaultApplications.browser - else - ( - if config.home.sessionVariables.BROWSER != null then config.home.sessionVariables.BROWSER else null - ); - + if config.home.sessionVariables.BROWSER != "" then config.home.sessionVariables.BROWSER else null; defaultEditor = - if cfg.defaultApplications.editor != null then - cfg.defaultApplications.editor - else - (if config.home.sessionVariables.EDITOR != null then config.home.sessionVariables.EDITOR else null); - + if config.home.sessionVariables.EDITOR != "" then config.home.sessionVariables.EDITOR else null; defaultTerminal = - if cfg.defaultApplications.terminal != null then - cfg.defaultApplications.terminal - else - ( - if config.home.sessionVariables.TERMINAL != null then - config.home.sessionVariables.TERMINAL - else - null - ); + if config.home.sessionVariables.TERMINAL != "" then config.home.sessionVariables.TERMINAL else null; + defaultEmail = + if config.home.sessionVariables.EMAIL != "" then config.home.sessionVariables.EMAIL else null; in { - options.tensorfiles.hm.misc.xdg = with types; { + options.tensorfiles.hm.misc.xdg = { enable = mkEnableOption '' Enables NixOS module that configures/handles the xdg toolset. ''; @@ -61,30 +49,6 @@ in // { default = true; }; - - browser = mkOption { - type = nullOr str; - default = null; - description = '' - TODO - ''; - }; - - editor = mkOption { - type = nullOr str; - default = null; - description = '' - TODO - ''; - }; - - terminal = mkOption { - type = nullOr str; - default = null; - description = '' - TODO - ''; - }; }; }; @@ -96,6 +60,30 @@ in mime.enable = _ true; mimeApps.enable = _ true; }; + + home.sessionVariables = + let + # NOTE the lowest possible priority just to make sure the keys + # in the sessionVariables exist + _ = mkOverride 5000; + in + { + EDITOR = _ ""; + VISUAL = _ ""; + + BROWSER = _ ""; + TERMINAL = _ ""; + IDE = _ ""; + EMAIL = _ ""; + + DOWNLOADS_DIR = _ ""; + ORG_DIR = _ ""; + PROJECTS_DIR = _ ""; + MISC_DATA_DIR = _ ""; + + DEFAULT_USERNAME = _ config.home.username; + DEFAULT_MAIL = _ ""; + }; } # |----------------------------------------------------------------------| # (mkIf cfg.defaultApplications.enable { @@ -133,6 +121,10 @@ in "mimetype" = mkIf (defaultTerminal != null) (_ "${defaultTerminal}.desktop"); "application/x-terminal-emulator" = mkIf (defaultTerminal != null) (_ "${defaultTerminal}.desktop"); "x-terminal-emulator" = mkIf (defaultTerminal != null) (_ "${defaultTerminal}.desktop"); + # EMAIL + "x-scheme-handler/mailto" = mkIf (defaultEmail != null) (_ "${defaultEmail}.desktop"); + "x-scheme-handler/mid" = mkIf (defaultEmail != null) (_ "${defaultEmail}.desktop"); + "message/rfc822" = mkIf (defaultEmail != null) (_ "${defaultEmail}.desktop"); }; }; }) diff --git a/flake-parts/modules/home-manager/profiles/accounts/tsandrini.nix b/flake-parts/modules/home-manager/profiles/accounts/tsandrini.nix new file mode 100644 index 0000000..a1f5060 --- /dev/null +++ b/flake-parts/modules/home-manager/profiles/accounts/tsandrini.nix @@ -0,0 +1,294 @@ +{ localFlake, secretsPath }: +{ config, lib, ... }: +let + inherit (lib) + mkIf + mkMerge + types + mkEnableOption + mkOption + attrNames + ; + inherit (localFlake.lib.modules) mkOverrideAtHmProfileLevel isModuleLoadedAndEnabled; + inherit (localFlake.lib.options) mkAgenixEnableOption mkSubmodulesOption; + inherit (localFlake.lib.attrsets) mapToAttrsAndMerge; + inherit (localFlake.lib.strings) sanitizeEmailForNixStorePath; + + cfg = config.tensorfiles.hm.profiles.accounts.tsandrini; + _ = mkOverrideAtHmProfileLevel; + + agenixCheck = + (isModuleLoadedAndEnabled config "tensorfiles.hm.security.agenix") && cfg.agenix.enable; +in +{ + options.tensorfiles.hm.profiles.accounts.tsandrini = { + enable = mkEnableOption '' + TODO + ''; + + agenix = { + enable = mkAgenixEnableOption; + }; + + email = { + enable = + mkEnableOption '' + Enable email accounts configuration. + '' + // { + default = true; + }; + + accounts = + mkSubmodulesOption (_account: { + + enable = + mkEnableOption '' + Enable the account. + '' + // { + default = true; + }; + + agenixPassword = { + enable = mkEnableOption '' + TODO + ''; + + passwordSecretsPath = mkOption { + type = types.str; + default = "common/accounts/${sanitizeEmailForNixStorePath _account}"; + description = '' + TODO + ''; + }; + }; + }) + // { + default = { + "tomas.sandrini@seznam.cz" = { }; + "WareCzech@gmail.com" = { }; + "t@tsandrini.sh" = { }; + "business@tsandrini.sh" = { }; + "security@tsandrini.sh" = { }; + "shopping@tsandrini.sh" = { }; + "newsletters@tsandrini.sh" = { }; + }; + }; + }; + }; + + # NOTE thunderbird doesn't support the `passwordCommand` so for me personally + # its kinda useless, but I prepared it nonetheless + config = mkIf cfg.enable (mkMerge [ + # |----------------------------------------------------------------------| # + (mkIf (cfg.email.enable && cfg.email.accounts."tomas.sandrini@seznam.cz".enable) { + accounts.email.accounts = + let + accountCfg = cfg.email.accounts."tomas.sandrini@seznam.cz"; + in + { + "tomas.sandrini@seznam.cz" = { + address = _ "tomas.sandrini@seznam.cz"; + userName = _ "tomas.sandrini@seznam.cz"; # TODO https://github.com/nix-community/home-manager/issues/3712 + imap.host = _ "imap.seznam.cz"; + imap.port = _ 993; + primary = _ false; + realName = _ "Tomáš Sandrini"; + smtp.host = _ "smtp.seznam.cz"; + smtp.port = _ 587; + smtp.tls.useStartTls = _ true; + thunderbird.enable = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.thunderbird"); + neomutt.enable = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.neomutt"); + notmuch.enable = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.notmuch"); + + passwordCommand = + mkIf (agenixCheck && accountCfg.agenixPassword.enable) + "cat ${config.age.secrets.${accountCfg.agenixPassword.passwordSecretsPath}.path}"; + }; + }; + }) + # |----------------------------------------------------------------------| # + (mkIf (cfg.email.enable && cfg.email.accounts."WareCzech@gmail.com".enable) { + accounts.email.accounts = + let + accountCfg = cfg.email.accounts."WareCzech@gmail.com"; + in + { + "WareCzech@gmail.com" = { + address = _ "WareCzech@gmail.com"; + userName = _ "WareCzech"; # TODO https://github.com/nix-community/home-manager/issues/3712 + imap.host = _ "imap.gmail.com"; + imap.port = _ 993; + primary = _ false; + realName = _ "Tomáš Sandrini"; + smtp.host = _ "smtp.gmail.com"; + smtp.port = _ 587; + smtp.tls.useStartTls = _ true; + thunderbird.enable = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.thunderbird"); + neomutt.enable = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.neomutt"); + notmuch.enable = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.notmuch"); + + passwordCommand = + mkIf (agenixCheck && accountCfg.agenixPassword.enable) + "cat ${config.age.secrets.${accountCfg.agenixPassword.passwordSecretsPath}.path}"; + }; + }; + }) + # |----------------------------------------------------------------------| # + (mkIf (cfg.email.enable && cfg.email.accounts."t@tsandrini.sh".enable) { + accounts.email.accounts = + let + accountCfg = cfg.email.accounts."t@tsandrini.sh"; + in + { + "t@tsandrini.sh" = { + address = _ "t@tsandrini.sh"; + userName = _ "t@tsandrini.sh"; # TODO https://github.com/nix-community/home-manager/issues/3712 + imap.host = _ "mail.tsandrini.sh"; + imap.port = _ 993; + primary = _ true; + realName = _ "Tomáš Sandrini"; + smtp.host = _ "mail.tsandrini.sh"; + smtp.port = _ 587; + smtp.tls.useStartTls = _ true; + thunderbird.enable = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.thunderbird"); + neomutt.enable = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.neomutt"); + notmuch.enable = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.notmuch"); + + passwordCommand = + mkIf (agenixCheck && accountCfg.agenixPassword.enable) + "cat ${config.age.secrets.${accountCfg.agenixPassword.passwordSecretsPath}.path}"; + }; + }; + }) + # |----------------------------------------------------------------------| # + (mkIf (cfg.email.enable && cfg.email.accounts."business@tsandrini.sh".enable) { + accounts.email.accounts = + let + accountCfg = cfg.email.accounts."business@tsandrini.sh"; + in + { + "business@tsandrini.sh" = { + address = _ "business@tsandrini.sh"; + userName = _ "business@tsandrini.sh"; # TODO https://github.com/nix-community/home-manager/issues/3712 + imap.host = _ "mail.tsandrini.sh"; + imap.port = _ 993; + primary = _ false; + realName = _ "Tomáš Sandrini"; + smtp.host = _ "mail.tsandrini.sh"; + smtp.port = _ 587; + smtp.tls.useStartTls = _ true; + thunderbird.enable = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.thunderbird"); + neomutt.enable = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.neomutt"); + notmuch.enable = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.notmuch"); + + passwordCommand = + mkIf (agenixCheck && accountCfg.agenixPassword.enable) + "cat ${config.age.secrets.${accountCfg.agenixPassword.passwordSecretsPath}.path}"; + }; + }; + }) + # |----------------------------------------------------------------------| # + (mkIf (cfg.email.enable && cfg.email.accounts."security@tsandrini.sh".enable) { + accounts.email.accounts = + let + accountCfg = cfg.email.accounts."security@tsandrini.sh"; + in + { + "security@tsandrini.sh" = { + address = _ "security@tsandrini.sh"; + userName = _ "security@tsandrini.sh"; # TODO https://github.com/nix-community/home-manager/issues/3712 + imap.host = _ "mail.tsandrini.sh"; + imap.port = _ 993; + primary = _ false; + realName = _ "Tomáš Sandrini"; + smtp.host = _ "mail.tsandrini.sh"; + smtp.port = _ 587; + smtp.tls.useStartTls = _ true; + thunderbird.enable = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.thunderbird"); + neomutt.enable = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.neomutt"); + notmuch.enable = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.notmuch"); + + passwordCommand = + mkIf (agenixCheck && accountCfg.agenixPassword.enable) + "cat ${config.age.secrets.${accountCfg.agenixPassword.passwordSecretsPath}.path}"; + }; + }; + }) + # |----------------------------------------------------------------------| # + (mkIf (cfg.email.enable && cfg.email.accounts."shopping@tsandrini.sh".enable) { + accounts.email.accounts = + let + accountCfg = cfg.email.accounts."shopping@tsandrini.sh"; + in + { + "shopping@tsandrini.sh" = { + address = _ "shopping@tsandrini.sh"; + userName = _ "shopping@tsandrini.sh"; # TODO https://github.com/nix-community/home-manager/issues/3712 + imap.host = _ "mail.tsandrini.sh"; + imap.port = _ 993; + primary = _ false; + realName = _ "Tomáš Sandrini"; + smtp.host = _ "mail.tsandrini.sh"; + smtp.port = _ 587; + smtp.tls.useStartTls = _ true; + thunderbird.enable = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.thunderbird"); + neomutt.enable = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.neomutt"); + notmuch.enable = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.notmuch"); + + passwordCommand = + mkIf (agenixCheck && accountCfg.agenixPassword.enable) + "cat ${config.age.secrets.${accountCfg.agenixPassword.passwordSecretsPath}.path}"; + }; + }; + }) + # |----------------------------------------------------------------------| # + (mkIf (cfg.email.enable && cfg.email.accounts."newsletters@tsandrini.sh".enable) { + accounts.email.accounts = + let + accountCfg = cfg.email.accounts."newsletters@tsandrini.sh"; + in + { + "newsletters@tsandrini.sh" = { + address = _ "newsletters@tsandrini.sh"; + userName = _ "newsletters@tsandrini.sh"; # TODO https://github.com/nix-community/home-manager/issues/3712 + imap.host = _ "mail.tsandrini.sh"; + imap.port = _ 993; + primary = _ false; + realName = _ "Tomáš Sandrini"; + smtp.host = _ "mail.tsandrini.sh"; + smtp.port = _ 587; + smtp.tls.useStartTls = _ true; + thunderbird.enable = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.thunderbird"); + neomutt.enable = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.neomutt"); + notmuch.enable = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.notmuch"); + + passwordCommand = + mkIf (agenixCheck && accountCfg.agenixPassword.enable) + "cat ${config.age.secrets.${accountCfg.agenixPassword.passwordSecretsPath}.path}"; + }; + }; + }) + # |----------------------------------------------------------------------| # + (mkIf (cfg.email.enable && agenixCheck) { + age.secrets = mapToAttrsAndMerge (attrNames cfg.email.accounts) ( + _account: + let + accountCfg = cfg.email.accounts.${_account}; + in + with accountCfg.agenixPassword; + { + "${passwordSecretsPath}" = mkIf enable { + file = _ (secretsPath + "/${passwordSecretsPath}.age"); + # mode = _ "600"; + # owner = _ config.home.username; # NOTE not available in HM module + }; + } + ); + }) + # |----------------------------------------------------------------------| # + ]); + + meta.maintainers = with localFlake.lib.maintainers; [ tsandrini ]; +} diff --git a/flake-parts/modules/home-manager/profiles/base.nix b/flake-parts/modules/home-manager/profiles/base.nix index fe9ac40..a7dd5d1 100644 --- a/flake-parts/modules/home-manager/profiles/base.nix +++ b/flake-parts/modules/home-manager/profiles/base.nix @@ -14,16 +14,15 @@ # "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' { localFlake }: { config, lib, ... }: -with builtins; -with lib; let + inherit (lib) mkIf mkMerge mkEnableOption; inherit (localFlake.lib.modules) mkOverrideAtHmProfileLevel; cfg = config.tensorfiles.hm.profiles.base; _ = mkOverrideAtHmProfileLevel; in { - options.tensorfiles.hm.profiles.base = with types; { + options.tensorfiles.hm.profiles.base = { enable = mkEnableOption '' TODO ''; diff --git a/flake-parts/modules/home-manager/profiles/graphical-plasma/default.nix b/flake-parts/modules/home-manager/profiles/graphical-plasma/default.nix index baee7ec..55e120f 100644 --- a/flake-parts/modules/home-manager/profiles/graphical-plasma/default.nix +++ b/flake-parts/modules/home-manager/profiles/graphical-plasma/default.nix @@ -19,16 +19,15 @@ lib, ... }: -with builtins; -with lib; let + inherit (lib) mkIf mkMerge mkEnableOption; inherit (localFlake.lib.modules) mkOverrideAtHmProfileLevel; cfg = config.tensorfiles.hm.profiles.graphical-plasma; _ = mkOverrideAtHmProfileLevel; in { - options.tensorfiles.hm.profiles.graphical-plasma = with types; { + options.tensorfiles.hm.profiles.graphical-plasma = { enable = mkEnableOption '' TODO ''; @@ -50,10 +49,15 @@ in programs = { newsboat.enable = _ true; pywal.enable = _ true; - terminals.kitty.enable = _ true; + # terminals.kitty.enable = _ true; + terminals.wezterm.enable = _ true; browsers.firefox.enable = _ true; + browsers.firefox.userjs.betterfox.enable = _ true; + editors.emacs-doom.enable = _ true; - #thunderbird.enable = _ true; + editors.neovim.lsp.enable = _ true; + + thunderbird.enable = _ true; }; services = { @@ -77,8 +81,9 @@ in home.sessionVariables = { # Default programs BROWSER = _ "firefox"; - TERMINAL = _ "kitty"; - IDE = _ "code"; + TERMINAL = _ "wezterm"; + IDE = _ "emacs"; + EMAIL = _ "thunderbird"; }; fonts.fontconfig.enable = _ true; diff --git a/flake-parts/modules/home-manager/profiles/graphical-xmonad.nix b/flake-parts/modules/home-manager/profiles/graphical-xmonad.nix index 7a456a3..56989fb 100644 --- a/flake-parts/modules/home-manager/profiles/graphical-xmonad.nix +++ b/flake-parts/modules/home-manager/profiles/graphical-xmonad.nix @@ -19,16 +19,15 @@ pkgs, ... }: -with builtins; -with lib; let + inherit (lib) mkIf mkMerge mkEnableOption; inherit (localFlake.lib.modules) mkOverrideAtHmProfileLevel; cfg = config.tensorfiles.hm.profiles.graphical-xmonad; _ = mkOverrideAtHmProfileLevel; in { - options.tensorfiles.hm.profiles.graphical-xmonad = with types; { + options.tensorfiles.hm.profiles.graphical-xmonad = { enable = mkEnableOption '' TODO ''; @@ -46,9 +45,11 @@ in newsboat.enable = _ true; dmenu.enable = _ true; pywal.enable = _ true; - terminals.kitty.enable = _ true; + # terminals.kitty.enable = _ true; + terminals.wezterm.enable = _ true; browsers.firefox.enable = _ true; editors.emacs-doom.enable = _ true; + thunderbird.enable = _ true; }; services = { @@ -65,9 +66,10 @@ in home.sessionVariables = { # Default programs - BROWSER = "firefox"; - TERMINAL = "kitty"; - IDE = "emacs"; + BROWSER = _ "firefox"; + TERMINAL = _ "wezterm"; + IDE = _ "emacs"; + EMAIL = _ "thunderbird"; }; home.packages = with pkgs; [ diff --git a/flake-parts/modules/home-manager/profiles/headless.nix b/flake-parts/modules/home-manager/profiles/headless.nix index 1b9adf2..67e6c59 100644 --- a/flake-parts/modules/home-manager/profiles/headless.nix +++ b/flake-parts/modules/home-manager/profiles/headless.nix @@ -14,9 +14,14 @@ # "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' { localFlake }: { config, lib, ... }: -with builtins; -with lib; let + inherit (lib) + mkIf + mkMerge + mkBefore + mkEnableOption + ; + inherit (lib.strings) removePrefix; inherit (localFlake.lib.modules) mkOverrideAtHmProfileLevel isModuleLoadedAndEnabled; inherit (localFlake.lib.options) mkImpermanenceEnableOption; @@ -26,10 +31,10 @@ let impermanenceCheck = (isModuleLoadedAndEnabled config "tensorfiles.hm.system.impermanence") && cfg.impermanence.enable; impermanence = if impermanenceCheck then config.tensorfiles.hm.system.impermanence else { }; - pathToRelative = strings.removePrefix "${config.home.homeDirectory}/"; + pathToRelative = removePrefix "${config.home.homeDirectory}/"; in { - options.tensorfiles.hm.profiles.headless = with types; { + options.tensorfiles.hm.profiles.headless = { enable = mkEnableOption '' TODO ''; @@ -46,7 +51,7 @@ in profiles.minimal.enable = _ true; programs = { - shells.zsh.enable = _ true; + shells.fish.enable = _ true; editors.neovim.enable = _ true; file-managers.yazi.enable = _ true; @@ -61,13 +66,14 @@ in home.sessionVariables = { # Default programs - EDITOR = "nvim"; + EDITOR = "nvim"; # TODO VISUAL = "nvim"; + # Default programs # Directory structure - DOWNLOADS_DIR = config.home.homeDirectory + "/Downloads"; - ORG_DIR = config.home.homeDirectory + "/OrgBundle"; - PROJECTS_DIR = config.home.homeDirectory + "/ProjectBundle"; - MISC_DATA_DIR = config.home.homeDirectory + "/FiberBundle"; + DOWNLOADS_DIR = _ (config.home.homeDirectory + "/Downloads"); + ORG_DIR = _ (config.home.homeDirectory + "/OrgBundle"); + PROJECTS_DIR = _ (config.home.homeDirectory + "/ProjectBundle"); + MISC_DATA_DIR = _ (config.home.homeDirectory + "/FiberBundle"); # Fallbacks # DEFAULT_USERNAME = "tsandrini"; # DEFAULT_MAIL = "tomas.sandrini@seznam.cz"; diff --git a/flake-parts/modules/home-manager/profiles/minimal.nix b/flake-parts/modules/home-manager/profiles/minimal.nix index bcdf1c8..a326786 100644 --- a/flake-parts/modules/home-manager/profiles/minimal.nix +++ b/flake-parts/modules/home-manager/profiles/minimal.nix @@ -14,16 +14,15 @@ # "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' { localFlake }: { config, lib, ... }: -with builtins; -with lib; let + inherit (lib) mkIf mkMerge mkEnableOption; inherit (localFlake.lib.modules) mkOverrideAtHmProfileLevel; cfg = config.tensorfiles.hm.profiles.minimal; _ = mkOverrideAtHmProfileLevel; in { - options.tensorfiles.hm.profiles.minimal = with types; { + options.tensorfiles.hm.profiles.minimal = { enable = mkEnableOption '' TODO ''; diff --git a/flake-parts/modules/home-manager/programs/browsers/firefox/default.nix b/flake-parts/modules/home-manager/programs/browsers/firefox/default.nix index 525921c..5d943dc 100644 --- a/flake-parts/modules/home-manager/programs/browsers/firefox/default.nix +++ b/flake-parts/modules/home-manager/programs/browsers/firefox/default.nix @@ -19,9 +19,16 @@ pkgs, ... }: -with builtins; -with lib; let + inherit (lib) + mkIf + mkMerge + mkEnableOption + mkOption + types + optional + ; + inherit (lib.strings) removePrefix; inherit (localFlake.lib.modules) mkOverrideAtHmModuleLevel isModuleLoadedAndEnabled; inherit (localFlake.lib.options) mkImpermanenceEnableOption; @@ -33,10 +40,19 @@ let impermanenceCheck = (isModuleLoadedAndEnabled config "tensorfiles.hm.system.impermanence") && cfg.impermanence.enable; impermanence = if impermanenceCheck then config.tensorfiles.hm.system.impermanence else { }; - pathToRelative = strings.removePrefix "${config.home.homeDirectory}/"; + pathToRelative = removePrefix "${config.home.homeDirectory}/"; + + userjsEnabled = cfg.userjs.arkenfox.enable || cfg.userjs.betterfox.enable; + userjs = + if cfg.userjs.arkenfox.enable then + cfg.userjs.arkenfox + else if cfg.userjs.betterfox.enable then + cfg.userjs.betterfox + else + { }; in { - options.tensorfiles.hm.programs.browsers.firefox = with types; { + options.tensorfiles.hm.programs.browsers.firefox = { enable = mkEnableOption '' TODO ''; @@ -44,15 +60,141 @@ in impermanence = { enable = mkImpermanenceEnableOption; }; + + userjs = { + arkenfox = { + enable = mkEnableOption '' + Enable arkenfox user.js configuration. + ''; + + src = mkOption { + type = types.path; + default = "${inputs.arkenfox-user-js}/user.js"; + description = '' + The path to the arkenfox user.js configuration. + ''; + }; + + extraConfig = mkOption { + type = types.lines; + default = '' + user_pref("extensions.autoDisableScopes", 0); + + // 2811: sanitize everything but keep history & downloads and + // also enable session restore + user_pref("browser.startup.page", 3); + user_pref("privacy.clearOnShutdown.history", false); + user_pref("privacy.clearOnShutdown.downloads", false); + user_pref("privacy.sanitize.sanitizeOnShutdown", false); + + // TODO: think off a better way to declaratively manage + // cookie exepctions + user_pref("privacy.clearOnShutdown.cookies", false); + user_pref("privacy.clearOnShutdown.cache", false); + user_pref("privacy.clearOnShutdown.sessions", false); + + // 4504: TODO figure out some alternative since I cannot stand + // how it works by default but I'd like to have it + // enabled at some point + user_pref("privacy.resistFingerprinting.letterboxing", false); + + // 4510: I cannot f*ing stand light theme + user_pref("browser.display.use_system_colors", false); + user_pref("browser.theme.content-theme", 0); + user_pref("browser.theme.toolbar-theme", 0); + // tell websites to prefer dark colorscheme + user_pref("layout.css.prefers-color-scheme.content-override", 0); + ''; + description = '' + Default extra configuration (overrides) for the arkenfox user.js. + ''; + }; + }; + + betterfox = { + enable = mkEnableOption '' + Enable betterfox user.js configuration. + ''; + + src = mkOption { + type = types.path; + default = "${inputs.betterfox}/user.js"; + description = '' + The path to the betterfox user.js configuration. + ''; + }; + + extraConfig = mkOption { + type = types.lines; + default = '' + // PREF: disable login manager + user_pref("signon.rememberSignons", false); + + // PREF: disable address and credit card manager + user_pref("extensions.formautofill.addresses.enabled", false); + user_pref("extensions.formautofill.creditCards.enabled", false); + + // PREF: do not allow embedded tweets, Instagram, Reddit, and Tiktok posts + user_pref("urlclassifier.trackingSkipURLs", ""); + user_pref("urlclassifier.features.socialtracking.skipURLs", ""); + + // PREF: require safe SSL negotiation + // [ERROR] SSL_ERROR_UNSAFE_NEGOTIATION + user_pref("security.ssl.require_safe_negotiation", true); + + // PREF: disable telemetry of what default browser you use [WINDOWS] + user_pref("default-browser-agent.enabled", false); + + // PREF: enforce certificate pinning + // [ERROR] MOZILLA_PKIX_ERROR_KEY_PINNING_FAILURE + // 1 = allow user MiTM (such as your antivirus) (default) + // 2 = strict + user_pref("security.cert_pinning.enforcement_level", 2); + + // PREF: enable HTTPS-Only Mode + // Warn me before loading sites that don't support HTTPS + // in both Normal and Private Browsing windows. + user_pref("dom.security.https_only_mode", true); + user_pref("dom.security.https_only_mode_error_page_user_suggestions", true); + + /**************************************************************************************** + * OPTION: INSTANT SCROLLING (SIMPLE ADJUSTMENT) * + ****************************************************************************************/ + // recommended for 60hz+ displays + user_pref("apz.overscroll.enabled", true); // DEFAULT NON-LINUX + user_pref("general.smoothScroll", true); // DEFAULT + user_pref("mousewheel.default.delta_multiplier_y", 275); // 250-400; adjust this number to your liking + // Firefox Nightly only: + // [1] https://bugzilla.mozilla.org/show_bug.cgi?id=1846935 + user_pref("general.smoothScroll.msdPhysics.enabled", false); // [FF122+ Nightly] + ''; + description = '' + Default extra configuration (overrides) for the betterfox user.js. + ''; + }; + }; + }; }; config = mkIf cfg.enable (mkMerge [ + + # |----------------------------------------------------------------------| # + { + assertions = [ + { + assertion = + (cfg.userjs.arkenfox.enable && !cfg.userjs.betterfox.enable) + || (!cfg.userjs.arkenfox.enable && cfg.userjs.betterfox.enable); + message = "Only one user.js backend can be enabled at a time."; + } + ]; + } # |----------------------------------------------------------------------| # { programs.firefox = { enable = _ true; package = pkgs.firefox.override { - # trace: warning: The cfg.enableTridactylNative argument for + # trace: warning: The cfg.enableTridactylNative argument # `firefox.override` is deprecated, please add `pkgs.tridactyl-native` # to `nativeMessagingHosts.packages` instead nativeMessagingHosts = @@ -227,45 +369,14 @@ in "services.sync.engine.addons" = _ false; "services.sync.declinedEngines" = _ "passwords,creditcards,addons,prefs,bookmarks"; }; - - # Download areknfox-user-js and append overrides (order matters) - # - # Note: I try to keep general purpose config in the settings - # attrset listed above - extraConfig = - (builtins.readFile "${inputs.arkenfox-user-js}/user.js") - + '' - user_pref("extensions.autoDisableScopes", 0); - - // 2811: sanitize everything but keep history & downloads and - // also enable session restore - user_pref("browser.startup.page", 3); - user_pref("privacy.clearOnShutdown.history", false); - user_pref("privacy.clearOnShutdown.downloads", false); - user_pref("privacy.sanitize.sanitizeOnShutdown", false); - - // TODO: think off a better way to declaratively manage - // cookie exepctions - user_pref("privacy.clearOnShutdown.cookies", false); - user_pref("privacy.clearOnShutdown.cache", false); - user_pref("privacy.clearOnShutdown.sessions", false); - - // 4504: TODO figure out some alternative since I cannot stand - // how it works by default but I'd like to have it - // enabled at some point - user_pref("privacy.resistFingerprinting.letterboxing", false); - - // 4510: I cannot f*ing stand light theme - user_pref("browser.display.use_system_colors", false); - user_pref("browser.theme.content-theme", 0); - user_pref("browser.theme.toolbar-theme", 0); - // tell websites to prefer dark colorscheme - user_pref("layout.css.prefers-color-scheme.content-override", 0); - ''; }; }; } # |----------------------------------------------------------------------| # + (mkIf userjsEnabled { + programs.firefox.profiles.default.extraConfig = (builtins.readFile userjs.src) + userjs.extraConfig; + }) + # |----------------------------------------------------------------------| # (mkIf impermanenceCheck { home.persistence."${impermanence.persistentRoot}${config.home.homeDirectory}" = { directories = [ diff --git a/flake-parts/modules/home-manager/programs/btop.nix b/flake-parts/modules/home-manager/programs/btop.nix index 1fe8558..98c7733 100644 --- a/flake-parts/modules/home-manager/programs/btop.nix +++ b/flake-parts/modules/home-manager/programs/btop.nix @@ -14,16 +14,15 @@ # "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' { localFlake }: { config, lib, ... }: -with builtins; -with lib; let + inherit (lib) mkIf mkMerge mkEnableOption; inherit (localFlake.lib.modules) mkOverrideAtHmModuleLevel; cfg = config.tensorfiles.hm.programs.btop; _ = mkOverrideAtHmModuleLevel; in { - options.tensorfiles.hm.programs.btop = with types; { + options.tensorfiles.hm.programs.btop = { enable = mkEnableOption '' TODO ''; diff --git a/flake-parts/modules/home-manager/programs/direnv.nix b/flake-parts/modules/home-manager/programs/direnv.nix index 2c3f267..7cf4b79 100644 --- a/flake-parts/modules/home-manager/programs/direnv.nix +++ b/flake-parts/modules/home-manager/programs/direnv.nix @@ -14,16 +14,15 @@ # "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' { localFlake }: { config, lib, ... }: -with builtins; -with lib; let - inherit (localFlake.lib.modules) mkOverrideAtHmModuleLevel isModuleLoadedAndEnabled; + inherit (lib) mkIf mkMerge mkEnableOption; + inherit (localFlake.lib.modules) mkOverrideAtHmModuleLevel; cfg = config.tensorfiles.hm.programs.direnv; _ = mkOverrideAtHmModuleLevel; in { - options.tensorfiles.hm.programs.direnv = with types; { + options.tensorfiles.hm.programs.direnv = { enable = mkEnableOption '' Enables a HomeManager module that sets up direnv. @@ -37,12 +36,13 @@ in { programs.direnv = { enable = _ true; - enableBashIntegration = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.shells.bash"); - enableFishIntegration = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.shells.fish"); - enableNushellIntegration = _ ( - isModuleLoadedAndEnabled config "tensorfiles.hm.programs.shells.nushell" - ); - enableZshIntegration = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.shells.zsh"); + # NOTE enabled by default so probably unnecessary + # enableBashIntegration = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.shells.bash"); + # enableFishIntegration = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.shells.fish"); + # enableNushellIntegration = _ ( + # isModuleLoadedAndEnabled config "tensorfiles.hm.programs.shells.nushell" + # ); + # enableZshIntegration = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.shells.zsh"); nix-direnv.enable = _ true; }; } diff --git a/flake-parts/modules/home-manager/programs/dmenu.nix b/flake-parts/modules/home-manager/programs/dmenu.nix index b647e6a..d660ac0 100644 --- a/flake-parts/modules/home-manager/programs/dmenu.nix +++ b/flake-parts/modules/home-manager/programs/dmenu.nix @@ -19,9 +19,14 @@ pkgs, ... }: -with builtins; -with lib; let + inherit (lib) + mkIf + mkMerge + mkEnableOption + mkOption + types + ; inherit (localFlake.lib.modules) isModuleLoadedAndEnabled; inherit (localFlake.lib.options) mkPywalEnableOption; @@ -48,7 +53,7 @@ let }; in { - options.tensorfiles.hm.programs.dmenu = with types; { + options.tensorfiles.hm.programs.dmenu = { enable = mkEnableOption '' TODO ''; @@ -58,7 +63,7 @@ in }; pkg = mkOption { - type = package; + type = types.package; default = pkgs.dmenu; description = '' Which package to use for the dmenu binaries. You can provide any diff --git a/flake-parts/modules/home-manager/programs/editors/emacs-doom.nix b/flake-parts/modules/home-manager/programs/editors/emacs-doom.nix index d011da3..8697dc9 100644 --- a/flake-parts/modules/home-manager/programs/editors/emacs-doom.nix +++ b/flake-parts/modules/home-manager/programs/editors/emacs-doom.nix @@ -20,9 +20,16 @@ system, ... }: -with builtins; -with lib; let + inherit (lib) + mkIf + mkMerge + getExe + mkEnableOption + mkOption + types + ; + inherit (lib.strings) removePrefix; inherit (localFlake.lib.modules) mkOverrideAtHmModuleLevel isModuleLoadedAndEnabled; inherit (localFlake.lib.options) mkImpermanenceEnableOption; @@ -32,7 +39,7 @@ let impermanenceCheck = (isModuleLoadedAndEnabled config "tensorfiles.hm.system.impermanence") && cfg.impermanence.enable; impermanence = if impermanenceCheck then config.tensorfiles.hm.system.impermanence else { }; - pathToRelative = strings.removePrefix "${config.home.homeDirectory}/"; + pathToRelative = removePrefix "${config.home.homeDirectory}/"; emacsPkg = with pkgs; @@ -42,7 +49,7 @@ let ])); in { - options.tensorfiles.hm.programs.editors.emacs-doom = with types; { + options.tensorfiles.hm.programs.editors.emacs-doom = { enable = mkEnableOption '' TODO ''; @@ -52,7 +59,7 @@ in }; repoUrl = mkOption { - type = str; + type = types.str; default = "https://github.com/doomemacs/doomemacs"; description = '' TODO @@ -60,7 +67,7 @@ in }; configRepoUrl = mkOption { - type = str; + type = types.str; # default = "git@github.com:tsandrini/.doom.d.git"; default = "https://github.com/tsandrini/.doom.d.git"; description = '' diff --git a/flake-parts/modules/home-manager/programs/editors/neovim.nix b/flake-parts/modules/home-manager/programs/editors/neovim.nix index 6f0d424..2224cab 100644 --- a/flake-parts/modules/home-manager/programs/editors/neovim.nix +++ b/flake-parts/modules/home-manager/programs/editors/neovim.nix @@ -12,7 +12,7 @@ # 888 88888888 888 888 "Y8888b. 888 888 888 888 888 888 88888888 "Y8888b. # Y88b. Y8b. 888 888 X88 Y88..88P 888 888 888 888 Y8b. X88 # "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' -{ localFlake, inputs }: +{ localFlake }: { config, lib, @@ -20,13 +20,17 @@ system, ... }: -with builtins; -with lib; let + inherit (lib) + mkIf + mkMerge + optional + mkEnableOption + ; inherit (localFlake.lib.modules) mkOverrideAtHmModuleLevel - isModuleLoadedAndEnabled mkDummyDerivation + isModuleLoadedAndEnabled ; inherit (localFlake.lib.options) mkPywalEnableOption; @@ -37,7 +41,7 @@ let in { # TODO modularize config, cant be bothered to do it now - options.tensorfiles.hm.programs.editors.neovim = with types; { + options.tensorfiles.hm.programs.editors.neovim = { enable = mkEnableOption '' Enables NixOS module that configures/handles the neovim program. ''; @@ -45,6 +49,18 @@ in pywal = { enable = mkPywalEnableOption; }; + + vscode = { + enable = mkEnableOption '' + Adds support for the vscode-neovim plugin. + ''; + }; + + lsp = { + enable = mkEnableOption '' + Enables LSP support for neovim. + ''; + }; }; config = mkIf cfg.enable (mkMerge [ @@ -61,73 +77,81 @@ in # since it's been removed. Python2 support has been removed from neovim # withPython3 = _ true; withNodeJs = _ true; - extraConfig = '' - set number - set relativenumber - - set formatoptions+=l - set rulerformat=%l:%c - set nofoldenable - - set wildmenu - set wildmode=full - set wildignorecase - set clipboard+=unnamedplus - - set tabstop=8 - set softtabstop=0 - set expandtab - set shiftwidth=4 - set smarttab - - set scrolloff=5 - - set list - set listchars=tab:»·,trail:•,extends:#,nbsp:. - - filetype indent on - set smartindent - set shiftround - - set ignorecase - set smartcase - set showmatch - - autocmd BufWritePre * :%s/\\s\\+$//e - - let mapleader="\" - let maplocalleader="\" - - ino jk - ino kj - cno jk - cno kj - tno jk - tno kj - vno jk - vno kj - - nnoremap J :tabprevious - nnoremap K :tabnext - ''; plugins = with pkgs.vimPlugins; ( + # NOTE programs.neovim.extraConfig uses vimscript, which is why + # we setup the configuration using plugins where we can specify + # lua instead [ { plugin = mkDummyDerivation { inherit (pkgs) stdenv; - name = "vscode-neovim-setup"; + name = "neovim-base-config"; meta.system = system; }; - # type = "lua"; + type = "lua"; config = '' - if exists('g:vscode') - set noloadplugins - set clipboard^=unnamed,unnamedplus + -- Set options + vim.opt.number = true + vim.opt.relativenumber = true + + vim.opt.formatoptions:append('l') + vim.opt.rulerformat = '%l:%c' + vim.opt.foldenable = false + + vim.opt.wildmenu = true + vim.opt.wildmode = 'full' + vim.opt.wildignorecase = true + vim.opt.clipboard:append('unnamedplus') + + vim.opt.tabstop = 8 + vim.opt.softtabstop = 0 + vim.opt.expandtab = true + vim.opt.shiftwidth = 4 + vim.opt.smarttab = true + + vim.opt.scrolloff = 5 + + vim.opt.list = true + vim.opt.listchars = {tab = '»·', trail = '•', extends = '#', nbsp = '.'} + + vim.cmd('filetype indent on') + vim.opt.smartindent = true + vim.opt.shiftround = true + + vim.opt.ignorecase = true + vim.opt.smartcase = true + vim.opt.showmatch = true - finish - endif + -- Auto-remove trailing whitespace + vim.api.nvim_create_autocmd('BufWritePre', { + pattern = '*', + command = [[%s/\s\+$//e]] + }) + + -- Set leaders + vim.g.mapleader = ' ' + vim.g.maplocalleader = ' ' + + -- Key mappings + local function map(mode, lhs, rhs, opts) + local options = {noremap = true, silent = true} + if opts then options = vim.tbl_extend('force', options, opts) end + vim.api.nvim_set_keymap(mode, lhs, rhs, options) + end + + map('i', 'jk', '') + map('i', 'kj', '') + map('c', 'jk', '') + map('c', 'kj', '') + map('t', 'jk', '') + map('t', 'kj', '') + -- map('v', 'jk', '') + -- map('v', 'kj', '') + + map('n', 'J', ':tabprevious') + map('n', 'K', ':tabnext') ''; } ] @@ -139,6 +163,8 @@ in ''; }) ++ [ + mini-nvim + transparent-nvim vim-repeat # nnn-vim vim-fugitive @@ -147,36 +173,76 @@ in nvim-web-devicons bufexplorer undotree - lexima-vim - vim-vsnip-integ - friendly-snippets { - plugin = indentLine; + plugin = dressing-nvim; type = "lua"; config = '' - vim.g.indentLine_char = '┆' - vim.g.indentLine_color_term = 239 + require('dressing').setup{} ''; } + # lexima-vim # use nvim-autopairs instead { - plugin = vim-vsnip; + plugin = nvim-autopairs; type = "lua"; - config = ""; + config = '' + require('nvim-autopairs').setup{} + ''; } { - plugin = vim-move; + plugin = trouble-nvim; type = "lua"; config = '' - vim.g.move_key_modifier = "C" + require('trouble').setup{} ''; } { - plugin = vim-suda; + plugin = comment-nvim; + type = "lua"; + config = '' + require('Comment').setup{} + ''; + } + { + plugin = todo-comments-nvim; + type = "lua"; + config = '' + require('todo-comments').setup{} + ''; + } + # vim-vsnip-integ + # friendly-snippets + { + plugin = indent-blankline-nvim; + type = "lua"; + config = '' + require('ibl').setup{} + ''; + } + # { + # plugin = indentLine; + # type = "lua"; + # config = '' + # vim.g.indentLine_char = '┆' + # vim.g.indentLine_color_term = 239 + # ''; + # } + # { + # plugin = vim-vsnip; + # type = "lua"; + # config = ""; + # } + { + plugin = vim-move; type = "lua"; config = '' vim.g.move_key_modifier = "C" ''; } + { + plugin = vim-suda; + type = "lua"; + config = ''''; + } { plugin = telescope-nvim; type = "lua"; @@ -188,13 +254,6 @@ in } ''; } - # NOTE slows things down too much and I am also mostly using - # only hop.nvim - # { - # plugin = quick-scope; - # type = "lua"; - # config = ''''; - # } { plugin = hop-nvim; type = "lua"; @@ -204,16 +263,6 @@ in vim.keymap.set("n", ",", "HopChar2", {}) ''; } - # { - # plugin = vim-easymotion; - # type = "lua"; - # config = '' - # vim.g.EasyMotion_do_mapping = false - # vim.g.EasyMotion_smartcase = true - - # vim.keymap.set("n", ",", "(easymotion-overwin-f2)", {}) - # ''; - # } { plugin = lualine-nvim; type = "lua"; @@ -234,26 +283,6 @@ in } ''; } - # { - # plugin = nvim-treesitter.withAllGrammars; - # type = "lua"; - # config = '' - # require('nvim-treesitter.configs').setup{ - # sync_install = false, - # auto_install = false, - # highlight = { - # enable = true, - # disable = { "latex" } - # }, - # incremental_selection = { - # enable = true - # }, - # indent = { - # enable = true - # } - # }; - # ''; - # } { plugin = vim-fern; type = "lua"; @@ -317,73 +346,210 @@ in plugin = which-key-nvim; type = "lua"; config = '' - vim.api.nvim_set_option("timeoutlen", 500) - - require('which-key').register({ - { - name = "+general", - [""] = { ":Telescope find_files", "find-files" }, - ["/"] = { ":Telescope live_grep", "telescope-grep" }, - r = { ":noh", "highlights-remove" }, - h = { "h", "window-left" }, - j = { "j", "window-below" }, - k = { "k", "window-above" }, - l = { "l", "window-right" }, - s = { "s", "window-split-below" }, - v = { "v", "window-split-right" }, - q = { ":q", "file-quit" }, - Q = { ":qall", "file-quit-all" }, - w = { ":w", "file-save" }, - n = { ":tabnew", "tab-new" }, - u = { ":UndotreeToggle", "undotree-toggle" }, - t = { ":terminal", "terminal-open" }, - --- f = { ":NnnPicker %:p:h", "nnn-open" } - }, - g = { - name = "+git", - s = { ":Git", "git-status" }, - b = { ":Git blame", "git-blame" }, - d = { ":Gdiff", "git-diff" }, - p = { ":Git push", "git-push" }, - l = { ":Git pull", "git-pull" }, - f = { ":Git fetch", "git-pull" }, - a = { ":Git add *", "git-add-all" }, - c = { ":Git commit --verbose", "git-commit-verbose" }, - e = { ":GitMessenger", "git-messenger" } - }, - p = { - name = "+telescope", - f = { ":Telescope find_files", "telescope-files" }, - g = { ":GFiles", "telescope-git-files" }, - b = { ":Telescope buffers", "telescope-buffers" }, - l = { ":Colors", "telescope-colors" }, - r = { ":Telescope live_grep", "telescope-grep" }, - g = { ":Telescope git_commits", "telescope-commits" }, - s = { ":Snippets", "telescope-snippets" }, - m = { ":Telescope commands", "telescope-commands" }, - h = { ":Telescope man_pages", "telescope-man-pages" }, - -- t = { ":Telescope treesitter", "telescope-treesitter" } - }, - b = { - name = "+bufexplorer", - i = "bufexplorer-open", - t = "bufexplorer-toggle", - s = "bufexplorer-horizontal-split", - v = "bufexplorer-vertical-split" - } - }, { prefix = "" }) + -- vim.api.nvim_set_option("timeoutlen", 500) + + require("which-key").setup{ + preset = "modern", + delay = 100 + } + + require("which-key").add({ + { "", group = "+general" }, + { "/", ":Telescope live_grep", desc = "Telescope grep" }, + { "", ":Telescope find_files", desc = "Find files" }, + { "Q", ":qall", desc = "Quit all files" }, + { "b", group = "+bufexplorer" }, + { "bi", "BufExplorer", desc = "Open BufExplorer" }, + { "bs", "BufExplorerHorizontalSplit", desc = "BufExplorer horizontal split" }, + { "bt", "ToggleBufExplorer", desc = "Toggle BufExplorer" }, + { "bv", "BufExplorerVerticalSplit", desc = "BufExplorer vertical split" }, + { "g", group = "+git" }, + { "ga", ":Git add *", desc = "Git add all" }, + { "gb", ":Git blame", desc = "Git blame" }, + { "gc", ":Git commit --verbose", desc = "Git commit (verbose)" }, + { "gd", ":Gdiff", desc = "Git diff" }, + { "ge", ":GitMessenger", desc = "Git messenger" }, + { "gf", ":Git fetch", desc = "Git fetch" }, + { "gl", ":Git pull", desc = "Git pull" }, + { "gp", ":Git push", desc = "Git push" }, + { "gs", ":Git", desc = "Git status" }, + { "h", "h", desc = "Window left" }, + { "j", "j", desc = "Window below" }, + { "k", "k", desc = "Window above" }, + { "l", "l", desc = "Window right" }, + { "n", ":tabnew", desc = "New tab" }, + { "p", group = "+telescope" }, + { "pb", ":Telescope buffers", desc = "Buffers" }, + { "pc", ":Telescope git_commits", desc = "Git commits" }, + { "pf", ":Telescope find_files", desc = "Find files" }, + { "pg", ":Telescope git_files", desc = "Git files" }, + { "ph", ":Telescope man_pages", desc = "Man pages" }, + { "pl", ":Telescope colorscheme", desc = "Colorschemes" }, + { "pm", ":Telescope commands", desc = "Commands" }, + { "pr", ":Telescope live_grep", desc = "Live grep" }, + { "ps", ":Telescope snippets", desc = "Snippets" }, + { "q", ":q", desc = "Quit file" }, + { "r", ":noh", desc = "Remove highlights" }, + { "s", "s", desc = "Split window below" }, + { "t", ":terminal", desc = "Open terminal" }, + { "u", ":UndotreeToggle", desc = "Toggle Undotree" }, + { "v", "v", desc = "Split window right" }, + { "w", ":w", desc = "Save file" } + }) ''; } - (pkgs.vimUtils.buildVimPlugin { - pname = "kitty-scrollback.nvim"; - version = inputs.kitty-scrollback-nvim.rev; - src = inputs.kitty-scrollback-nvim; - }) + # { + # plugin = vim-easymotion; + # type = "lua"; + # config = '' + # vim.g.EasyMotion_do_mapping = false + # vim.g.EasyMotion_smartcase = true + + # vim.keymap.set("n", ",", "(easymotion-overwin-f2)", {}) + # ''; + # } + # NOTE slows things down too much and I am also mostly using + # only hop.nvim + # { + # plugin = quick-scope; + # type = "lua"; + # config = ''''; + # } + # (pkgs.vimUtils.buildVimPlugin { + # pname = "kitty-scrollback.nvim"; + # version = inputs.kitty-scrollback-nvim.rev; + # src = inputs.kitty-scrollback-nvim; + # }) ] ); }; } # |----------------------------------------------------------------------| # + (mkIf cfg.vscode.enable { + programs.neovim.plugins = [ + { + + plugin = pkgs.vimPlugins.vscode-neovim; + type = "lua"; + config = '' + if exists('g:vscode') + set noloadplugins + set clipboard^=unnamed,unnamedplus + + finish + endif + ''; + } + ]; + }) + # |----------------------------------------------------------------------| # + (mkIf cfg.lsp.enable { + programs.neovim = { + # TODO + extraPackages = with pkgs; [ ]; + + plugins = with pkgs.vimPlugins; [ + { + plugin = fidget-nvim; + type = "lua"; + config = '' + require('fidget').setup{} + ''; + } + { + plugin = nvim-lspconfig; + type = "lua"; + config = '' + local lspconfig = require('lspconfig') + + lspconfig.pyright.setup{} + lspconfig.nil_ls.setup{} + lspconfig.biome.setup{} + lspconfig.clangd.setup{} + lspconfig.cmake.setup{} + lspconfig.tsserver.setup{} + lspconfig.css_variables.setup{} + lspconfig.dockerls.setup{} + lspconfig.fish_lsp.setup{} + lspconfig.giltab_ci.setup{} + lspconfig.html.setup{} + lspconfig.julials.setup{} + lspconfig.lua_ls.setup{} + lspconfig.ols.setup{} + lspconfig.sqlls.setup{} + lspconfig.docker_compose_language_service.setup{} + lspconfig.vimls.setup{} + lspconfig.yamlls.setup{} + lspconfig.rust_analyzer.setup{} + ''; + } + { + plugin = nvim-treesitter.withAllGrammars; + type = "lua"; + config = '' + require('nvim-treesitter.configs').setup{ + sync_install = false, + auto_install = false, + highlight = { + enable = true, + disable = { "latex" } + }, + incremental_selection = { + enable = true + }, + indent = { + enable = true + } + }; + ''; + } + { + plugin = copilot-lua; + type = "lua"; + config = '' + require('copilot').setup{ + suggestion = { + auto_trigger = true + } + } + ''; + } + { + plugin = render-markdown; + type = "lua"; + config = '' + require('render-markdown').setup{} + ''; + } + { + plugin = formatter-nvim; + type = "lua"; + config = '' + require('formatter') + + local augroup = vim.api.nvim_create_augroup + local autocmd = vim.api.nvim_create_autocmd + augroup("__formatter__", { clear = true }) + autocmd("BufWritePost", { + group = "__formatter__", + command = ":FormatWrite", + }) + + require("which-key").add({ + { "f", ":Format", desc = "Format file" }, + }) + ''; + } + { + plugin = nvim-lint; + type = "lua"; + config = ''''; + } + ]; + }; + + }) + # |----------------------------------------------------------------------| # ]); meta.maintainers = with localFlake.lib.maintainers; [ tsandrini ]; diff --git a/flake-parts/modules/home-manager/programs/file-managers/lf/default.nix b/flake-parts/modules/home-manager/programs/file-managers/lf/default.nix index f4d3c39..7b2b8f0 100644 --- a/flake-parts/modules/home-manager/programs/file-managers/lf/default.nix +++ b/flake-parts/modules/home-manager/programs/file-managers/lf/default.nix @@ -19,9 +19,15 @@ pkgs, ... }: -with builtins; -with lib; let + inherit (lib) + mkIf + mkMerge + mkBefore + mkEnableOption + mkOption + types + ; inherit (localFlake.lib.modules) mkOverrideAtHmModuleLevel; cfg = config.tensorfiles.hm.programs.file-managers.lf; @@ -234,7 +240,7 @@ let ); in { - options.tensorfiles.hm.programs.file-managers.lf = with types; { + options.tensorfiles.hm.programs.file-managers.lf = { enable = mkEnableOption '' Enables NixOS module that configures/handles the lf file manager. @@ -242,7 +248,7 @@ in ''; pkg = mkOption { - type = package; + type = types.package; default = pkgs.lf; description = '' Which package to use for the lf binaries. You can provide any @@ -253,7 +259,7 @@ in }; withIcons = mkOption { - type = bool; + type = types.bool; default = true; description = '' Enable the preview icons defined at ./icons for the lf file manager @@ -275,7 +281,7 @@ in }; backend = mkOption { - type = enum [ + type = types.enum [ "ueberzug" "kitty" ]; diff --git a/flake-parts/modules/home-manager/programs/file-managers/yazi.nix b/flake-parts/modules/home-manager/programs/file-managers/yazi.nix index 21e28fd..b8f08b0 100644 --- a/flake-parts/modules/home-manager/programs/file-managers/yazi.nix +++ b/flake-parts/modules/home-manager/programs/file-managers/yazi.nix @@ -14,16 +14,15 @@ # "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' { localFlake }: { config, lib, ... }: -with builtins; -with lib; let + inherit (lib) mkIf mkMerge mkEnableOption; inherit (localFlake.lib.modules) mkOverrideAtHmModuleLevel isModuleLoadedAndEnabled; cfg = config.tensorfiles.hm.programs.file-managers.yazi; _ = mkOverrideAtHmModuleLevel; in { - options.tensorfiles.hm.programs.file-managers.yazi = with types; { + options.tensorfiles.hm.programs.file-managers.yazi = { enable = mkEnableOption '' TODO ''; diff --git a/flake-parts/modules/home-manager/programs/git.nix b/flake-parts/modules/home-manager/programs/git.nix index 1ce0777..f43b87a 100644 --- a/flake-parts/modules/home-manager/programs/git.nix +++ b/flake-parts/modules/home-manager/programs/git.nix @@ -14,16 +14,15 @@ # "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' { localFlake }: { config, lib, ... }: -with builtins; -with lib; let + inherit (lib) mkIf mkMerge mkEnableOption; inherit (localFlake.lib.modules) mkOverrideAtHmModuleLevel; cfg = config.tensorfiles.hm.programs.git; _ = mkOverrideAtHmModuleLevel; in { - options.tensorfiles.hm.programs.git = with types; { + options.tensorfiles.hm.programs.git = { enable = mkEnableOption '' TODO ''; diff --git a/flake-parts/modules/home-manager/programs/gpg.nix b/flake-parts/modules/home-manager/programs/gpg.nix index 1d5a135..6b9e728 100644 --- a/flake-parts/modules/home-manager/programs/gpg.nix +++ b/flake-parts/modules/home-manager/programs/gpg.nix @@ -19,16 +19,15 @@ pkgs, ... }: -with builtins; -with lib; let - inherit (localFlake.lib.modules) mkOverrideAtHmModuleLevel isModuleLoadedAndEnabled; + inherit (lib) mkIf mkMerge mkEnableOption; + inherit (localFlake.lib.modules) mkOverrideAtHmModuleLevel; cfg = config.tensorfiles.hm.programs.gpg; _ = mkOverrideAtHmModuleLevel; in { - options.tensorfiles.hm.programs.gpg = with types; { + options.tensorfiles.hm.programs.gpg = { enable = mkEnableOption '' TODO ''; @@ -44,9 +43,10 @@ in services.gpg-agent = { enable = _ true; pinentryPackage = _ pkgs.pinentry-qt; - enableBashIntegration = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.shells.bash"); - enableFishIntegration = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.shells.fish"); - enableZshIntegration = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.shells.zsh"); + # NOTE true by default so probably unnecessary + # enableBashIntegration = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.shells.bash"); + # enableFishIntegration = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.shells.fish"); + # enableZshIntegration = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.shells.zsh"); }; programs.git.signing = { diff --git a/flake-parts/modules/home-manager/programs/newsboat.nix b/flake-parts/modules/home-manager/programs/newsboat.nix index 7e43eab..4bcaab7 100644 --- a/flake-parts/modules/home-manager/programs/newsboat.nix +++ b/flake-parts/modules/home-manager/programs/newsboat.nix @@ -19,9 +19,15 @@ pkgs, ... }: -with builtins; -with lib; let + inherit (lib) + mkIf + mkMerge + mkBefore + mkEnableOption + mkOption + types + ; inherit (localFlake.lib.modules) mkOverrideAtHmModuleLevel; cfg = config.tensorfiles.hm.programs.newsboat; @@ -57,7 +63,7 @@ let ); in { - options.tensorfiles.hm.programs.newsboat = with types; { + options.tensorfiles.hm.programs.newsboat = { enable = mkEnableOption '' TODO ''; diff --git a/flake-parts/modules/home-manager/programs/pywal.nix b/flake-parts/modules/home-manager/programs/pywal.nix index eaa334c..86d8b24 100644 --- a/flake-parts/modules/home-manager/programs/pywal.nix +++ b/flake-parts/modules/home-manager/programs/pywal.nix @@ -19,9 +19,16 @@ pkgs, ... }: -with builtins; -with lib; let + inherit (lib) + mkIf + mkMerge + mkBefore + mkEnableOption + mkOption + types + ; + inherit (lib.strings) removePrefix; inherit (localFlake.lib.modules) isModuleLoadedAndEnabled; inherit (localFlake.lib.options) mkImpermanenceEnableOption; @@ -30,7 +37,7 @@ let impermanenceCheck = (isModuleLoadedAndEnabled config "tensorfiles.hm.system.impermanence") && cfg.impermanence.enable; impermanence = if impermanenceCheck then config.tensorfiles.hm.system.impermanence else { }; - pathToRelative = strings.removePrefix "${config.home.homeDirectory}/"; + pathToRelative = removePrefix "${config.home.homeDirectory}/"; plasmaCheck = isModuleLoadedAndEnabled config "tensorfiles.hm.profiles.graphical-plasma"; kdewallpaperset = pkgs.writeShellScriptBin "kdewallpaperset" '' @@ -235,7 +242,7 @@ let ''; in { - options.tensorfiles.hm.programs.pywal = with types; { + options.tensorfiles.hm.programs.pywal = { enable = mkEnableOption '' Enables NixOS module that configures/handles pywal colorscheme generator. ''; @@ -245,7 +252,7 @@ in }; pkg = mkOption { - type = package; + type = types.package; default = pkgs.pywal; description = '' Which package to use for the pywal utilities. You can provide any diff --git a/flake-parts/modules/home-manager/programs/shadow-nix.nix b/flake-parts/modules/home-manager/programs/shadow-nix.nix index 09bebf5..c835bd7 100644 --- a/flake-parts/modules/home-manager/programs/shadow-nix.nix +++ b/flake-parts/modules/home-manager/programs/shadow-nix.nix @@ -14,16 +14,15 @@ # "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' { localFlake, inputs }: { config, lib, ... }: -with builtins; -with lib; let + inherit (lib) mkIf mkMerge mkEnableOption; inherit (localFlake.lib.modules) mkOverrideAtHmModuleLevel; cfg = config.tensorfiles.hm.programs.shadow-nix; _ = mkOverrideAtHmModuleLevel; in { - options.tensorfiles.hm.programs.shadow-nix = with types; { + options.tensorfiles.hm.programs.shadow-nix = { enable = mkEnableOption '' TODO ''; diff --git a/flake-parts/modules/home-manager/programs/shells/fish.nix b/flake-parts/modules/home-manager/programs/shells/fish.nix new file mode 100644 index 0000000..033b4ae --- /dev/null +++ b/flake-parts/modules/home-manager/programs/shells/fish.nix @@ -0,0 +1,216 @@ +# --- flake-parts/modules/programs/shells/fish.nix +# +# Author: tsandrini +# URL: https://github.com/tsandrini/tensorfiles +# License: MIT +# +# 888 .d888 d8b 888 +# 888 d88P" Y8P 888 +# 888 888 888 +# 888888 .d88b. 88888b. .d8888b .d88b. 888d888 888888 888 888 .d88b. .d8888b +# 888 d8P Y8b 888 "88b 88K d88""88b 888P" 888 888 888 d8P Y8b 88K +# 888 88888888 888 888 "Y8888b. 888 888 888 888 888 888 88888888 "Y8888b. +# Y88b. Y8b. 888 888 X88 Y88..88P 888 888 888 888 Y8b. X88 +# "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' +{ localFlake }: +{ + config, + lib, + pkgs, + ... +}: +let + inherit (lib) + mkIf + getExe + mkMerge + optional + mkBefore + mkEnableOption + mkOption + types + ; + inherit (localFlake.lib.modules) mkOverrideAtHmModuleLevel isModuleLoadedAndEnabled; + inherit (localFlake.lib.options) mkPywalEnableOption; + + cfg = config.tensorfiles.hm.programs.shells.fish; + _ = mkOverrideAtHmModuleLevel; +in +{ + options.tensorfiles.hm.programs.shells.fish = { + enable = mkEnableOption '' + Enables NixOS module that configures/handles the fish shell. + ''; + + pywal = { + enable = mkPywalEnableOption; + }; + + nixpkgsPlugins = mkOption { + type = types.listOf types.str; + default = [ + "done" + "grc" + "foreign-env" + "colored-man-pages" + "autopair" + "sponge" + "z" + # "fzf-fish" + # "forgit" + ]; + description = '' + List of fish plugins from nixpkgs to be installed. + ''; + }; + + withFzf = mkOption { + type = types.bool; + default = true; + description = '' + Whether to enable the fzf plugin + ''; + }; + + shellAliases = { + lsToEza = mkOption { + type = types.bool; + default = true; + description = '' + Enable predefined shell aliases + ''; + }; + + catToBat = mkOption { + type = types.bool; + default = true; + description = '' + Remap the cat related commands to its reworked edition bat. + ''; + }; + + findToFd = mkOption { + type = types.bool; + default = true; + description = '' + Remap the find related commands to its reworked edition fd. + ''; + }; + + grepToRipgrep = mkOption { + type = types.bool; + default = true; + description = '' + Remap the find related commands to its reworked edition fd. + ''; + }; + }; + }; + + config = mkIf cfg.enable (mkMerge [ + # |----------------------------------------------------------------------| # + { + home.packages = + with pkgs; + with cfg.shellAliases; + [ + nitch + grc + any-nix-shell + ] + ++ (optional lsToEza eza) + ++ (optional catToBat bat) + ++ (optional findToFd fd) + ++ (optional grepToRipgrep ripgrep); + + programs.fish = { + enable = _ true; + interactiveShellInit = mkBefore '' + set fish_greeting + + if test -e /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh + fenv source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh + end + if test -e ~/.nix-profile/etc/profile.d/nix.sh + fenv source ~/.nix-profile/etc/profile.d/nix.sh + end + if test -e ~/.nix-profile/etc/profile.d/hm-session-vars.sh + fenv source ~/.nix-profile/etc/profile.d/hm-session-vars.sh + end + + ${pkgs.any-nix-shell}/bin/any-nix-shell fish --info-right | source + ''; + plugins = + (optional cfg.withFzf { + name = "fzf-fish"; + inherit (pkgs.fishPlugins.fzf-fish) src; + }) + ++ (map (_plugin: { + name = _plugin; + inherit (pkgs.fishPlugins.${_plugin}) src; + }) cfg.nixpkgsPlugins); + }; + + programs.starship = { + enable = _ true; + # NOTE enabled by default so probably unnecessary + # enableBashIntegration = _ true; + # enableFishIntegration = _ true; + }; + + home.shellAliases = mkMerge [ + { + fetch = _ "${getExe pkgs.nitch}"; + g = _ "${getExe config.programs.git.package}"; + } + (mkIf cfg.shellAliases.lsToEza { + ls = _ "${getExe pkgs.eza}"; + ll = _ "${getExe pkgs.eza} -F --hyperlink --icons --group-directories-first -la --git --header --created --modified"; + tree = _ "${getExe pkgs.eza} -F --hyperlink --icons --group-directories-first -la --git --header --created --modified -T"; + }) + (mkIf cfg.shellAliases.catToBat { + cat = _ "${getExe pkgs.bat} -p --wrap=never --paging=never"; + less = _ "${getExe pkgs.bat} --paging=always"; + }) + (mkIf cfg.shellAliases.findToFd { + find = _ "${getExe pkgs.fd}"; + fd = _ "${getExe pkgs.fd}"; + }) + (mkIf cfg.shellAliases.grepToRipgrep { + grep = _ "${getExe pkgs.ripgrep}"; + list-todos = _ "${getExe pkgs.ripgrep} -g '!{.git,node_modules,result,build,dist,.idea,out,.DS_Store}' --no-follow 'TODO|FIXME' "; + }) + { fetch = _ "${getExe pkgs.nitch}"; } + ]; + } + # |----------------------------------------------------------------------| # + (mkIf cfg.withFzf { + programs.fzf = { + enable = _ true; + }; + }) + # |----------------------------------------------------------------------| # + (mkIf ((isModuleLoadedAndEnabled config "tensorfiles.hm.programs.pywal") && cfg.pywal.enable) { + programs.fish.interactiveShellInit = mkBefore '' + # Import colorscheme from 'wal' asynchronously + set -l wal_seq (cat ${config.xdg.cacheHome}/wal/sequences)"" + echo -e $wal_seq & + ''; + }) + # |----------------------------------------------------------------------| # + (mkIf cfg.shellAliases.catToBat { + programs.bat = { + enable = _ true; + }; + }) + # |----------------------------------------------------------------------| # + (mkIf cfg.shellAliases.grepToRipgrep { + programs.ripgrep = { + enable = _ true; + }; + }) + # |----------------------------------------------------------------------| # + ]); + + meta.maintainers = with localFlake.lib.maintainers; [ tsandrini ]; +} diff --git a/flake-parts/modules/home-manager/programs/shells/zsh/default.nix b/flake-parts/modules/home-manager/programs/shells/zsh/default.nix index 18ca115..05b76b0 100644 --- a/flake-parts/modules/home-manager/programs/shells/zsh/default.nix +++ b/flake-parts/modules/home-manager/programs/shells/zsh/default.nix @@ -19,9 +19,18 @@ pkgs, ... }: -with builtins; -with lib; let + inherit (lib) + mkIf + getExe + mkMerge + optional + mkBefore + mkEnableOption + mkOption + types + ; + inherit (lib.strings) removePrefix; inherit (localFlake.lib.modules) mkOverrideAtHmModuleLevel isModuleLoadedAndEnabled; inherit (localFlake.lib.options) mkPywalEnableOption mkImpermanenceEnableOption; @@ -31,10 +40,10 @@ let impermanenceCheck = (isModuleLoadedAndEnabled config "tensorfiles.hm.system.impermanence") && cfg.impermanence.enable; impermanence = if impermanenceCheck then config.tensorfiles.hm.system.impermanence else { }; - pathToRelative = strings.removePrefix "${config.home.homeDirectory}/"; + pathToRelative = removePrefix "${config.home.homeDirectory}/"; in { - options.tensorfiles.hm.programs.shells.zsh = with types; { + options.tensorfiles.hm.programs.shells.zsh = { enable = mkEnableOption '' Enables NixOS module that configures/handles the zsh shell. ''; @@ -48,7 +57,7 @@ in }; withAutocompletions = mkOption { - type = bool; + type = types.bool; default = true; description = '' Whether to enable autosuggestions/autocompletion related code @@ -66,7 +75,7 @@ in }; cfgSrc = mkOption { - type = path; + type = types.path; default = ./.; description = '' Path (or ideally, path inside a derivation) for the p10k.zsh @@ -79,7 +88,7 @@ in }; cfgFile = mkOption { - type = str; + type = types.str; default = "p10k.zsh"; description = '' Potential override of the p10k.zsh config filename. @@ -97,7 +106,7 @@ in }; plugins = mkOption { - type = listOf str; + type = types.listOf types.str; default = [ "git" "git-flow" @@ -110,7 +119,7 @@ in }; withFzf = mkOption { - type = bool; + type = types.bool; default = true; description = '' Whether to enable the fzf plugin @@ -120,7 +129,7 @@ in shellAliases = { lsToEza = mkOption { - type = bool; + type = types.bool; default = true; description = '' Enable predefined shell aliases @@ -128,7 +137,7 @@ in }; catToBat = mkOption { - type = bool; + type = types.bool; default = true; description = '' Remap the cat related commands to its reworked edition bat. @@ -136,7 +145,7 @@ in }; findToFd = mkOption { - type = bool; + type = types.bool; default = true; description = '' Remap the find related commands to its reworked edition fd. @@ -144,7 +153,7 @@ in }; grepToRipgrep = mkOption { - type = bool; + type = types.bool; default = true; description = '' Remap the find related commands to its reworked edition fd. @@ -163,8 +172,7 @@ in ++ (optional lsToEza eza) ++ (optional catToBat bat) ++ (optional findToFd fd) - ++ (optional grepToRipgrep ripgrep) - ++ (optional cfg.oh-my-zsh.withFzf fzf); + ++ (optional grepToRipgrep ripgrep); programs.zsh = { enable = _ true; @@ -207,25 +215,28 @@ in }; home.shellAliases = mkMerge [ - { fetch = _ "${pkgs.nitch}/bin/nitch"; } + { + fetch = _ "${getExe pkgs.nitch}"; + g = _ "${getExe config.programs.git.package}"; + } (mkIf cfg.shellAliases.lsToEza { - ls = _ "${pkgs.eza}/bin/eza"; - ll = _ "${pkgs.eza}/bin/eza -F --hyperlink --icons --group-directories-first -la --git --header --created --modified"; - tree = _ "${pkgs.eza}/bin/eza -F --hyperlink --icons --group-directories-first -la --git --header --created --modified -T"; + ls = _ "${getExe pkgs.eza}"; + ll = _ "${getExe pkgs.eza} -F --hyperlink --icons --group-directories-first -la --git --header --created --modified"; + tree = _ "${getExe pkgs.eza} -F --hyperlink --icons --group-directories-first -la --git --header --created --modified -T"; }) (mkIf cfg.shellAliases.catToBat { - cat = _ "${pkgs.bat}/bin/bat -p --wrap=never --paging=never"; - less = _ "${pkgs.bat}/bin/bat --paging=always"; + cat = _ "${getExe pkgs.bat} -p --wrap=never --paging=never"; + less = _ "${getExe pkgs.bat} --paging=always"; }) (mkIf cfg.shellAliases.findToFd { - find = _ "${pkgs.fd}/bin/fd"; - fd = _ "${pkgs.fd}/bin/fd"; + find = _ "${getExe pkgs.fd}"; + fd = _ "${getExe pkgs.fd}"; }) (mkIf cfg.shellAliases.grepToRipgrep { - grep = _ "${pkgs.ripgrep}/bin/rg"; - list-todos = _ "${pkgs.ripgrep}/bin/rg -g '!{.git,node_modules,result,build,dist,.idea,out,.DS_Store}' --no-follow 'TODO|FIXME' "; + grep = _ "${getExe pkgs.ripgrep}"; + list-todos = _ "${getExe pkgs.ripgrep} -g '!{.git,node_modules,result,build,dist,.idea,out,.DS_Store}' --no-follow 'TODO|FIXME' "; }) - { fetch = _ "${pkgs.nitch}/bin/nitch"; } + { fetch = _ "${getExe pkgs.nitch}"; } ]; } # |----------------------------------------------------------------------| # @@ -238,6 +249,12 @@ in ''; }) # |----------------------------------------------------------------------| # + (mkIf cfg.oh-my-zsh.withFzf { + programs.fzf = { + enable = _ true; + }; + }) + # |----------------------------------------------------------------------| # (mkIf cfg.shellAliases.catToBat { programs.bat = { enable = _ true; diff --git a/flake-parts/modules/home-manager/programs/spicetify.nix b/flake-parts/modules/home-manager/programs/spicetify.nix index 019a0b1..5cc5e9d 100644 --- a/flake-parts/modules/home-manager/programs/spicetify.nix +++ b/flake-parts/modules/home-manager/programs/spicetify.nix @@ -19,9 +19,8 @@ system, ... }: -with builtins; -with lib; let + inherit (lib) mkIf mkMerge mkEnableOption; inherit (localFlake.lib.modules) mkOverrideAtHmModuleLevel; cfg = config.tensorfiles.hm.programs.spicetify; @@ -30,7 +29,7 @@ let spicePkgs = inputs.spicetify-nix.packages.${system}.default; in { - options.tensorfiles.hm.programs.spicetify = with types; { + options.tensorfiles.hm.programs.spicetify = { enable = mkEnableOption '' TODO ''; diff --git a/flake-parts/modules/home-manager/programs/ssh.nix b/flake-parts/modules/home-manager/programs/ssh.nix index 5850526..3b12ac4 100644 --- a/flake-parts/modules/home-manager/programs/ssh.nix +++ b/flake-parts/modules/home-manager/programs/ssh.nix @@ -23,9 +23,15 @@ hostName, ... }: -with builtins; -with lib; let + inherit (lib) + mkIf + mkMerge + mkEnableOption + mkOption + types + attrByPath + ; inherit (localFlake.lib.modules) mkOverrideAtHmModuleLevel isModuleLoadedAndEnabled; cfg = config.tensorfiles.hm.programs.ssh; @@ -35,7 +41,7 @@ let (isModuleLoadedAndEnabled config "tensorfiles.hm.security.agenix") && cfg.sshKey.enable; in { - options.tensorfiles.hm.programs.ssh = with types; { + options.tensorfiles.hm.programs.ssh = { enable = mkEnableOption '' TODO ''; @@ -46,7 +52,7 @@ in ''; privateKeySecretsPath = mkOption { - type = str; + type = types.str; default = "hosts/${hostName}/users/$user/private_key"; description = '' TODO @@ -54,7 +60,7 @@ in }; privateKeyHomePath = mkOption { - type = str; + type = types.str; default = ".ssh/id_ed25519"; description = '' TODO @@ -62,7 +68,7 @@ in }; publicKeyHomePath = mkOption { - type = str; + type = types.str; default = ".ssh/id_ed25519.pub"; description = '' TODO @@ -70,7 +76,7 @@ in }; publicKeyRaw = mkOption { - type = nullOr str; + type = types.nullOr types.str; default = null; description = '' TODO @@ -78,7 +84,7 @@ in }; publicKeySecretsAttrsetKey = mkOption { - type = str; + type = types.str; default = "hosts.${hostName}.users.$user.sshKey"; description = '' TODO @@ -96,12 +102,13 @@ in programs.keychain = { enable = _ true; - enableBashIntegration = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.shells.bash"); - enableZshIntegration = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.shells.zsh"); - enableFishIntegration = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.shells.fish"); - enableNushellIntegration = _ ( - isModuleLoadedAndEnabled config "tensorfiles.hm.programs.shells.nushell" - ); + # NOTE enabled by default so probably unnecessary + # enableBashIntegration = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.shells.bash"); + # enableZshIntegration = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.shells.zsh"); + # enableFishIntegration = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.shells.fish"); + # enableNushellIntegration = _ ( + # isModuleLoadedAndEnabled config "tensorfiles.hm.programs.shells.nushell" + # ); agents = [ "ssh" ]; extraFlags = [ "--nogui" @@ -116,8 +123,8 @@ in (mkIf sshKeyCheck { age.secrets."${cfg.sshKey.privateKeySecretsPath}" = { file = _ (secretsPath + "/${cfg.sshKey.privateKeySecretsPath}.age"); - mode = _ "700"; - owner = _ config.home.username; + # mode = _ "600"; + # owner = _ config.home.username; # NOTE not available in HM module }; home.file = with cfg.sshKey; { @@ -131,7 +138,7 @@ in if publicKeyRaw != null then publicKeyRaw else - (attrsets.attrByPath (replaceStrings [ "$user" ] [ config.home.username ] ( + (attrByPath (replaceStrings [ "$user" ] [ config.home.username ] ( splitString "." publicKeySecretsAttrsetKey )) "" pubkeys); in diff --git a/flake-parts/modules/home-manager/programs/terminals/alacritty.nix b/flake-parts/modules/home-manager/programs/terminals/alacritty.nix index 00a5d89..2e8b4c3 100644 --- a/flake-parts/modules/home-manager/programs/terminals/alacritty.nix +++ b/flake-parts/modules/home-manager/programs/terminals/alacritty.nix @@ -19,16 +19,15 @@ pkgs, ... }: -with builtins; -with lib; let + inherit (lib) mkIf mkMerge mkEnableOption; inherit (localFlake.lib.modules) mkOverrideAtHmModuleLevel; cfg = config.tensorfiles.hm.programs.terminals.alacritty; _ = mkOverrideAtHmModuleLevel; in { - options.tensorfiles.hm.programs.terminals.alacritty = with types; { + options.tensorfiles.hm.programs.terminals.alacritty = { enable = mkEnableOption '' TODO ''; diff --git a/flake-parts/modules/home-manager/programs/terminals/kitty.nix b/flake-parts/modules/home-manager/programs/terminals/kitty.nix index 5a0dc80..de74b27 100644 --- a/flake-parts/modules/home-manager/programs/terminals/kitty.nix +++ b/flake-parts/modules/home-manager/programs/terminals/kitty.nix @@ -12,16 +12,22 @@ # 888 88888888 888 888 "Y8888b. 888 888 888 888 888 888 88888888 "Y8888b. # Y88b. Y8b. 888 888 X88 Y88..88P 888 888 888 888 Y8b. X88 # "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' -{ localFlake, inputs }: +{ localFlake }: { config, lib, pkgs, ... }: -with builtins; -with lib; let + inherit (lib) + mkIf + mkMerge + mkBefore + mkEnableOption + mkOption + types + ; inherit (localFlake.lib.modules) mkOverrideAtHmModuleLevel isModuleLoadedAndEnabled; cfg = config.tensorfiles.hm.programs.terminals.kitty; @@ -32,7 +38,7 @@ let && (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.editors.neovim"); in { - options.tensorfiles.hm.programs.terminals.kitty = with types; { + options.tensorfiles.hm.programs.terminals.kitty = { enable = mkEnableOption '' Enables NixOS module that configures/handles terminals.kitty colorscheme generator. ''; @@ -40,7 +46,8 @@ in nvim-scrollback = { enable = mkEnableOption '' - TODO + Enables NixOS module that configures/handles terminals.kitty neovim integration. + Requires nightly build of neovim unfortunately. '' // { default = true; @@ -48,7 +55,7 @@ in }; pkg = mkOption { - type = package; + type = types.package; default = pkgs.kitty; description = '' TODO @@ -75,10 +82,10 @@ in }; extraConfig = mkBefore '' ${ - if nvimScrollbackCheck then + if nvimScrollbackCheck then # TODO ADD kitty-scrollback.nvim input if enabling '' listen_on unix:/tmp/kitty - action_alias kitty_scrollback_nvim kitten ${inputs.kitty-scrollback-nvim}/python/kitty_scrollback_nvim.py --no-nvim-args + action_alias kitty_scrollback_nvim kitten ''${inputs.kitty-scrollback-nvim}/python/kitty_scrollback_nvim.py --no-nvim-args map ctrl+space kitty_scrollback_nvim mouse_map kitty_mod+right press ungrabbed combine : mouse_select_command_output : kitty_scrollback_nvim --config ksb_builtin_last_visited_cmd_output '' diff --git a/flake-parts/modules/home-manager/programs/terminals/wezterm.nix b/flake-parts/modules/home-manager/programs/terminals/wezterm.nix new file mode 100644 index 0000000..d9d75c6 --- /dev/null +++ b/flake-parts/modules/home-manager/programs/terminals/wezterm.nix @@ -0,0 +1,114 @@ +# --- flake-parts/modules/home-manager/programs/terminals/wezterm.nix +# +# Author: tsandrini +# URL: https://github.com/tsandrini/tensorfiles +# License: MIT +# +# 888 .d888 d8b 888 +# 888 d88P" Y8P 888 +# 888 888 888 +# 888888 .d88b. 88888b. .d8888b .d88b. 888d888 888888 888 888 .d88b. .d8888b +# 888 d8P Y8b 888 "88b 88K d88""88b 888P" 888 888 888 d8P Y8b 88K +# 888 88888888 888 888 "Y8888b. 888 888 888 888 888 888 88888888 "Y8888b. +# Y88b. Y8b. 888 888 X88 Y88..88P 888 888 888 888 Y8b. X88 +# "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' +{ localFlake, inputs }: +{ + config, + lib, + system, + ... +}: +let + inherit (lib) mkIf mkMerge mkEnableOption; + inherit (localFlake.lib.modules) mkOverrideAtHmModuleLevel isModuleLoadedAndEnabled; + inherit (localFlake.lib.options) mkPywalEnableOption; + + cfg = config.tensorfiles.hm.programs.terminals.wezterm; + _ = mkOverrideAtHmModuleLevel; + + pywalCheck = (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.pywal") && cfg.pywal.enable; + + # TODO wezterm rendering bug https://github.com/NixOS/nixpkgs/issues/336069 + nixpkgs-wezterm = import inputs.nixpkgs-wezterm { + inherit system; + config.allowUnfree = true; + }; +in +{ + options.tensorfiles.hm.programs.terminals.wezterm = { + enable = mkEnableOption '' + TODO + ''; + + pywal = { + enable = mkPywalEnableOption; + }; + }; + + config = mkIf cfg.enable (mkMerge [ + # |----------------------------------------------------------------------| # + { + programs.wezterm = { + enable = _ true; + package = _ nixpkgs-wezterm.wezterm; + # NOTE enabled by default so probably unnecessary + # enableBashIntegration = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.shells.bash"); + # enableZshIntegration = _ (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.shells.zsh"); + extraConfig = '' + local wezterm = require 'wezterm' + local config = wezterm.config_builder() + local modal = wezterm.plugin.require("https://github.com/MLFlexer/modal.wezterm") + + ${ + if pywalCheck then + '' + wezterm.add_to_config_reload_watch_list("~/.cache/wal") + config.color_scheme_dirs = {"~/.cache/wal"} + '' + else + "" + } + + config.default_cursor_style = 'BlinkingBar' + config.enable_scroll_bar = true + config.font_size = 10 + config.use_fancy_tab_bar = false + config.audible_bell = "Disabled" + config.window_padding = { + left = 5, + right = 5, + top = 5, + bottom = 5, + } + config.window_background_opacity = 0.8 + config.check_for_updates = false + config.keys = { + { + key = " ", + mods = "CTRL", + action = modal.activate_mode("copy_mode") + } + } + + wezterm.on("modal.enter", function(name, window, pane) + modal.set_right_status(window, name) + modal.set_window_title(pane, name) + end) + + wezterm.on("modal.exit", function(name, window, pane) + window:set_right_status("NOT IN A MODE") + modal.reset_window_title(pane) + end) + + modal.apply_to_config(config) + + return config + ''; + }; + } + # |----------------------------------------------------------------------| # + ]); + + meta.maintainers = with localFlake.lib.maintainers; [ tsandrini ]; +} diff --git a/flake-parts/modules/home-manager/programs/thunderbird.nix b/flake-parts/modules/home-manager/programs/thunderbird.nix index 2bf8afe..496844c 100644 --- a/flake-parts/modules/home-manager/programs/thunderbird.nix +++ b/flake-parts/modules/home-manager/programs/thunderbird.nix @@ -14,16 +14,15 @@ # "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' { localFlake }: { config, lib, ... }: -with builtins; -with lib; let + inherit (lib) mkIf mkMerge mkEnableOption; inherit (localFlake.lib.modules) mkOverrideAtHmModuleLevel; cfg = config.tensorfiles.hm.programs.thunderbird; _ = mkOverrideAtHmModuleLevel; in { - options.tensorfiles.hm.programs.thunderbird = with types; { + options.tensorfiles.hm.programs.thunderbird = { enable = mkEnableOption '' TODO ''; @@ -32,11 +31,25 @@ in config = mkIf cfg.enable (mkMerge [ # |----------------------------------------------------------------------| # { + # TODO setup systemd service + # TODO birdtray doesn't work on wayland, see + # https://github.com/gyunaev/birdtray/issues/597 + # home.packages = with pkgs; [ birdtray ]; + programs.thunderbird = { enable = _ true; - # profiles.default = { - # isDefault = _ true; - # }; + profiles.default = { + isDefault = _ true; + withExternalGnupg = _ true; + settings = { + "datareporting.healthreport.uploadEnabled" = _ false; + "calendar.timezone.useSystemTimezone" = _ true; + "privacy.donottrackheader.enabled" = _ true; + "pdfjs.enabledCache.state" = _ true; + "mailnews.default_sort_order" = _ 2; # descending + "mailnews.default_sort_type" = _ 18; # by date + }; + }; }; } # |----------------------------------------------------------------------| # diff --git a/flake-parts/modules/home-manager/programs/tmux.nix b/flake-parts/modules/home-manager/programs/tmux.nix index 46538f4..af21826 100644 --- a/flake-parts/modules/home-manager/programs/tmux.nix +++ b/flake-parts/modules/home-manager/programs/tmux.nix @@ -19,16 +19,15 @@ pkgs, ... }: -with builtins; -with lib; let + inherit (lib) mkIf mkMerge mkEnableOption; inherit (localFlake.lib.modules) mkOverrideAtHmModuleLevel; cfg = config.tensorfiles.hm.programs.tmux; _ = mkOverrideAtHmModuleLevel; in { - options.tensorfiles.hm.programs.tmux = with types; { + options.tensorfiles.hm.programs.tmux = { enable = mkEnableOption '' TODO ''; diff --git a/flake-parts/modules/home-manager/services/activitywatch.nix b/flake-parts/modules/home-manager/services/activitywatch.nix index 63f20eb..f200c03 100644 --- a/flake-parts/modules/home-manager/services/activitywatch.nix +++ b/flake-parts/modules/home-manager/services/activitywatch.nix @@ -19,16 +19,15 @@ pkgs, ... }: -with builtins; -with lib; let + inherit (lib) mkIf mkMerge mkEnableOption; inherit (localFlake.lib.modules) mkOverrideAtHmModuleLevel; cfg = config.tensorfiles.hm.services.activitywatch; _ = mkOverrideAtHmModuleLevel; in { - options.tensorfiles.hm.services.activitywatch = with types; { + options.tensorfiles.hm.services.activitywatch = { enable = mkEnableOption '' TODO ''; @@ -48,19 +47,31 @@ in }; }; - systemd.user.services.activitywatch-watcher-awatcher = { - Unit.After = [ "activitywatch.service" ]; - }; - - systemd.user.services.aw-qt = { - Unit = { - After = [ "activitywatch.service" ]; - Description = _ "Qt Tray Application for ActivityWatch"; + systemd.user.services = { + activitywatch-watcher-awatcher = { + Unit = { + After = [ "activitywatch.service" ]; + Requires = [ "activitywatch.service" ]; + }; + Service = { + ExecStartPre = "${pkgs.coreutils}/bin/sleep 5"; + }; }; - Service = { - ExecStart = _ "${pkgs.aw-qt}/bin/aw-qt"; - RestartSec = _ 5; - Restart = _ "unless-stopped"; + + aw-qt = { + Unit = { + After = [ "activitywatch.service" ]; + Requires = [ "activitywatch.service" ]; + Description = "Qt Tray Application for ActivityWatch"; + }; + Service = { + ExecStart = "${pkgs.aw-qt}/bin/aw-qt"; + Restart = "on-failure"; + RestartSec = 5; + }; + Install = { + WantedBy = [ "graphical-session.target" ]; + }; }; }; } diff --git a/flake-parts/modules/home-manager/services/dunst.nix b/flake-parts/modules/home-manager/services/dunst.nix index 33751f5..d3735f8 100644 --- a/flake-parts/modules/home-manager/services/dunst.nix +++ b/flake-parts/modules/home-manager/services/dunst.nix @@ -19,9 +19,15 @@ pkgs, ... }: -with builtins; -with lib; let + inherit (lib) + mkIf + mkMerge + isBool + isString + mkEnableOption + ; + inherit (lib.generators) toINI; inherit (localFlake.lib.modules) mkOverrideAtHmModuleLevel isModuleLoadedAndEnabled; inherit (localFlake.lib.options) mkPywalEnableOption; @@ -31,7 +37,7 @@ let pywalCheck = (isModuleLoadedAndEnabled config "tensorfiles.hm.programs.pywal") && cfg.pywal.enable; in { - options.tensorfiles.hm.services.dunst = with types; { + options.tensorfiles.hm.services.dunst = { enable = mkEnableOption '' TODO ''; @@ -66,7 +72,7 @@ in # taken from # https://github.com/nix-community/home-manager/blob/master/modules/services/dunst.nix yesNo = value: if value then "yes" else "no"; - toDunstIni = generators.toINI { + toDunstIni = toINI { mkKeyValue = key: value: let diff --git a/flake-parts/modules/home-manager/services/keepassxc.nix b/flake-parts/modules/home-manager/services/keepassxc.nix index f590cdf..807a5c7 100644 --- a/flake-parts/modules/home-manager/services/keepassxc.nix +++ b/flake-parts/modules/home-manager/services/keepassxc.nix @@ -19,9 +19,14 @@ pkgs, ... }: -with builtins; -with lib; let + inherit (lib) + mkIf + mkMerge + mkEnableOption + mkOption + types + ; inherit (localFlake.lib.modules) mkOverrideAtHmModuleLevel; cfg = config.tensorfiles.hm.services.keepassxc; @@ -30,13 +35,13 @@ in { # TODO maybe use toINIWithGlobalSection generator? however the ini config file # also contains some initial keys? I should investigate this more - options.tensorfiles.hm.services.keepassxc = with types; { + options.tensorfiles.hm.services.keepassxc = { enable = mkEnableOption '' TODO ''; pkg = mkOption { - type = package; + type = types.package; default = pkgs.keepassxc; description = '' The package to use for keepassxc. diff --git a/flake-parts/modules/home-manager/services/pywalfox-native.nix b/flake-parts/modules/home-manager/services/pywalfox-native.nix index 3d1f76d..fcf850e 100644 --- a/flake-parts/modules/home-manager/services/pywalfox-native.nix +++ b/flake-parts/modules/home-manager/services/pywalfox-native.nix @@ -19,9 +19,8 @@ pkgs, ... }: -with builtins; -with lib; let + inherit (lib) mkIf mkMerge mkEnableOption; # pywalfox-wrapper = pkgs.writeShellScriptBin "pywalfox-wrapper" '' # ${pywalfox-native}/bin/pywalfox start @@ -30,7 +29,7 @@ let cfg = config.tensorfiles.hm.services.pywalfox-native; in { - options.tensorfiles.hm.services.pywalfox-native = with types; { + options.tensorfiles.hm.services.pywalfox-native = { enable = mkEnableOption '' Enables NixOS module that configures/handles terminals.kitty colorscheme generator. ''; diff --git a/flake-parts/modules/home-manager/services/x11/picom.nix b/flake-parts/modules/home-manager/services/x11/picom.nix index 6a8374c..73222ab 100644 --- a/flake-parts/modules/home-manager/services/x11/picom.nix +++ b/flake-parts/modules/home-manager/services/x11/picom.nix @@ -14,16 +14,15 @@ # "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' { localFlake }: { config, lib, ... }: -with builtins; -with lib; let + inherit (lib) mkIf mkMerge mkEnableOption; inherit (localFlake.lib.modules) mkOverrideAtHmModuleLevel; cfg = config.tensorfiles.hm.services.x11.picom; _ = mkOverrideAtHmModuleLevel; in { - options.tensorfiles.hm.services.x11.picom = with types; { + options.tensorfiles.hm.services.x11.picom = { enable = mkEnableOption '' TODO ''; diff --git a/flake-parts/modules/home-manager/services/x11/redshift.nix b/flake-parts/modules/home-manager/services/x11/redshift.nix index 64fb658..e7d766b 100644 --- a/flake-parts/modules/home-manager/services/x11/redshift.nix +++ b/flake-parts/modules/home-manager/services/x11/redshift.nix @@ -14,16 +14,15 @@ # "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' { localFlake }: { config, lib, ... }: -with builtins; -with lib; let + inherit (lib) mkIf mkMerge mkEnableOption; inherit (localFlake.lib.modules) mkOverrideAtHmModuleLevel; cfg = config.tensorfiles.hm.services.x11.redshift; _ = mkOverrideAtHmModuleLevel; in { - options.tensorfiles.hm.services.x11.redshift = with types; { + options.tensorfiles.hm.services.x11.redshift = { enable = mkEnableOption '' TODO ''; diff --git a/flake-parts/modules/home-manager/services/x11/window-managers/xmonad/default.nix b/flake-parts/modules/home-manager/services/x11/window-managers/xmonad/default.nix index f18c290..8dedf1a 100644 --- a/flake-parts/modules/home-manager/services/x11/window-managers/xmonad/default.nix +++ b/flake-parts/modules/home-manager/services/x11/window-managers/xmonad/default.nix @@ -19,9 +19,15 @@ pkgs, ... }: -with builtins; -with lib; let + inherit (lib) + mkIf + mkMerge + mkOverride + mkEnableOption + mkOption + types + ; inherit (localFlake.lib.modules) mkOverrideAtHmModuleLevel isModuleLoadedAndEnabled; inherit (localFlake.lib.options) mkPywalEnableOption; @@ -82,7 +88,7 @@ let ''; in { - options.tensorfiles.hm.services.x11.window-managers.xmonad = with types; { + options.tensorfiles.hm.services.x11.window-managers.xmonad = { enable = mkEnableOption '' Enables NixOS module that configures/handles the xmonad window manager. ''; @@ -105,7 +111,7 @@ in }; pkg = mkOption { - type = package; + type = types.package; default = pkgs.cbatticon; description = '' Which package to use for the battery indicator. @@ -128,7 +134,7 @@ in }; pkg = mkOption { - type = package; + type = types.package; default = pkgs.playerctl; description = '' Which package to use for the playerctl utility. @@ -156,7 +162,7 @@ in }; pkg = mkOption { - type = package; + type = types.package; default = pkgs.dmenu; description = '' Which package to use for the dmenu app launcher. diff --git a/flake-parts/modules/home-manager/system/impermanence.nix b/flake-parts/modules/home-manager/system/impermanence.nix index 1d927ff..e5ab80a 100644 --- a/flake-parts/modules/home-manager/system/impermanence.nix +++ b/flake-parts/modules/home-manager/system/impermanence.nix @@ -14,21 +14,28 @@ # "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' { localFlake, inputs }: { config, lib, ... }: -with builtins; -with lib; let + inherit (lib) + mkIf + mkMerge + hasAttr + mkEnableOption + mkOption + types + ; # inherit (localFlake.lib.modules) mkOverrideAtHmModuleLevel; cfg = config.tensorfiles.hm.system.impermanence; + in # _ = mkOverrideAtHmModuleLevel; { - options.tensorfiles.hm.system.impermanence = with types; { + options.tensorfiles.hm.system.impermanence = { enable = mkEnableOption '' TODO ''; persistentRoot = mkOption { - type = path; + type = types.path; default = "/persist"; description = '' Path on the already mounted filesystem for the persistent root, that is, @@ -40,7 +47,7 @@ in }; allowOther = mkOption { - type = bool; + type = types.bool; default = false; description = '' TODO diff --git a/flake-parts/modules/nixos/default.nix b/flake-parts/modules/nixos/default.nix index c3286ca..b1d5376 100644 --- a/flake-parts/modules/nixos/default.nix +++ b/flake-parts/modules/nixos/default.nix @@ -56,6 +56,10 @@ in services_x11_desktop-managers_startx-home-manager = importApply ./services/x11/desktop-managers/startx-home-manager.nix { inherit localFlake; }; + services_mailserver = importApply ./services/mailserver.nix { + inherit localFlake inputs; + inherit (config.agenix) secretsPath; + }; # -- system -- system_impermanence = importApply ./system/impermanence.nix { inherit localFlake inputs; }; diff --git a/flake-parts/modules/nixos/misc/nix.nix b/flake-parts/modules/nixos/misc/nix.nix index 01987dd..0475c62 100644 --- a/flake-parts/modules/nixos/misc/nix.nix +++ b/flake-parts/modules/nixos/misc/nix.nix @@ -19,16 +19,20 @@ pkgs, ... }: -with builtins; -with lib; let + inherit (lib) + mkIf + mkMerge + mkBefore + mkEnableOption + ; inherit (localFlake.lib.modules) mkOverrideAtModuleLevel; cfg = config.tensorfiles.misc.nix; _ = mkOverrideAtModuleLevel; in { - options.tensorfiles.misc.nix = with types; { + options.tensorfiles.misc.nix = { enable = mkEnableOption '' Enables NixOS module that configures/handles defaults regarding nix language & nix package manager. diff --git a/flake-parts/modules/nixos/profiles/base.nix b/flake-parts/modules/nixos/profiles/base.nix index 862458c..ddbb1a9 100644 --- a/flake-parts/modules/nixos/profiles/base.nix +++ b/flake-parts/modules/nixos/profiles/base.nix @@ -14,16 +14,15 @@ # "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' { localFlake }: { config, lib, ... }: -with builtins; -with lib; let + inherit (lib) mkIf mkMerge mkEnableOption; inherit (localFlake.lib.modules) mkOverrideAtProfileLevel; cfg = config.tensorfiles.profiles.base; _ = mkOverrideAtProfileLevel; in { - options.tensorfiles.profiles.base = with types; { + options.tensorfiles.profiles.base = { enable = mkEnableOption '' Enables NixOS module that configures/handles the base system profile. diff --git a/flake-parts/modules/nixos/profiles/graphical-plasma5.nix b/flake-parts/modules/nixos/profiles/graphical-plasma5.nix index 6b727e9..f4f3e51 100644 --- a/flake-parts/modules/nixos/profiles/graphical-plasma5.nix +++ b/flake-parts/modules/nixos/profiles/graphical-plasma5.nix @@ -20,16 +20,15 @@ system, ... }: -with builtins; -with lib; let + inherit (lib) mkIf mkMerge mkEnableOption; inherit (localFlake.lib.modules) mkOverrideAtProfileLevel; cfg = config.tensorfiles.profiles.graphical-plasma5; _ = mkOverrideAtProfileLevel; in { - options.tensorfiles.profiles.graphical-plasma5 = with types; { + options.tensorfiles.profiles.graphical-plasma5 = { enable = mkEnableOption '' TODO ''; diff --git a/flake-parts/modules/nixos/profiles/graphical-plasma6.nix b/flake-parts/modules/nixos/profiles/graphical-plasma6.nix index faa6802..e476042 100644 --- a/flake-parts/modules/nixos/profiles/graphical-plasma6.nix +++ b/flake-parts/modules/nixos/profiles/graphical-plasma6.nix @@ -20,16 +20,15 @@ system, ... }: -with builtins; -with lib; let + inherit (lib) mkIf mkMerge mkEnableOption; inherit (localFlake.lib.modules) mkOverrideAtProfileLevel; cfg = config.tensorfiles.profiles.graphical-plasma6; _ = mkOverrideAtProfileLevel; in { - options.tensorfiles.profiles.graphical-plasma6 = with types; { + options.tensorfiles.profiles.graphical-plasma6 = { enable = mkEnableOption '' TODO ''; @@ -48,11 +47,13 @@ in notify-desktop # Little application that lets you send desktop notifications with one command wl-clipboard # Command-line copy/paste utilities for Wayland maim # A command-line screenshot utility + xxdiff # Graphical file and directories comparator and merge tool wireshark # Powerful network protocol analyzer pgadmin4-desktopmode # Administration and development platform for PostgreSQL. Desktop Mode mqttui # Terminal client for MQTT mqttx # Powerful cross-platform MQTT 5.0 Desktop, CLI, and WebSocket client tools + mqtt-explorer # An all-round MQTT client that provides a structured topic overview # -- UTILS NEEDED FOR INFO-CENTER -- clinfo # Print all known information about all available OpenCL platforms and devices in the system @@ -82,6 +83,7 @@ in kdePackages.plasma-browser-integration kdePackages.kaddressbook # KDE contact manager kdePackages.merkuro # A calendar application using Akonadi to sync with external services + kdePackages.kompare # Graphical File Differences Tool kdePackages.kmail # Mail client kdePackages.kmailtransport @@ -105,7 +107,8 @@ in kdePackages.kcolorpicker # Qt based Color Picker with popup menu kdePackages.kcolorchooser kdePackages.kolourpaint # Paint program - kdePackages.knotes # Popup notes + # NOTE KNotes is unmaintained upstream, + # kdePackages.knotes # Popup notes kdePackages.kalarm # Personal alarm scheduler # kdePackages.kamoso # A simple and friendly program to use your camera kdePackages.kruler # Screen ruler @@ -113,7 +116,7 @@ in okteta # A hex editor kdePackages.elisa # A simple media player for KDE kdePackages.kmag # A small Linux utility to magnify a part of the screen - kdePackages.itinerary + # kdePackages.itinerary #kdePackages.bismuth # A dynamic tiling extension for KWin # kdePackages.polonium # Auto-tiler that uses KWin 5.27+ tiling functionality diff --git a/flake-parts/modules/nixos/profiles/graphical-startx-home-manager.nix b/flake-parts/modules/nixos/profiles/graphical-startx-home-manager.nix index 55b78ff..a6d2e7b 100644 --- a/flake-parts/modules/nixos/profiles/graphical-startx-home-manager.nix +++ b/flake-parts/modules/nixos/profiles/graphical-startx-home-manager.nix @@ -14,16 +14,15 @@ # "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' { localFlake }: { config, lib, ... }: -with builtins; -with lib; let + inherit (lib) mkIf mkMerge mkEnableOption; inherit (localFlake.lib.modules) mkOverrideAtProfileLevel; cfg = config.tensorfiles.profiles.graphical-startx-home-manager; _ = mkOverrideAtProfileLevel; in { - options.tensorfiles.profiles.graphical-startx-home-manager = with types; { + options.tensorfiles.profiles.graphical-startx-home-manager = { enable = mkEnableOption '' TODO ''; diff --git a/flake-parts/modules/nixos/profiles/headless.nix b/flake-parts/modules/nixos/profiles/headless.nix index 6377777..c560321 100644 --- a/flake-parts/modules/nixos/profiles/headless.nix +++ b/flake-parts/modules/nixos/profiles/headless.nix @@ -14,16 +14,15 @@ # "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' { localFlake }: { config, lib, ... }: -with builtins; -with lib; let + inherit (lib) mkIf mkMerge mkEnableOption; inherit (localFlake.lib.modules) mkOverrideAtProfileLevel; cfg = config.tensorfiles.profiles.headless; _ = mkOverrideAtProfileLevel; in { - options.tensorfiles.profiles.headless = with types; { + options.tensorfiles.profiles.headless = { enable = mkEnableOption '' Enables NixOS module that configures/handles the headless system profile. @@ -39,8 +38,6 @@ in tensorfiles = { profiles.minimal.enable = _ true; - security.agenix.enable = _ true; - services.networking.networkmanager.enable = _ true; services.networking.ssh.enable = _ true; @@ -51,6 +48,8 @@ in }; }; }; + + services.fail2ban.enable = _ true; } # |----------------------------------------------------------------------| # ]); diff --git a/flake-parts/modules/nixos/profiles/minimal.nix b/flake-parts/modules/nixos/profiles/minimal.nix index 422a93b..357fccf 100644 --- a/flake-parts/modules/nixos/profiles/minimal.nix +++ b/flake-parts/modules/nixos/profiles/minimal.nix @@ -19,16 +19,15 @@ pkgs, ... }: -with builtins; -with lib; let + inherit (lib) mkIf mkMerge mkEnableOption; inherit (localFlake.lib.modules) mkOverrideAtProfileLevel; cfg = config.tensorfiles.profiles.minimal; _ = mkOverrideAtProfileLevel; in { - options.tensorfiles.profiles.minimal = with types; { + options.tensorfiles.profiles.minimal = { enable = mkEnableOption '' Enables NixOS module that configures/handles the minimal system profile. diff --git a/flake-parts/modules/nixos/profiles/packages-extra.nix b/flake-parts/modules/nixos/profiles/packages-extra.nix index 2c98572..c456222 100644 --- a/flake-parts/modules/nixos/profiles/packages-extra.nix +++ b/flake-parts/modules/nixos/profiles/packages-extra.nix @@ -20,16 +20,15 @@ system, ... }: -with builtins; -with lib; let + inherit (lib) mkIf mkMerge mkEnableOption; inherit (localFlake.lib.modules) mkOverrideAtProfileLevel; cfg = config.tensorfiles.profiles.packages-extra; _ = mkOverrideAtProfileLevel; in { - options.tensorfiles.profiles.packages-extra = with types; { + options.tensorfiles.profiles.packages-extra = { enable = mkEnableOption '' Enables NixOS module that configures/handles the packages-extra system profile. @@ -94,6 +93,7 @@ in xz # A general-purpose data compression software, successor of LZMA zip # Compressor/archiver for creating and modifying zipfiles zstd # Zstandard real-time compression algorithm + lha # LHa is an archiver and compressor using the LZSS and Huffman encoding compression algorithms # -- MISC -- sqlite # A self-contained, serverless, zero-configuration, transactional SQL database engine @@ -103,6 +103,8 @@ in adminer # Database management in a single PHP file # -- PACKAGING UTILS -- + rpm # RPM Package Manager + dpkg # Debian package manager # nix-ld # Run unpatched dynamic binaries on NixOS appimage-run # Run unpatched AppImages on NixOS libappimage # Implements functionality for dealing with AppImage files diff --git a/flake-parts/modules/nixos/programs/nh.nix b/flake-parts/modules/nixos/programs/nh.nix index 68b9e9d..0b25139 100644 --- a/flake-parts/modules/nixos/programs/nh.nix +++ b/flake-parts/modules/nixos/programs/nh.nix @@ -14,16 +14,15 @@ # "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' { localFlake }: { config, lib, ... }: -with builtins; -with lib; let + inherit (lib) mkIf mkMerge mkEnableOption; inherit (localFlake.lib.modules) mkOverrideAtModuleLevel; cfg = config.tensorfiles.programs.nh; _ = mkOverrideAtModuleLevel; in { - options.tensorfiles.programs.nh = with types; { + options.tensorfiles.programs.nh = { enable = mkEnableOption '' TODO ''; diff --git a/flake-parts/modules/nixos/programs/shadow-nix.nix b/flake-parts/modules/nixos/programs/shadow-nix.nix index 4d07304..f4574a2 100644 --- a/flake-parts/modules/nixos/programs/shadow-nix.nix +++ b/flake-parts/modules/nixos/programs/shadow-nix.nix @@ -14,16 +14,15 @@ # "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' { localFlake, inputs }: { config, lib, ... }: -with builtins; -with lib; let + inherit (lib) mkIf mkMerge mkEnableOption; inherit (localFlake.lib.modules) mkOverrideAtModuleLevel; cfg = config.tensorfiles.programs.shadow-nix; _ = mkOverrideAtModuleLevel; in { - options.tensorfiles.programs.shadow-nix = with types; { + options.tensorfiles.programs.shadow-nix = { enable = mkEnableOption '' TODO ''; diff --git a/flake-parts/modules/nixos/programs/wayland/ags.nix b/flake-parts/modules/nixos/programs/wayland/ags.nix index db80df2..79a8895 100644 --- a/flake-parts/modules/nixos/programs/wayland/ags.nix +++ b/flake-parts/modules/nixos/programs/wayland/ags.nix @@ -14,16 +14,21 @@ # "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' { localFlake, inputs }: { config, lib, ... }: -with builtins; -with lib; let + inherit (lib) + mkIf + mkMerge + genAttrs + attrNames + mkEnableOption + ; inherit (localFlake.lib.modules) mkOverrideAtModuleLevel; cfg = config.tensorfiles.programs.wayland.ags; _ = mkOverrideAtModuleLevel; in { - options.tensorfiles.programs.wayland.ags = with types; { + options.tensorfiles.programs.wayland.ags = { enable = mkEnableOption '' Enables NixOS module that configures/handles the ags.nix app launcher diff --git a/flake-parts/modules/nixos/programs/wayland/anyrun.nix b/flake-parts/modules/nixos/programs/wayland/anyrun.nix index 1a7cebf..726652c 100644 --- a/flake-parts/modules/nixos/programs/wayland/anyrun.nix +++ b/flake-parts/modules/nixos/programs/wayland/anyrun.nix @@ -19,16 +19,24 @@ pkgs, ... }: -with builtins; -with lib; let + inherit (lib) + mkIf + mkMerge + genAttrs + attrNames + mkBefore + mkEnableOption + ; inherit (localFlake.lib.modules) mkOverrideAtModuleLevel; cfg = config.tensorfiles.programs.wayland.anyrun; _ = mkOverrideAtModuleLevel; + + getUserTerminal = { cfg }: cfg.home.sessionVariables.terminal; in { - options.tensorfiles.programs.wayland.anyrun = with types; { + options.tensorfiles.programs.wayland.anyrun = { enable = mkEnableOption '' Enables NixOS module that configures/handles the anyrun app launcher diff --git a/flake-parts/modules/nixos/programs/wayland/waybar/default.nix b/flake-parts/modules/nixos/programs/wayland/waybar/default.nix index c497dd6..e11b0cd 100644 --- a/flake-parts/modules/nixos/programs/wayland/waybar/default.nix +++ b/flake-parts/modules/nixos/programs/wayland/waybar/default.nix @@ -19,16 +19,21 @@ system, ... }: -with builtins; -with lib; let + inherit (lib) + mkIf + mkMerge + mkEnableOption + genAttrs + attrNames + ; inherit (localFlake.lib.modules) mkOverrideAtModuleLevel; cfg = config.tensorfiles.programs.wayland.waybar; _ = mkOverrideAtModuleLevel; in { - options.tensorfiles.programs.wayland.waybar = with types; { + options.tensorfiles.programs.wayland.waybar = { enable = mkEnableOption '' Enables NixOS module that configures/handles the waybar wayland bar. ''; diff --git a/flake-parts/modules/nixos/services/mailserver.nix b/flake-parts/modules/nixos/services/mailserver.nix new file mode 100644 index 0000000..d7c3e3d --- /dev/null +++ b/flake-parts/modules/nixos/services/mailserver.nix @@ -0,0 +1,281 @@ +# --- flake-parts/modules/nixos/services/mailserver.nix +# +# Author: tsandrini +# URL: https://github.com/tsandrini/tensorfiles +# License: MIT +# +# 888 .d888 d8b 888 +# 888 d88P" Y8P 888 +# 888 888 888 +# 888888 .d88b. 88888b. .d8888b .d88b. 888d888 888888 888 888 .d88b. .d8888b +# 888 d8P Y8b 888 "88b 88K d88""88b 888P" 888 888 888 d8P Y8b 88K +# 888 88888888 888 888 "Y8888b. 888 888 888 888 888 888 88888888 "Y8888b. +# Y88b. Y8b. 888 888 X88 Y88..88P 888 888 888 888 Y8b. X88 +# "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' +{ + localFlake, + inputs, + secretsPath, +}: +{ + config, + lib, + hostName, + ... +}: +let + inherit (lib) + mkIf + types + mkMerge + mkEnableOption + mkOption + attrNames + ; + inherit (localFlake.lib.modules) mkOverrideAtProfileLevel isModuleLoadedAndEnabled; + inherit (localFlake.lib.options) mkAgenixEnableOption mkSubmodulesOption; + inherit (localFlake.lib.strings) sanitizeEmailForNixStorePath; + inherit (localFlake.lib.attrsets) mapToAttrsAndMerge; + + cfg = config.tensorfiles.services.mailserver; + _ = mkOverrideAtProfileLevel; + + agenixCheck = (isModuleLoadedAndEnabled config "tensorfiles.security.agenix") && cfg.agenix.enable; + + defaultDomain = "tsandrini.sh"; +in +{ + options.tensorfiles.services.mailserver = { + enable = mkEnableOption '' + Enables NixOS module that configures/handles the mailserver system profile. + ''; + + agenix = { + enable = mkAgenixEnableOption; + }; + + baseDomain = mkOption { + type = types.str; + default = defaultDomain; + description = '' + The base domain of the mailserver. + ''; + }; + + additionalDomains = mkOption { + type = types.listOf types.str; + default = [ + "tsandrini.cz" + "tsandrini.tech" + ]; + description = '' + Additional domains that the mailserver should handle. + ''; + }; + + accounts = + mkSubmodulesOption (_account: { + enable = + mkEnableOption '' + Enables the account. + '' + // { + default = true; + }; + + agenixHashedPasswordFile = { + enable = + mkEnableOption '' + Enables the use of age encrypted hashed password file for the account. + '' + // { + default = true; + }; + + hashedPasswordFileSecretsPath = mkOption { + type = types.str; + default = "hosts/${hostName}/mailserver/${sanitizeEmailForNixStorePath _account}"; + description = '' + The path where the age encrypted hashed password file secrets are stored. + ''; + }; + }; + + aliases = mkOption { + type = types.listOf types.str; + default = [ ]; + description = '' + A list of aliases for the account. + ''; + }; + }) + // { + default = { + "t@${defaultDomain}" = { + aliases = [ + "default@${defaultDomain}" + "tsandrini@${defaultDomain}" + "ts@${defaultDomain}" + "st@${defaultDomain}" + "sandrint@${defaultDomain}" + "sandrini@${defaultDomain}" + "sandrinit@${defaultDomain}" + "tom@${defaultDomain}" + "tomas@${defaultDomain}" + "personal@${defaultDomain}" + ]; + }; + "business@${defaultDomain}" = { + aliases = [ + "work@${defaultDomain}" + "jobs@${defaultDomain}" + "offers@${defaultDomain}" + "prace@${defaultDomain}" + ]; + }; + "security@${defaultDomain}" = { + aliases = [ + "admin@${defaultDomain}" + "info@${defaultDomain}" + ]; + }; + "shopping@${defaultDomain}" = { + aliases = [ ]; + }; + "newsletters@${defaultDomain}" = { + aliases = [ ]; + }; + }; + }; + + roundcube = { + enable = mkEnableOption '' + Enables integration with the Roundcube webmail client. + ''; + }; + + rspamd-ui = { + enable = mkEnableOption '' + Enables the Rspamd web UI. + ''; + + agenixBasicAuthFile = { + enable = + mkEnableOption '' + Enables the use of age encrypted basic auth file for the Rspamd UI. + '' + // { + default = true; + }; + + basicAuthFileSecretsPath = mkOption { + type = types.str; + default = "hosts/${hostName}/mailserver/rspamd-ui-basic-auth-file"; + description = '' + The path where the age encrypted basic auth file secrets are stored. + ''; + }; + }; + }; + }; + + # -------------------------- + imports = with inputs; [ nixos-mailserver.nixosModules.default ]; + + config = mkIf cfg.enable (mkMerge [ + # |----------------------------------------------------------------------| # + { + mailserver = { + enable = _ true; + fqdn = _ "mail.${cfg.baseDomain}"; + domains = [ cfg.baseDomain ] ++ cfg.additionalDomains; + + loginAccounts = mapToAttrsAndMerge (attrNames cfg.accounts) ( + _account: + let + accountCfg = cfg.accounts.${_account}; + in + { + "${_account}" = mkIf accountCfg.enable { + inherit (accountCfg) aliases; + hashedPasswordFile = mkIf (agenixCheck && accountCfg.agenixHashedPasswordFile.enable) ( + _ config.age.secrets."${accountCfg.agenixHashedPasswordFile.hashedPasswordFileSecretsPath}".path + ); + }; + } + ); + + # Use Let's Encrypt certificates. Note that this needs to set up a stripped + # down nginx and opens port 80. + certificateScheme = _ "acme-nginx"; + enableManageSieve = _ true; + virusScanning = _ true; + }; + security.acme.acceptTerms = _ true; + security.acme.defaults.email = _ "security@${cfg.baseDomain}"; + } + # |----------------------------------------------------------------------| # + (mkIf cfg.roundcube.enable { + services.roundcube = { + enable = _ true; + # this is the url of the vhost, not necessarily the same as the fqdn of + # the mailserver + hostName = _ "webmail.${cfg.baseDomain}"; + extraConfig = '' + # starttls needed for authentication, so the fqdn required to match + # the certificate + $config['smtp_server'] = "tls://${config.mailserver.fqdn}"; + $config['smtp_user'] = "%u"; + $config['smtp_pass'] = "%p"; + ''; + }; + services.nginx.enable = _ true; + }) + # |----------------------------------------------------------------------| # + (mkIf cfg.rspamd-ui.enable { + services.nginx.virtualHosts.rspamd = { + forceSSL = _ true; + enableACME = _ true; + basicAuthFile = mkIf (agenixCheck && cfg.rspamd-ui.agenixBasicAuthFile.enable) ( + _ config.age.secrets."${cfg.rspamd-ui.agenixBasicAuthFile.basicAuthFileSecretsPath}".path + ); + serverName = _ "rspamd.${cfg.baseDomain}"; + locations = { + "/" = { + proxyPass = _ "http://unix:/run/rspamd/worker-controller.sock:/"; + }; + }; + }; + services.nginx.enable = _ true; + }) + # |----------------------------------------------------------------------| # + (mkIf (agenixCheck && cfg.rspamd-ui.enable && cfg.rspamd-ui.agenixBasicAuthFile.enable) { + age.secrets."${cfg.rspamd-ui.agenixBasicAuthFile.basicAuthFileSecretsPath}" = { + file = _ (secretsPath + "/${cfg.rspamd-ui.agenixBasicAuthFile.basicAuthFileSecretsPath}.age"); + owner = _ config.services.nginx.user; + }; + }) + # |----------------------------------------------------------------------| # + (mkIf agenixCheck { + age.secrets = mapToAttrsAndMerge (attrNames cfg.accounts) ( + _account: + let + accountCfg = cfg.accounts.${_account}; + in + { + "${accountCfg.agenixHashedPasswordFile.hashedPasswordFileSecretsPath}" = + mkIf (accountCfg.enable && accountCfg.agenixHashedPasswordFile.enable) + { + file = _ ( + secretsPath + "/${accountCfg.agenixHashedPasswordFile.hashedPasswordFileSecretsPath}.age" + ); + # mode = _ "600"; + }; + } + ); + }) + # |----------------------------------------------------------------------| # + ]); + + meta.maintainers = with localFlake.lib.maintainers; [ tsandrini ]; +} diff --git a/flake-parts/modules/nixos/services/networking/networkmanager.nix b/flake-parts/modules/nixos/services/networking/networkmanager.nix index 1fbab74..1a341f5 100644 --- a/flake-parts/modules/nixos/services/networking/networkmanager.nix +++ b/flake-parts/modules/nixos/services/networking/networkmanager.nix @@ -14,9 +14,8 @@ # "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' { localFlake }: { config, lib, ... }: -with builtins; -with lib; let + inherit (lib) mkIf mkMerge mkEnableOption; inherit (localFlake.lib.modules) mkOverrideAtModuleLevel isModuleLoadedAndEnabled; inherit (localFlake.lib.options) mkImpermanenceEnableOption; @@ -28,7 +27,7 @@ let impermanence = if impermanenceCheck then config.tensorfiles.system.impermanence else { }; in { - options.tensorfiles.services.networking.networkmanager = with types; { + options.tensorfiles.services.networking.networkmanager = { enable = mkEnableOption '' Enables NixOS module that configures/handles the networkmanager service. ''; diff --git a/flake-parts/modules/nixos/services/networking/ssh.nix b/flake-parts/modules/nixos/services/networking/ssh.nix index 4dd891d..2c0ec7e 100644 --- a/flake-parts/modules/nixos/services/networking/ssh.nix +++ b/flake-parts/modules/nixos/services/networking/ssh.nix @@ -14,16 +14,22 @@ # "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' { localFlake }: { config, lib, ... }: -with builtins; -with lib; let + inherit (lib) + mkIf + mkMerge + mkBefore + mkEnableOption + mkOption + types + ; inherit (localFlake.lib.modules) mkOverrideAtModuleLevel; cfg = config.tensorfiles.services.networking.ssh; _ = mkOverrideAtModuleLevel; in { - options.tensorfiles.services.networking.ssh = with types; { + options.tensorfiles.services.networking.ssh = { enable = mkEnableOption '' Enables NixOS module that configures/handles everything related to ssh, that is remote access, messagess, ssh-agents and ssh-keys with the @@ -39,7 +45,7 @@ in ''; hostKey = mkOption { - type = attrs; + type = types.attrs; default = { type = "ed25519"; path = "/etc/ssh/ssh_host_ed25519_key"; diff --git a/flake-parts/modules/nixos/services/wayland/window-managers/hyprland.nix b/flake-parts/modules/nixos/services/wayland/window-managers/hyprland.nix index 3755bd0..e87aab0 100644 --- a/flake-parts/modules/nixos/services/wayland/window-managers/hyprland.nix +++ b/flake-parts/modules/nixos/services/wayland/window-managers/hyprland.nix @@ -20,10 +20,18 @@ system, ... }: -with builtins; -with lib; let + inherit (lib) + mkIf + mkMerge + hasAttr + genAttrs + attrNames + optional + mkEnableOption + ; inherit (localFlake.lib.modules) mkOverrideAtModuleLevel; + inherit (localFlake.lib.options) mkUsersSettingsOption mkPywalEnableOption; cfg = config.tensorfiles.services.wayland.window-managers.hyprland; _ = mkOverrideAtModuleLevel; @@ -35,34 +43,31 @@ let in { # TODO needs to be rewrited - options.tensorfiles.services.wayland.window-managers.hyprland = - with types; - with tensorfiles.options; - { - enable = mkEnableOption '' - TODO - ''; - - home = { - enable = mkHomeEnableOption; + options.tensorfiles.services.wayland.window-managers.hyprland = { + enable = mkEnableOption '' + TODO + ''; - settings = mkHomeSettingsOption (_user: { - pywal = { - enable = mkPywalEnableOption; - }; + userSettings = mkUsersSettingsOption (_user: { + pywal = { + enable = mkPywalEnableOption; + }; - ags = { - enable = mkAlreadyEnabledOption '' - Enable ags hyprland integration + ags = { + enable = + mkEnableOption '' + Enable ags hyprland integration - This includes - 1. launching ags - 2. mediakeys via ags - ''; + This includes + 1. launching ags + 2. mediakeys via ags + '' + // { + default = true; }; - }); }; - }; + }); + }; config = mkIf cfg.enable (mkMerge [ # |----------------------------------------------------------------------| # @@ -72,7 +77,7 @@ in package = _ inputs.hyprland.packages.${system}.hyprland; }; - home-manager.users = genAttrs (attrNames cfg.home.settings) ( + home-manager.users = genAttrs (attrNames cfg.userSettings) ( _user: let userCfg = cfg.home.settings.${_user}; diff --git a/flake-parts/modules/nixos/services/x11/desktop-managers/startx-home-manager.nix b/flake-parts/modules/nixos/services/x11/desktop-managers/startx-home-manager.nix index 5b7c093..0f0e113 100644 --- a/flake-parts/modules/nixos/services/x11/desktop-managers/startx-home-manager.nix +++ b/flake-parts/modules/nixos/services/x11/desktop-managers/startx-home-manager.nix @@ -19,16 +19,15 @@ pkgs, ... }: -with builtins; -with lib; let + inherit (lib) mkIf mkMerge mkEnableOption; inherit (localFlake.lib.modules) mkOverrideAtModuleLevel; cfg = config.tensorfiles.services.x11.desktop-managers.startx-home-manager; _ = mkOverrideAtModuleLevel; in { - options.tensorfiles.services.x11.desktop-managers.startx-home-manager = with types; { + options.tensorfiles.services.x11.desktop-managers.startx-home-manager = { enable = mkEnableOption '' Enable NixOS module that sets up the simple startx X11 displayManager with home-manager as the default session. This can be useful in cases where you diff --git a/flake-parts/modules/nixos/system/impermanence.nix b/flake-parts/modules/nixos/system/impermanence.nix index 8f88574..3595096 100644 --- a/flake-parts/modules/nixos/system/impermanence.nix +++ b/flake-parts/modules/nixos/system/impermanence.nix @@ -14,9 +14,16 @@ # "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' { localFlake, inputs }: { config, lib, ... }: -with builtins; -with lib; let + inherit (lib) + mkIf + mkMerge + hasAttr + mkBefore + mkEnableOption + mkOption + types + ; inherit (localFlake.lib.modules) mkOverrideAtModuleLevel isModuleLoadedAndEnabled; inherit (localFlake.lib.options) mkAgenixEnableOption; @@ -26,7 +33,7 @@ let agenixCheck = (isModuleLoadedAndEnabled config "tensorfiles.security.agenix") && cfg.agenix.enable; in { - options.tensorfiles.system.impermanence = with types; { + options.tensorfiles.system.impermanence = { enable = mkEnableOption '' Enables NixOS module that configures/handles the persistence ecosystem. Doing so enables other modules to automatically use the persistence instead @@ -38,7 +45,7 @@ in }; disableSudoLectures = mkOption { - type = bool; + type = types.bool; default = true; description = '' Whether to disable the default sudo lectures that would be @@ -47,7 +54,7 @@ in }; persistentRoot = mkOption { - type = path; + type = types.path; default = "/persist"; description = '' Path on the already mounted filesystem for the persistent root, that is, @@ -59,7 +66,7 @@ in }; allowOther = mkOption { - type = bool; + type = types.bool; default = false; description = '' TODO @@ -87,7 +94,7 @@ in ''; rootPartition = mkOption { - type = path; + type = types.path; default = "/dev/sda1"; description = '' The dev path for the main btrfs formatted root partition that is @@ -96,7 +103,7 @@ in }; rootSubvolume = mkOption { - type = str; + type = types.str; default = "root"; description = '' The main root btrfs subvolume path that is going to be reset to @@ -105,7 +112,7 @@ in }; blankRootSnapshot = mkOption { - type = str; + type = types.str; default = "root-blank"; description = '' The btrfs snapshot of the main rootSubvolume. You will probably @@ -117,7 +124,7 @@ in }; mountpoint = mkOption { - type = path; + type = types.path; default = "/mnt"; description = '' Temporary mountpoint that should be used for mounting and resetting diff --git a/flake-parts/modules/nixos/system/users.nix b/flake-parts/modules/nixos/system/users.nix index 57e3197..282ceac 100644 --- a/flake-parts/modules/nixos/system/users.nix +++ b/flake-parts/modules/nixos/system/users.nix @@ -23,9 +23,20 @@ hostName, ... }: -with builtins; -with lib; let + inherit (lib) + mkIf + mkMerge + genAttrs + attrNames + optional + filter + mkEnableOption + mkOption + types + splitString + ; + inherit (lib.attrsets) attrByPath; inherit (localFlake.lib.modules) mkOverrideAtModuleLevel isModuleLoadedAndEnabled; inherit (localFlake.lib.options) mkImpermanenceEnableOption @@ -41,7 +52,7 @@ let in { # TODO move bluetooth dir to hardware - options.tensorfiles.system.users = with types; { + options.tensorfiles.system.users = { enable = mkEnableOption '' Enables NixOS module that sets up the basis for the userspace, that is declarative management, basis for the home directories and also @@ -56,75 +67,81 @@ in enable = mkAgenixEnableOption; }; - usersSettings = mkUsersSettingsOption (_user: { - isSudoer = mkOption { - type = bool; - default = true; - description = '' - Add user to sudoers (ie the `wheel` group) - ''; - }; - - isNixTrusted = mkOption { - type = bool; - default = false; - description = '' - Whether the user has the ability to connect to the nix daemon - and gain additional privileges for working with nix (like adding - binary cache) - ''; - }; - - extraGroups = mkOption { - type = listOf str; - default = [ ]; - description = '' - Any additional groups which the user should be a part of. This is - basically just a passthrough for `users.users..extraGroups` - for convenience. - ''; - }; - - agenixPassword = { - enable = mkEnableOption '' - TODO - ''; - - passwordSecretsPath = mkOption { - type = str; - default = "hosts/${hostName}/users/${_user}/system-password"; + usersSettings = + mkUsersSettingsOption (_user: { + isSudoer = mkOption { + type = types.bool; + default = true; description = '' - TODO + Add user to sudoers (ie the `wheel` group) ''; }; - }; - authorizedKeys = { - enable = - mkEnableOption '' - TODO - '' - // { - default = true; - }; + isNixTrusted = mkOption { + type = types.bool; + default = false; + description = '' + Whether the user has the ability to connect to the nix daemon + and gain additional privileges for working with nix (like adding + binary cache) + ''; + }; - keysRaw = mkOption { - type = listOf str; + extraGroups = mkOption { + type = types.listOf types.str; default = [ ]; description = '' - TODO + Any additional groups which the user should be a part of. This is + basically just a passthrough for `users.users..extraGroups` + for convenience. ''; }; - keysSecretsAttrsetKey = mkOption { - type = str; - default = "hosts.${hostName}.users.${_user}.authorizedKeys"; - description = '' + agenixPassword = { + enable = mkEnableOption '' TODO ''; + + passwordSecretsPath = mkOption { + type = types.str; + default = "hosts/${hostName}/users/${_user}/system-password"; + description = '' + TODO + ''; + }; + }; + + authorizedKeys = { + enable = + mkEnableOption '' + TODO + '' + // { + default = true; + }; + + keysRaw = mkOption { + type = types.listOf types.str; + default = [ ]; + description = '' + TODO + ''; + }; + + keysSecretsAttrsetKey = mkOption { + type = types.str; + default = "hosts.${hostName}.users.${_user}.authorizedKeys"; + description = '' + TODO + ''; + }; + }; + }) + // { + default = { + "root" = { }; }; }; - }); }; config = mkIf cfg.enable (mkMerge [ @@ -151,9 +168,7 @@ in openssh.authorizedKeys.keys = with userCfg.authorizedKeys; - (mkIf enable ( - keysRaw ++ (attrsets.attrByPath (splitString "." keysSecretsAttrsetKey) [ ] pubkeys) - )); + (mkIf enable (keysRaw ++ (attrByPath (splitString "." keysSecretsAttrsetKey) [ ] pubkeys))); } ); } @@ -168,8 +183,8 @@ in { "${passwordSecretsPath}" = mkIf enable { file = _ (secretsPath + "/${passwordSecretsPath}.age"); - mode = _ "700"; owner = _ _user; + # mode = _ "600"; }; } ); diff --git a/flake-parts/modules/nixos/tasks/nix-garbage-collect.nix b/flake-parts/modules/nixos/tasks/nix-garbage-collect.nix index 6c6a6bf..4677f1f 100644 --- a/flake-parts/modules/nixos/tasks/nix-garbage-collect.nix +++ b/flake-parts/modules/nixos/tasks/nix-garbage-collect.nix @@ -14,16 +14,15 @@ # "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' { localFlake }: { config, lib, ... }: -with builtins; -with lib; let + inherit (lib) mkIf mkMerge mkEnableOption; inherit (localFlake.lib.modules) mkOverrideAtModuleLevel; cfg = config.tensorfiles.tasks.nix-garbage-collect; _ = mkOverrideAtModuleLevel; in { - options.tensorfiles.tasks.nix-garbage-collect = with types; { + options.tensorfiles.tasks.nix-garbage-collect = { enable = mkEnableOption '' Enables NixOS module that configures the task handling periodic nix store garbage collection. diff --git a/flake-parts/modules/nixos/tasks/system-autoupgrade.nix b/flake-parts/modules/nixos/tasks/system-autoupgrade.nix index d890806..60944c2 100644 --- a/flake-parts/modules/nixos/tasks/system-autoupgrade.nix +++ b/flake-parts/modules/nixos/tasks/system-autoupgrade.nix @@ -19,16 +19,15 @@ hostName, ... }: -with builtins; -with lib; let + inherit (lib) mkIf mkMerge mkEnableOption; inherit (localFlake.lib.modules) mkOverrideAtModuleLevel; cfg = config.tensorfiles.tasks.system-autoupgrade; _ = mkOverrideAtModuleLevel; in { - options.tensorfiles.tasks.system-autoupgrade = with types; { + options.tensorfiles.tasks.system-autoupgrade = { enable = mkEnableOption '' Module enabling system wide nixpkgs & host autoupgrade Enables NixOS module that configures the task handling periodix nixpkgs diff --git a/flake-parts/modules/nixvim/auto_cmds.nix b/flake-parts/modules/nixvim/auto_cmds.nix new file mode 100644 index 0000000..29807b8 --- /dev/null +++ b/flake-parts/modules/nixvim/auto_cmds.nix @@ -0,0 +1,80 @@ +# --- flake-parts/modules/nixvim/auto_cmds.nix +# +# Author: tsandrini +# URL: https://github.com/tsandrini/tensorfiles +# License: MIT +# +# 888 .d888 d8b 888 +# 888 d88P" Y8P 888 +# 888 888 888 +# 888888 .d88b. 88888b. .d8888b .d88b. 888d888 888888 888 888 .d88b. .d8888b +# 888 d8P Y8b 888 "88b 88K d88""88b 888P" 888 888 888 d8P Y8b 88K +# 888 88888888 888 888 "Y8888b. 888 888 888 888 888 888 88888888 "Y8888b. +# Y88b. Y8b. 888 888 X88 Y88..88P 888 888 888 888 Y8b. X88 +# "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' +{ localFlake }: +{ + config, + lib, + ... +}: +let + inherit (lib) mkIf mkMerge mkEnableOption; + + cfg = config.tensorfiles.nixvim.auto_cmds; +in +{ + options.tensorfiles.nixvim.auto_cmds = { + enable = mkEnableOption '' + TODO + ''; + }; + + config = mkIf cfg.enable (mkMerge [ + # |----------------------------------------------------------------------| # + { + autoGroups = { + highlight_yank = { }; + restore_cursor = { }; + }; + + autoCmd = [ + { + group = "highlight_yank"; + event = [ "TextYankPost" ]; + pattern = "*"; + callback = { + __raw = '' + function() + vim.highlight.on_yank() + end + ''; + }; + } + ## from NVChad https://nvchad.com/docs/recipes (this autocmd will restore the cursor position when opening a file) + { + group = "restore_cursor"; + event = [ "BufReadPost" ]; + pattern = "*"; + callback = { + __raw = '' + function() + if + vim.fn.line "'\"" > 1 + and vim.fn.line "'\"" <= vim.fn.line "$" + and vim.bo.filetype ~= "commit" + and vim.fn.index({ "xxd", "gitrebase" }, vim.bo.filetype) == -1 + then + vim.cmd "normal! g`\"" + end + end + ''; + }; + } + ]; + } + # |----------------------------------------------------------------------| # + ]); + + meta.maintainers = with localFlake.lib.maintainers; [ tsandrini ]; +} diff --git a/flake-parts/modules/nixvim/default.nix b/flake-parts/modules/nixvim/default.nix new file mode 100644 index 0000000..e2ec112 --- /dev/null +++ b/flake-parts/modules/nixvim/default.nix @@ -0,0 +1,46 @@ +# --- flake-parts/modules/nixvim/default.nix +# +# Author: tsandrini +# URL: https://github.com/tsandrini/tensorfiles +# License: MIT +# +# 888 .d888 d8b 888 +# 888 d88P" Y8P 888 +# 888 888 888 +# 888888 .d88b. 88888b. .d8888b .d88b. 888d888 888888 888 888 .d88b. .d8888b +# 888 d8P Y8b 888 "88b 88K d88""88b 888P" 888 888 888 d8P Y8b 88K +# 888 88888888 888 888 "Y8888b. 888 888 888 888 888 888 88888888 "Y8888b. +# Y88b. Y8b. 888 888 X88 Y88..88P 888 888 888 888 Y8b. X88 +# "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' +{ + lib, + self, + inputs, + ... +}: +let + inherit (lib) mkOption types; + inherit (inputs.flake-parts.lib) importApply; + localFlake = self; +in +{ + options.flake.nixvimModules = mkOption { + type = types.lazyAttrsOf types.unspecified; + default = { }; + }; + + config.flake.nixvimModules = { + auto_cmds = importApply ./auto_cmds.nix { inherit localFlake; }; + keymaps = importApply ./keymaps.nix { inherit localFlake; }; + settings = importApply ./settings.nix { inherit localFlake; }; + + plugins_git_neogit = importApply ./plugins/git/neogit.nix { inherit localFlake; }; + + plugins_utils_telescope = importApply ./plugins/utils/telescope.nix { inherit localFlake; }; + plugins_utils_hop = importApply ./plugins/utils/hop.nix { inherit localFlake; }; + plugins_utils_which-key = importApply ./plugins/utils/which-key.nix { inherit localFlake; }; + + plugins_editor_neo-tree = importApply ./plugins/editor/neo-tree.nix { inherit localFlake; }; + plugins_editor_undotree = importApply ./plugins/editor/undotree.nix { inherit localFlake; }; + }; +} diff --git a/flake-parts/modules/nixvim/keymaps.nix b/flake-parts/modules/nixvim/keymaps.nix new file mode 100644 index 0000000..c1b1088 --- /dev/null +++ b/flake-parts/modules/nixvim/keymaps.nix @@ -0,0 +1,247 @@ +# --- flake-parts/modules/nixvim/keymaps.nix +# +# Author: tsandrini +# URL: https://github.com/tsandrini/tensorfiles +# License: MIT +# +# 888 .d888 d8b 888 +# 888 d88P" Y8P 888 +# 888 888 888 +# 888888 .d88b. 88888b. .d8888b .d88b. 888d888 888888 888 888 .d88b. .d8888b +# 888 d8P Y8b 888 "88b 88K d88""88b 888P" 888 888 888 d8P Y8b 88K +# 888 88888888 888 888 "Y8888b. 888 888 888 888 888 888 88888888 "Y8888b. +# Y88b. Y8b. 888 888 X88 Y88..88P 888 888 888 888 Y8b. X88 +# "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' +{ localFlake }: +{ + config, + lib, + ... +}: +let + inherit (lib) mkIf mkMerge mkEnableOption; + inherit (localFlake.lib.modules) mkOverrideAtNixvimModuleLevel; + + cfg = config.tensorfiles.nixvim.keymaps; + _ = mkOverrideAtNixvimModuleLevel; +in +{ + options.tensorfiles.nixvim.keymaps = { + enable = mkEnableOption '' + TODO + ''; + + remapEsc = { + enable = + mkEnableOption '' + TODO + '' + // { + default = true; + }; + }; + + tabNavigation = { + enable = + mkEnableOption '' + TODO + '' + // { + default = true; + }; + }; + + windowNavigation = { + enable = + mkEnableOption '' + TODO + '' + // { + default = true; + }; + }; + }; + + config = mkIf cfg.enable (mkMerge [ + # |----------------------------------------------------------------------| # + { + globals.mapleader = _ " "; + globals.maplocalleader = _ " "; + } + # |----------------------------------------------------------------------| # + { + keymaps = [ + { + mode = "n"; + key = "w"; + action = ":w"; + options = { + desc = "Save file."; + }; + } + { + mode = "n"; + key = "q"; + action = ":q"; + options = { + desc = "Quit file."; + }; + } + { + mode = "n"; + key = "r"; + action = ":noh"; + options = { + desc = "Remove highlights."; + }; + } + { + mode = "n"; + key = "t"; + action = ":terminal"; + options = { + desc = "Open terminal."; + }; + } + { + mode = "n"; + key = "Q"; + action = ":qall"; + options = { + desc = "Quit all windows."; + }; + } + ]; + } + # |----------------------------------------------------------------------| # + (mkIf cfg.windowNavigation.enable { + keymaps = [ + { + mode = "n"; + key = "s"; + action = ":split"; + options = { + desc = "Split window below."; + }; + } + { + mode = "n"; + key = "v"; + action = ":vsplit"; + options = { + desc = "Split window right."; + }; + } + { + mode = "n"; + key = "h"; + action = "h"; + options = { + desc = "Window left."; + }; + } + { + mode = "n"; + key = "j"; + action = "j"; + options = { + desc = "Window below."; + }; + } + { + mode = "n"; + key = "k"; + action = "k"; + options = { + desc = "Window above."; + }; + } + { + mode = "n"; + key = "l"; + action = "l"; + options = { + desc = "Window right."; + }; + } + ]; + }) + # |----------------------------------------------------------------------| # + (mkIf cfg.tabNavigation.enable { + keymaps = [ + { + mode = "n"; + key = "J"; + action = ":tabprevious"; + options = { + desc = "Move to previous tab."; + }; + } + { + mode = "n"; + key = "K"; + action = ":tabnext"; + options = { + desc = "Move to next tab."; + }; + } + { + mode = "n"; + key = "n"; + action = ":tabnew"; + options = { + desc = "New tab."; + }; + } + ]; + }) + # |----------------------------------------------------------------------| # + (mkIf cfg.remapEsc.enable { + keymaps = [ + { + mode = [ + "i" + "c" + # "v" # NOTE doesnt work and produces visual delay + ]; + key = "jk"; + action = ""; + options = { + silent = true; + }; + } + { + mode = [ + "i" + "c" + # "v" # NOTE doesnt work and produces visual delay + ]; + key = "kj"; + action = ""; + options = { + silent = true; + }; + } + { + mode = "t"; + key = "jk"; + action = ""; + options = { + silent = true; + }; + } + { + mode = "t"; + key = "kj"; + action = ""; + options = { + silent = true; + }; + } + ]; + }) + # |----------------------------------------------------------------------| # + ]); + + meta.maintainers = with localFlake.lib.maintainers; [ tsandrini ]; +} diff --git a/flake-parts/modules/nixvim/plugins/editor/neo-tree.nix b/flake-parts/modules/nixvim/plugins/editor/neo-tree.nix new file mode 100644 index 0000000..84e1f04 --- /dev/null +++ b/flake-parts/modules/nixvim/plugins/editor/neo-tree.nix @@ -0,0 +1,121 @@ +# --- flake-parts/modules/nixvim/plugins/editor/neo-tree.nix +# +# Author: tsandrini +# URL: https://github.com/tsandrini/tensorfiles +# License: MIT +# +# 888 .d888 d8b 888 +# 888 d88P" Y8P 888 +# 888 888 888 +# 888888 .d88b. 88888b. .d8888b .d88b. 888d888 888888 888 888 .d88b. .d8888b +# 888 d8P Y8b 888 "88b 88K d88""88b 888P" 888 888 888 d8P Y8b 88K +# 888 88888888 888 888 "Y8888b. 888 888 888 888 888 888 88888888 "Y8888b. +# Y88b. Y8b. 888 888 X88 Y88..88P 888 888 888 888 Y8b. X88 +# "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' +{ localFlake }: +{ + config, + lib, + pkgs, + ... +}: +let + inherit (lib) mkIf mkMerge mkEnableOption; + inherit (localFlake.lib.modules) mkOverrideAtNixvimModuleLevel; + + cfg = config.tensorfiles.nixvim.plugins.editor.neo-tree; + _ = mkOverrideAtNixvimModuleLevel; +in +{ + options.tensorfiles.nixvim.plugins.editor.neo-tree = { + enable = mkEnableOption '' + TODO + ''; + }; + + config = mkIf cfg.enable (mkMerge [ + # |----------------------------------------------------------------------| # + { + extraPlugins = with pkgs.vimPlugins; [ + nvim-web-devicons + nui-nvim + ]; + + keymaps = [ + { + mode = "n"; + key = "m"; + action = "Neotree"; + options = { + silent = true; + desc = "Neotree Open"; + }; + } + { + mode = "n"; + key = "b"; + action = "Neotree buffers"; + options = { + silent = true; + desc = "Neotree buffers"; + }; + } + ]; + + plugins.neo-tree = { + enable = _ true; + closeIfLastWindow = _ true; + addBlankLineAtTop = _ false; + enableGitStatus = _ true; + enableRefreshOnWrite = _ true; + enableDiagnostics = _ true; + sources = [ + "filesystem" + "buffers" + "git_status" + "document_symbols" + ]; + + filesystem = { + bindToCwd = _ false; + useLibuvFileWatcher = _ true; + followCurrentFile = { + enabled = _ true; + }; + }; + + window = { + mappings = { + "l" = "open"; + "h" = "close_node"; + }; + }; + + defaultComponentConfigs = { + indent = { + withExpanders = _ true; + expanderCollapsed = _ ""; + expanderExpanded = _ " "; + expanderHighlight = _ "NeoTreeExpander"; + }; + gitStatus = { + symbols = { + added = _ " "; + conflict = _ "󰩌 "; + deleted = _ "󱂥"; + ignored = _ " "; + modified = _ " "; + renamed = _ "󰑕"; + staged = _ "󰩍"; + unstaged = _ ""; + untracked = _ ""; + }; + }; + }; + }; + } + # |----------------------------------------------------------------------| # + ]); + + meta.maintainers = with localFlake.lib.maintainers; [ tsandrini ]; +} diff --git a/flake-parts/modules/nixvim/plugins/editor/undotree.nix b/flake-parts/modules/nixvim/plugins/editor/undotree.nix new file mode 100644 index 0000000..2520973 --- /dev/null +++ b/flake-parts/modules/nixvim/plugins/editor/undotree.nix @@ -0,0 +1,58 @@ +# --- flake-parts/modules/nixvim/plugins/editor/undotree.nix +# +# Author: tsandrini +# URL: https://github.com/tsandrini/tensorfiles +# License: MIT +# +# 888 .d888 d8b 888 +# 888 d88P" Y8P 888 +# 888 888 888 +# 888888 .d88b. 88888b. .d8888b .d88b. 888d888 888888 888 888 .d88b. .d8888b +# 888 d8P Y8b 888 "88b 88K d88""88b 888P" 888 888 888 d8P Y8b 88K +# 888 88888888 888 888 "Y8888b. 888 888 888 888 888 888 88888888 "Y8888b. +# Y88b. Y8b. 888 888 X88 Y88..88P 888 888 888 888 Y8b. X88 +# "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' +{ localFlake }: +{ + config, + lib, + ... +}: +let + inherit (lib) mkIf mkMerge mkEnableOption; + inherit (localFlake.lib.modules) mkOverrideAtNixvimModuleLevel; + + cfg = config.tensorfiles.nixvim.plugins.editor.undotree; + _ = mkOverrideAtNixvimModuleLevel; +in +{ + options.tensorfiles.nixvim.plugins.editor.undotree = { + enable = mkEnableOption '' + TODO + ''; + }; + + config = mkIf cfg.enable (mkMerge [ + # |----------------------------------------------------------------------| # + { + keymaps = [ + { + mode = "n"; + key = "u"; + action = "UndotreeToggle"; + options = { + desc = "Neogit"; + }; + } + ]; + + plugins.undotree = { + enable = _ true; + settings = { }; + }; + } + # |----------------------------------------------------------------------| # + ]); + + meta.maintainers = with localFlake.lib.maintainers; [ tsandrini ]; +} diff --git a/flake-parts/modules/nixvim/plugins/git/neogit.nix b/flake-parts/modules/nixvim/plugins/git/neogit.nix new file mode 100644 index 0000000..f013f31 --- /dev/null +++ b/flake-parts/modules/nixvim/plugins/git/neogit.nix @@ -0,0 +1,76 @@ +# --- flake-parts/modules/nixvim/plugins/git/neogit.nix +# +# Author: tsandrini +# URL: https://github.com/tsandrini/tensorfiles +# License: MIT +# +# 888 .d888 d8b 888 +# 888 d88P" Y8P 888 +# 888 888 888 +# 888888 .d88b. 88888b. .d8888b .d88b. 888d888 888888 888 888 .d88b. .d8888b +# 888 d8P Y8b 888 "88b 88K d88""88b 888P" 888 888 888 d8P Y8b 88K +# 888 88888888 888 888 "Y8888b. 888 888 888 888 888 888 88888888 "Y8888b. +# Y88b. Y8b. 888 888 X88 Y88..88P 888 888 888 888 Y8b. X88 +# "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' +{ localFlake }: +{ + config, + lib, + ... +}: +let + inherit (lib) mkIf mkMerge mkEnableOption; + inherit (localFlake.lib.modules) mkOverrideAtNixvimModuleLevel; + + cfg = config.tensorfiles.nixvim.plugins.git.neogit; + _ = mkOverrideAtNixvimModuleLevel; +in +{ + options.tensorfiles.nixvim.plugins.git.neogit = { + enable = mkEnableOption '' + TODO + ''; + }; + + config = mkIf cfg.enable (mkMerge [ + # |----------------------------------------------------------------------| # + { + keymaps = [ + { + mode = "n"; + key = "gg"; + action = "Neogit"; + options = { + desc = "Neogit"; + }; + } + { + mode = "n"; + key = "gb"; + action = "Neogit branch"; + options = { + desc = "Neogit branch"; + }; + } + { + mode = "n"; + key = "gF"; + action = "Neogit fetch"; + options = { + desc = "Neogit fetch"; + }; + } + ]; + + plugins.neogit = { + enable = _ true; + settings = + { + }; + }; + } + # |----------------------------------------------------------------------| # + ]); + + meta.maintainers = with localFlake.lib.maintainers; [ tsandrini ]; +} diff --git a/flake-parts/modules/nixvim/plugins/utils/hop.nix b/flake-parts/modules/nixvim/plugins/utils/hop.nix new file mode 100644 index 0000000..01a1c33 --- /dev/null +++ b/flake-parts/modules/nixvim/plugins/utils/hop.nix @@ -0,0 +1,61 @@ +# --- flake-parts/modules/nixvim/plugins/utils/hop.nix +# +# Author: tsandrini +# URL: https://github.com/tsandrini/tensorfiles +# License: MIT +# +# 888 .d888 d8b 888 +# 888 d88P" Y8P 888 +# 888 888 888 +# 888888 .d88b. 88888b. .d8888b .d88b. 888d888 888888 888 888 .d88b. .d8888b +# 888 d8P Y8b 888 "88b 88K d88""88b 888P" 888 888 888 d8P Y8b 88K +# 888 88888888 888 888 "Y8888b. 888 888 888 888 888 888 88888888 "Y8888b. +# Y88b. Y8b. 888 888 X88 Y88..88P 888 888 888 888 Y8b. X88 +# "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' +{ localFlake }: +{ + config, + lib, + ... +}: +let + inherit (lib) mkIf mkMerge mkEnableOption; + inherit (localFlake.lib.modules) mkOverrideAtNixvimModuleLevel; + + cfg = config.tensorfiles.nixvim.plugins.utils.hop; + _ = mkOverrideAtNixvimModuleLevel; +in +{ + options.tensorfiles.nixvim.plugins.utils.hop = { + enable = mkEnableOption '' + TODO + ''; + }; + + config = mkIf cfg.enable (mkMerge [ + # |----------------------------------------------------------------------| # + { + keymaps = [ + { + mode = "n"; + key = ","; + action = "HopChar2"; + options = { + desc = "Hop to char 2"; + silent = true; + }; + } + ]; + + plugins.hop = { + enable = _ true; + settings = { + keys = _ "asdfghjkl"; + }; + }; + } + # |----------------------------------------------------------------------| # + ]); + + meta.maintainers = with localFlake.lib.maintainers; [ tsandrini ]; +} diff --git a/flake-parts/modules/nixvim/plugins/utils/telescope.nix b/flake-parts/modules/nixvim/plugins/utils/telescope.nix new file mode 100644 index 0000000..147cb7f --- /dev/null +++ b/flake-parts/modules/nixvim/plugins/utils/telescope.nix @@ -0,0 +1,151 @@ +# --- flake-parts/modules/nixvim/plugins/utils/telescope.nix +# +# Author: tsandrini +# URL: https://github.com/tsandrini/tensorfiles +# License: MIT +# +# 888 .d888 d8b 888 +# 888 d88P" Y8P 888 +# 888 888 888 +# 888888 .d88b. 88888b. .d8888b .d88b. 888d888 888888 888 888 .d88b. .d8888b +# 888 d8P Y8b 888 "88b 88K d88""88b 888P" 888 888 888 d8P Y8b 88K +# 888 88888888 888 888 "Y8888b. 888 888 888 888 888 888 88888888 "Y8888b. +# Y88b. Y8b. 888 888 X88 Y88..88P 888 888 888 888 Y8b. X88 +# "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' +{ localFlake }: +{ + config, + lib, + ... +}: +let + inherit (lib) mkIf mkMerge mkEnableOption; + inherit (localFlake.lib.modules) mkOverrideAtNixvimModuleLevel; + + cfg = config.tensorfiles.nixvim.plugins.utils.telescope; + _ = mkOverrideAtNixvimModuleLevel; +in +{ + options.tensorfiles.nixvim.plugins.utils.telescope = { + enable = mkEnableOption '' + TODO + ''; + }; + + config = mkIf cfg.enable (mkMerge [ + # |----------------------------------------------------------------------| # + { + keymaps = [ + { + mode = "n"; + key = "/"; + action = "Telescope live_grep"; + options = { + desc = "Grep in project"; + silent = true; + }; + } + { + mode = "n"; + key = ""; + action = "Telescope find_files"; + options = { + desc = "Find files"; + silent = true; + }; + } + { + mode = "n"; + key = "pb"; + action = "Telescope buffers"; + options = { + desc = "Telescope buffers"; + silent = true; + }; + } + { + mode = "n"; + key = "pg"; + action = "Telescope git_commits"; + options = { + desc = "Telescope git commits"; + silent = true; + }; + } + { + mode = "n"; + key = "pf"; + action = "Telescope find_files"; + options = { + desc = "Telescope files"; + silent = true; + }; + } + { + mode = "n"; + key = "ph"; + action = "Telescope man_pages"; + options = { + desc = "Telescope man pages"; + silent = true; + }; + } + { + mode = "n"; + key = "pl"; + action = "Telescope colorschemes"; + options = { + desc = "Telescope colorschemes"; + silent = true; + }; + } + { + mode = "n"; + key = "pc"; + action = "Telescope commands"; + options = { + desc = "Telescope commands"; + silent = true; + }; + } + { + mode = "n"; + key = "ps"; + action = "Telescope snippets"; + options = { + desc = "Telescope snippets"; + silent = true; + }; + } + ]; + + plugins.telescope = { + enable = _ true; + extensions = { + file-browser = { + enable = _ true; + }; + fzf-native = { + enable = _ true; + }; + }; + settings = { + defaults.prompt_prefix = _ "🔍"; + }; + }; + + extraConfigLua = '' + require("telescope").setup{ + pickers = { + colorscheme = { + enable_preview = true + } + } + } + ''; + } + # |----------------------------------------------------------------------| # + ]); + + meta.maintainers = with localFlake.lib.maintainers; [ tsandrini ]; +} diff --git a/flake-parts/modules/nixvim/plugins/utils/which-key.nix b/flake-parts/modules/nixvim/plugins/utils/which-key.nix new file mode 100644 index 0000000..cf331b0 --- /dev/null +++ b/flake-parts/modules/nixvim/plugins/utils/which-key.nix @@ -0,0 +1,50 @@ +# --- flake-parts/modules/nixvim/plugins/utils/which-key.nix +# +# Author: tsandrini +# URL: https://github.com/tsandrini/tensorfiles +# License: MIT +# +# 888 .d888 d8b 888 +# 888 d88P" Y8P 888 +# 888 888 888 +# 888888 .d88b. 88888b. .d8888b .d88b. 888d888 888888 888 888 .d88b. .d8888b +# 888 d8P Y8b 888 "88b 88K d88""88b 888P" 888 888 888 d8P Y8b 88K +# 888 88888888 888 888 "Y8888b. 888 888 888 888 888 888 88888888 "Y8888b. +# Y88b. Y8b. 888 888 X88 Y88..88P 888 888 888 888 Y8b. X88 +# "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' +{ localFlake }: +{ + config, + lib, + ... +}: +let + inherit (lib) mkIf mkMerge mkEnableOption; + inherit (localFlake.lib.modules) mkOverrideAtNixvimModuleLevel; + + cfg = config.tensorfiles.nixvim.plugins.utils.which-key; + _ = mkOverrideAtNixvimModuleLevel; +in +{ + options.tensorfiles.nixvim.plugins.utils.which-key = { + enable = mkEnableOption '' + TODO + ''; + }; + + config = mkIf cfg.enable (mkMerge [ + # |----------------------------------------------------------------------| # + { + plugins.which-key = { + enable = _ true; + settings = { + preset = _ "modern"; + delay = _ 100; + }; + }; + } + # |----------------------------------------------------------------------| # + ]); + + meta.maintainers = with localFlake.lib.maintainers; [ tsandrini ]; +} diff --git a/flake-parts/modules/nixvim/settings.nix b/flake-parts/modules/nixvim/settings.nix new file mode 100644 index 0000000..e139918 --- /dev/null +++ b/flake-parts/modules/nixvim/settings.nix @@ -0,0 +1,85 @@ +# --- flake-parts/modules/nixvim/settings.nix +# +# Author: tsandrini +# URL: https://github.com/tsandrini/tensorfiles +# License: MIT +# +# 888 .d888 d8b 888 +# 888 d88P" Y8P 888 +# 888 888 888 +# 888888 .d88b. 88888b. .d8888b .d88b. 888d888 888888 888 888 .d88b. .d8888b +# 888 d8P Y8b 888 "88b 88K d88""88b 888P" 888 888 888 d8P Y8b 88K +# 888 88888888 888 888 "Y8888b. 888 888 888 888 888 888 88888888 "Y8888b. +# Y88b. Y8b. 888 888 X88 Y88..88P 888 888 888 888 Y8b. X88 +# "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' +{ localFlake }: +{ + config, + lib, + ... +}: +let + inherit (lib) mkIf mkMerge mkEnableOption; + inherit (localFlake.lib.modules) mkOverrideAtNixvimModuleLevel; + + cfg = config.tensorfiles.nixvim.settings; + _ = mkOverrideAtNixvimModuleLevel; +in +{ + options.tensorfiles.nixvim.settings = { + enable = mkEnableOption '' + TODO + ''; + }; + + config = mkIf cfg.enable (mkMerge [ + # |----------------------------------------------------------------------| # + { + clipboard = { + providers.wl-copy.enable = true; + }; + + opts = { + number = _ true; # Show line numbers + relativenumber = _ true; # Show relative line numbers + clipboard = _ "unnamedplus"; # Use the system clipboard + + formatoptions = [ + "l" # Long lines are not broken in insert mode + ]; + rulerformat = _ "%l:%c"; # Show the line and column number of the cursor + foldenable = _ false; # Disable folding by default + + wildmenu = _ true; # Show a list of matching files when tab completing + # TODO maybe use wilder.nvim plugin + wildmode = _ "longest:full,full"; # Tab complete as much as possible + wildignorecase = _ true; # Ignore case when tab completing + + tabstop = _ 2; # Number of spaces that represent a + softtabstop = _ 0; # Number of spaces that a counts for while editing + expandtab = _ true; # Use spaces instead of tabs + shiftwidth = _ 2; # Number of spaces to use for each step of (auto)indent + smarttab = _ true; # Pressing the Tab key behaves differently depending on the context + smartindent = _ true; # Enable smart indentation + shiftround = _ true; # Round indent to multiple of shiftwidth + + scrolloff = _ 8; # Minimum number of screen lines to keep above and below the cursor + + list = _ true; # Show invisible characters + listchars = { + tab = _ "»·"; # Show tabs as » + trail = _ "•"; # Show trailing spaces as · + extends = _ "#"; # Show lines that wrap as # + nbsp = _ "."; # Show non-breaking spaces as . + }; + + ignorecase = _ true; # Ignore case when searching + smartcase = _ true; # Override 'ignorecase' if the search pattern contains uppercase characters + showmatch = _ true; # Highlight matching parenthesis + }; + } + # |----------------------------------------------------------------------| # + ]); + + meta.maintainers = with localFlake.lib.maintainers; [ tsandrini ]; +} diff --git a/flake-parts/nixvim/base-config/default.nix b/flake-parts/nixvim/base-config/default.nix new file mode 100644 index 0000000..165e086 --- /dev/null +++ b/flake-parts/nixvim/base-config/default.nix @@ -0,0 +1,92 @@ +# --- flake-parts/nixvim/base-config/default.nix +# +# Author: tsandrini +# URL: https://github.com/tsandrini/tensorfiles +# License: MIT +# +# 888 .d888 d8b 888 +# 888 d88P" Y8P 888 +# 888 888 888 +# 888888 .d88b. 88888b. .d8888b .d88b. 888d888 888888 888 888 .d88b. .d8888b +# 888 d8P Y8b 888 "88b 88K d88""88b 888P" 888 888 888 d8P Y8b 88K +# 888 88888888 888 888 "Y8888b. 888 888 888 888 888 888 88888888 "Y8888b. +# Y88b. Y8b. 888 888 X88 Y88..88P 888 888 888 888 Y8b. X88 +# "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' +_: +{ lib, ... }: +let + _ = lib.mkOverride 500; +in +{ + imports = [ ]; + + tensorfiles.nixvim = { + settings.enable = true; + keymaps.enable = true; + auto_cmds.enable = true; + + plugins = { + utils.telescope.enable = true; + utils.hop.enable = true; + utils.which-key.enable = true; + + editor.neo-tree.enable = true; + editor.undotree.enable = true; + + git.neogit.enable = true; + }; + }; + + # plugins.transparent.enable = true; + + plugins.mini = { + enable = _ true; + modules = { + ai = { }; + icons = { }; + indentscope = { }; + pairs = { }; + tabline = { }; # TODO I hate how it shows all buffers + cursorword = { }; + comment = { }; + move = { + mappings = { + left = ""; + right = ""; + down = ""; + up = ""; + }; + }; + hipatterns = { + highlighters = { + fixme = { + pattern = "%f[%w]()FIXME()%f[%W]"; + group = "MiniHipatternsFixme"; + }; + hack = { + pattern = "%f[%w]()HACK()%f[%W]"; + group = "MiniHipatternsHack"; + }; + todo = { + pattern = "%f[%w]()TODO()%f[%W]"; + group = "MiniHipatternsTodo"; + }; + note = { + pattern = "%f[%w]()NOTE()%f[%W]"; + group = "MiniHipatternsNote"; + }; + }; + }; + + # Stuff needed for statusline + statusline = { }; + git = { }; + diff = { }; + }; + }; + + performance = { + combinePlugins.enable = true; + byteCompileLua.enable = true; + }; +} diff --git a/flake-parts/nixvim/default.nix b/flake-parts/nixvim/default.nix new file mode 100644 index 0000000..a7d51ba --- /dev/null +++ b/flake-parts/nixvim/default.nix @@ -0,0 +1,80 @@ +# --- flake-parts/nixvim/default.nix +# +# Author: tsandrini +# URL: https://github.com/tsandrini/tensorfiles +# License: MIT +# +# 888 .d888 d8b 888 +# 888 d88P" Y8P 888 +# 888 888 888 +# 888888 .d88b. 88888b. .d8888b .d88b. 888d888 888888 888 888 .d88b. .d8888b +# 888 d8P Y8b 888 "88b 88K d88""88b 888P" 888 888 888 d8P Y8b 88K +# 888 88888888 888 888 "Y8888b. 888 888 888 888 888 888 88888888 "Y8888b. +# Y88b. Y8b. 888 888 X88 Y88..88P 888 888 888 888 Y8b. X88 +# "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' +{ + lib, + inputs, + config, + ... +}: +let + inherit (lib) mkOption types; + inherit (inputs.flake-parts.lib) importApply mkPerSystemOption; + + mkNixvimConfiguration = + name: pkgs: + { + extraSpecialArgs ? { }, + extraModules ? [ ], + configImportArgs ? { }, + }: + { + inherit pkgs extraSpecialArgs; + module = + { ... }: + { + imports = [ + (importApply ./${name} configImportArgs) + ] ++ extraModules ++ (lib.attrValues config.flake.nixvimModules); + }; + }; +in +{ + options.perSystem = mkPerSystemOption (_: { + options.nixvimConfigurations = mkOption { + type = types.lazyAttrsOf types.unspecified; + default = { }; + }; + }); + + config = { + perSystem = + { + pkgs, + config, + system, + ... + }: + let + inherit (inputs.nixvim.lib.${system}.check) mkTestDerivationFromNixvimModule; + inherit (inputs.nixvim.legacyPackages.${system}) makeNixvimWithModule; + in + { + nixvimConfigurations = { + base-config = mkNixvimConfiguration "base-config" pkgs { }; + vanilla-config = mkNixvimConfiguration "vanilla-config" pkgs { }; + }; + + packages = { + nvim-base-config = makeNixvimWithModule config.nixvimConfigurations."base-config"; + nvim-vanilla-config = makeNixvimWithModule config.nixvimConfigurations."vanilla-config"; + }; + + checks = { + nvim-base-config = mkTestDerivationFromNixvimModule config.nixvimConfigurations."base-config"; + nvim-vanilla-config = mkTestDerivationFromNixvimModule config.nixvimConfigurations."vanilla-config"; + }; + }; + }; +} diff --git a/flake-parts/nixvim/vanilla-config/default.nix b/flake-parts/nixvim/vanilla-config/default.nix new file mode 100644 index 0000000..7a04dfb --- /dev/null +++ b/flake-parts/nixvim/vanilla-config/default.nix @@ -0,0 +1,24 @@ +# --- flake-parts/nixvim/vanilla-config/default.nix +# +# Author: tsandrini +# URL: https://github.com/tsandrini/tensorfiles +# License: MIT +# +# 888 .d888 d8b 888 +# 888 d88P" Y8P 888 +# 888 888 888 +# 888888 .d88b. 88888b. .d8888b .d88b. 888d888 888888 888 888 .d88b. .d8888b +# 888 d8P Y8b 888 "88b 88K d88""88b 888P" 888 888 888 d8P Y8b 88K +# 888 88888888 888 888 "Y8888b. 888 888 888 888 888 888 88888888 "Y8888b. +# Y88b. Y8b. 888 888 X88 Y88..88P 888 888 888 888 Y8b. X88 +# "Y888 "Y8888 888 888 88888P' "Y88P" 888 888 888 888 "Y8888 88888P' +_: +{ ... }: +{ + imports = [ ]; + + performance = { + combinePlugins.enable = true; + byteCompileLua.enable = true; + }; +} diff --git a/flake-parts/shells/dev.nix b/flake-parts/shells/dev.nix index 0ddfdfe..f9ced0c 100644 --- a/flake-parts/shells/dev.nix +++ b/flake-parts/shells/dev.nix @@ -26,6 +26,7 @@ gh, nh, nix-fast-build, + deploy-rs, disko, rc2nix, cachix, @@ -80,6 +81,7 @@ mkShell { rc2nix # KDE: Convert rc files to nix expressions cachix # Command-line client for Nix binary cache hosting https://cachix.org nix-fast-build # Combine the power of nix-eval-jobs with nix-output-monitor to speed-up your evaluation and building process + deploy-rs # Multi-profile Nix-flake deploy tool ]; shellHook = '' diff --git a/flake.lock b/flake.lock index 29fea88..25e3b04 100644 --- a/flake.lock +++ b/flake.lock @@ -10,11 +10,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1722339003, - "narHash": "sha256-ZeS51uJI30ehNkcZ4uKqT4ZDARPyqrHADSKAwv5vVCU=", + "lastModified": 1723293904, + "narHash": "sha256-b+uqzj+Wa6xgMS9aNbX4I+sXeb5biPDi39VgvSFqFvU=", "owner": "ryantm", "repo": "agenix", - "rev": "3f1dae074a12feb7327b4bf43cbac0d124488bb7", + "rev": "f6291c5935fdc4e0bef208cfc0dcab7e3f7a1c41", "type": "github" }, "original": { @@ -26,11 +26,11 @@ "arkenfox-user-js": { "flake": false, "locked": { - "lastModified": 1720504163, - "narHash": "sha256-kjrqlMqA75bsJE1BnBydOsahHff86beTwQwaTSwAC9c=", + "lastModified": 1724661688, + "narHash": "sha256-XLswsa2u2qsUPsLYRYn6lwis7VwSjAW6BRNdI4brbSM=", "owner": "arkenfox", "repo": "user.js", - "rev": "ff5c959cb9b5a65ede9aab82b00cbb283b160e14", + "rev": "f906f7f3b41fe3f6aaa744980431f4fdcd086379", "type": "github" }, "original": { @@ -39,6 +39,38 @@ "type": "github" } }, + "betterfox": { + "flake": false, + "locked": { + "lastModified": 1724206118, + "narHash": "sha256-hpkEO5BhMVtINQG8HN4xqfas/R6q5pYPZiFK8bilIDs=", + "owner": "yokoffing", + "repo": "Betterfox", + "rev": "e026ed7d3a763c5d3f96c2680d7bc3340831af4f", + "type": "github" + }, + "original": { + "owner": "yokoffing", + "repo": "Betterfox", + "type": "github" + } + }, + "blobs": { + "flake": false, + "locked": { + "lastModified": 1604995301, + "narHash": "sha256-wcLzgLec6SGJA8fx1OEN1yV/Py5b+U5iyYpksUY/yLw=", + "owner": "simple-nixos-mailserver", + "repo": "blobs", + "rev": "2cccdf1ca48316f2cfd1c9a0017e8de5a7156265", + "type": "gitlab" + }, + "original": { + "owner": "simple-nixos-mailserver", + "repo": "blobs", + "type": "gitlab" + } + }, "darwin": { "inputs": { "nixpkgs": [ @@ -61,6 +93,26 @@ "type": "github" } }, + "deploy-rs": { + "inputs": { + "flake-compat": "flake-compat", + "nixpkgs": "nixpkgs", + "utils": "utils" + }, + "locked": { + "lastModified": 1718194053, + "narHash": "sha256-FaGrf7qwZ99ehPJCAwgvNY5sLCqQ3GDiE/6uLhxxwSY=", + "owner": "serokell", + "repo": "deploy-rs", + "rev": "3867348fa92bc892eba5d9ddb2d7a97b9e127a8a", + "type": "github" + }, + "original": { + "owner": "serokell", + "repo": "deploy-rs", + "type": "github" + } + }, "devshell": { "inputs": { "flake-utils": "flake-utils_3", @@ -83,6 +135,27 @@ "type": "github" } }, + "devshell_2": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1722113426, + "narHash": "sha256-Yo/3loq572A8Su6aY5GP56knpuKYRvM2a1meP9oJZCw=", + "owner": "numtide", + "repo": "devshell", + "rev": "67cce7359e4cd3c45296fb4aaf6a19e2a9c757ae", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, "disko": { "inputs": { "nixpkgs": [ @@ -90,11 +163,11 @@ ] }, "locked": { - "lastModified": 1722476845, - "narHash": "sha256-7gZ8uf3qOox8Vrwd+p9EhUHHLhhK8lis/5KcXGmIaow=", + "lastModified": 1724895876, + "narHash": "sha256-GSqAwa00+vRuHbq9O/yRv7Ov7W/pcMLis3HmeHv8a+Q=", "owner": "nix-community", "repo": "disko", - "rev": "7e1b215a0a96efb306ad6440bf706d2b307dc267", + "rev": "511388d837178979de66d14ca4a2ebd5f7991cd3", "type": "github" }, "original": { @@ -106,15 +179,15 @@ "emacs-overlay": { "inputs": { "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1722791415, - "narHash": "sha256-7n9UqBkTAF/RikFzCyHKz50kzBDF5GYgVb3J5wCh4EY=", + "lastModified": 1724922811, + "narHash": "sha256-SCS09OjHh/bfjScT4l8kvXfhja4NeckLXdcEkRyf8Ng=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "c4f6796e5c499cf6370a45fff08a03e848b9abad", + "rev": "9fc815e216d4891aec42035e0008a0e2908938e4", "type": "github" }, "original": { @@ -140,7 +213,6 @@ } }, "flake-compat_2": { - "flake": false, "locked": { "lastModified": 1696426674, "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", @@ -156,6 +228,7 @@ } }, "flake-compat_3": { + "flake": false, "locked": { "lastModified": 1696426674, "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", @@ -202,6 +275,20 @@ } }, "flake-compat_6": { + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "revCount": 57, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" + } + }, + "flake-compat_7": { "flake": false, "locked": { "lastModified": 1696426674, @@ -237,10 +324,7 @@ }, "flake-parts_2": { "inputs": { - "nixpkgs-lib": [ - "neovim-nightly-overlay", - "nixpkgs" - ] + "nixpkgs-lib": "nixpkgs-lib_2" }, "locked": { "lastModified": 1722555600, @@ -259,28 +343,11 @@ "flake-parts_3": { "inputs": { "nixpkgs-lib": [ - "neovim-nightly-overlay", - "hercules-ci-effects", + "nixpkgs-wayland", + "nix-eval-jobs", "nixpkgs" ] }, - "locked": { - "lastModified": 1712014858, - "narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "9126214d0a59633752a136528f5f3b9aa8565b7d", - "type": "github" - }, - "original": { - "id": "flake-parts", - "type": "indirect" - } - }, - "flake-parts_4": { - "inputs": { - "nixpkgs-lib": "nixpkgs-lib_2" - }, "locked": { "lastModified": 1722555600, "narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=", @@ -295,20 +362,19 @@ "type": "github" } }, - "flake-parts_5": { + "flake-parts_4": { "inputs": { "nixpkgs-lib": [ - "nixpkgs-wayland", - "nix-eval-jobs", + "nixvim", "nixpkgs" ] }, "locked": { - "lastModified": 1719994518, - "narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=", + "lastModified": 1722555600, + "narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7", + "rev": "8471fe90ad337a8074e957b69ca4d0089218391d", "type": "github" }, "original": { @@ -319,7 +385,7 @@ }, "flake-utils": { "inputs": { - "systems": "systems_2" + "systems": "systems_3" }, "locked": { "lastModified": 1710146030, @@ -337,7 +403,7 @@ }, "flake-utils_2": { "inputs": { - "systems": "systems_3" + "systems": "systems_4" }, "locked": { "lastModified": 1710146030, @@ -355,7 +421,7 @@ }, "flake-utils_3": { "inputs": { - "systems": "systems_4" + "systems": "systems_5" }, "locked": { "lastModified": 1701680307, @@ -373,7 +439,7 @@ }, "flake-utils_4": { "inputs": { - "systems": "systems_5" + "systems": "systems_6" }, "locked": { "lastModified": 1710146030, @@ -406,7 +472,25 @@ }, "flake-utils_6": { "inputs": { - "systems": "systems_6" + "systems": "systems_7" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_7": { + "inputs": { + "systems": "systems_8" }, "locked": { "lastModified": 1710146030, @@ -424,23 +508,26 @@ }, "git-hooks": { "inputs": { - "flake-compat": "flake-compat_2", - "gitignore": "gitignore", + "flake-compat": [ + "nixvim", + "flake-compat" + ], + "gitignore": "gitignore_2", "nixpkgs": [ - "neovim-nightly-overlay", + "nixvim", "nixpkgs" ], "nixpkgs-stable": [ - "neovim-nightly-overlay", + "nixvim", "nixpkgs" ] }, "locked": { - "lastModified": 1721042469, - "narHash": "sha256-6FPUl7HVtvRHCCBQne7Ylp4p+dpP3P/OYuzjztZ4s70=", + "lastModified": 1724857454, + "narHash": "sha256-Qyl9Q4QMTLZnnBb/8OuQ9LSkzWjBU1T5l5zIzTxkkhk=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "f451c19376071a90d8c58ab1a953c6e9840527fd", + "rev": "4509ca64f1084e73bc7a721b20c669a8d4c5ebe6", "type": "github" }, "original": { @@ -452,8 +539,8 @@ "gitignore": { "inputs": { "nixpkgs": [ - "neovim-nightly-overlay", - "git-hooks", + "nix-topology", + "pre-commit-hooks", "nixpkgs" ] }, @@ -474,8 +561,8 @@ "gitignore_2": { "inputs": { "nixpkgs": [ - "nix-topology", - "pre-commit-hooks", + "nixvim", + "git-hooks", "nixpkgs" ] }, @@ -514,41 +601,39 @@ "type": "github" } }, - "hercules-ci-effects": { + "home-manager": { "inputs": { - "flake-parts": "flake-parts_3", "nixpkgs": [ - "neovim-nightly-overlay", + "agenix", "nixpkgs" ] }, "locked": { - "lastModified": 1719226092, - "narHash": "sha256-YNkUMcCUCpnULp40g+svYsaH1RbSEj6s4WdZY/SHe38=", - "owner": "hercules-ci", - "repo": "hercules-ci-effects", - "rev": "11e4b8dc112e2f485d7c97e1cee77f9958f498f5", + "lastModified": 1703113217, + "narHash": "sha256-7ulcXOk63TIT2lVDSExj7XzFx09LpdSAPtvgtM7yQPE=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "3bfaacf46133c037bb356193bd2f1765d9dc82c1", "type": "github" }, "original": { - "owner": "hercules-ci", - "repo": "hercules-ci-effects", + "owner": "nix-community", + "repo": "home-manager", "type": "github" } }, - "home-manager": { + "home-manager_2": { "inputs": { "nixpkgs": [ - "agenix", "nixpkgs" ] }, "locked": { - "lastModified": 1703113217, - "narHash": "sha256-7ulcXOk63TIT2lVDSExj7XzFx09LpdSAPtvgtM7yQPE=", + "lastModified": 1724435763, + "narHash": "sha256-UNky3lJNGQtUEXT2OY8gMxejakSWPTfWKvpFkpFlAfM=", "owner": "nix-community", "repo": "home-manager", - "rev": "3bfaacf46133c037bb356193bd2f1765d9dc82c1", + "rev": "c2cd2a52e02f1dfa1c88f95abeb89298d46023be", "type": "github" }, "original": { @@ -557,18 +642,19 @@ "type": "github" } }, - "home-manager_2": { + "home-manager_3": { "inputs": { "nixpkgs": [ + "nixvim", "nixpkgs" ] }, "locked": { - "lastModified": 1722630065, - "narHash": "sha256-QfM/9BMRkCmgWzrPDK+KbgJOUlSJnfX4OvsUupEUZvA=", + "lastModified": 1724435763, + "narHash": "sha256-UNky3lJNGQtUEXT2OY8gMxejakSWPTfWKvpFkpFlAfM=", "owner": "nix-community", "repo": "home-manager", - "rev": "afc892db74d65042031a093adb6010c4c3378422", + "rev": "c2cd2a52e02f1dfa1c88f95abeb89298d46023be", "type": "github" }, "original": { @@ -579,11 +665,11 @@ }, "impermanence": { "locked": { - "lastModified": 1719091691, - "narHash": "sha256-AxaLX5cBEcGtE02PeGsfscSb/fWMnyS7zMWBXQWDKbE=", + "lastModified": 1724489415, + "narHash": "sha256-ey8vhwY/6XCKoh7fyTn3aIQs7WeYSYtLbYEG87VCzX4=", "owner": "nix-community", "repo": "impermanence", - "rev": "23c1f06316b67cb5dabdfe2973da3785cfe9c34a", + "rev": "c7f5b394397398c023000cf843986ee2571a1fd7", "type": "github" }, "original": { @@ -592,33 +678,17 @@ "type": "github" } }, - "kitty-scrollback-nvim": { - "flake": false, - "locked": { - "lastModified": 1717760785, - "narHash": "sha256-TV++v8aH0Vi9UZEdTT+rUpu6HKAfhu04EwAgGbfk614=", - "owner": "mikesmithgh", - "repo": "kitty-scrollback.nvim", - "rev": "dc101d0a8356db9c7290dfbfa82c27ec35e3b55a", - "type": "github" - }, - "original": { - "owner": "mikesmithgh", - "repo": "kitty-scrollback.nvim", - "type": "github" - } - }, "lib-aggregate": { "inputs": { "flake-utils": "flake-utils_6", "nixpkgs-lib": "nixpkgs-lib_3" }, "locked": { - "lastModified": 1722773431, - "narHash": "sha256-puSEio9yjWojIBDBts4BSGZ43rv1LzIevdYOKmW/Mjg=", + "lastModified": 1724587851, + "narHash": "sha256-+tnTRvR9TzXQDl5OynS+tKBZyPB6viT99zs4fXI0lfk=", "owner": "nix-community", "repo": "lib-aggregate", - "rev": "04a4b4d84e02590715e753da3d35fb03cddc6425", + "rev": "eda1cdaddc64064f53e65ae614e061010e5fb92f", "type": "github" }, "original": { @@ -627,59 +697,20 @@ "type": "github" } }, - "neovim-nightly-overlay": { - "inputs": { - "flake-compat": "flake-compat", - "flake-parts": "flake-parts_2", - "git-hooks": "git-hooks", - "hercules-ci-effects": "hercules-ci-effects", - "neovim-src": "neovim-src", - "nixpkgs": "nixpkgs_2" - }, - "locked": { - "lastModified": 1722755885, - "narHash": "sha256-+q9aul2Dy77Qd/Sl/sTcWjFYAhjE41BEzW2YOoMZEgw=", - "owner": "nix-community", - "repo": "neovim-nightly-overlay", - "rev": "da6d85c958e345129f3f85b39392e00fd78e2e46", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "neovim-nightly-overlay", - "type": "github" - } - }, - "neovim-src": { - "flake": false, - "locked": { - "lastModified": 1722722994, - "narHash": "sha256-UpW1FMRNS8uCM8ONSYQhVua8ESqABnsWu6nh5MCvDVg=", - "owner": "neovim", - "repo": "neovim", - "rev": "58406ab9f0adba6f26402d47479ca061864b2584", - "type": "github" - }, - "original": { - "owner": "neovim", - "repo": "neovim", - "type": "github" - } - }, "nix-alien": { "inputs": { - "flake-compat": "flake-compat_3", + "flake-compat": "flake-compat_2", "flake-utils": "flake-utils_2", "nix-filter": "nix-filter", "nix-index-database": "nix-index-database", "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1722576181, - "narHash": "sha256-0YYH6dTJK+mzqH7KvXep5Zv/qjHCGv+hM1eLMd0aBM4=", + "lastModified": 1723703209, + "narHash": "sha256-3jvfRvdhKhqFpnGgMDpg6ppm4gKLfkRH5eK+e/JLzMY=", "owner": "thiagokokada", "repo": "nix-alien", - "rev": "5d41c9c1aac104c15d06808f0c35c23e26809875", + "rev": "3c4db22601f319480f6e78eb8c58d19120aa1b86", "type": "github" }, "original": { @@ -688,19 +719,40 @@ "type": "github" } }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1724561770, + "narHash": "sha256-zv8C9RNa86CIpyHwPIVO/k+5TfM8ZbjGwOOpTe1grls=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "ac5694a0b855a981e81b4d9f14052e3ff46ca39e", + "type": "github" + }, + "original": { + "owner": "lnl7", + "repo": "nix-darwin", + "type": "github" + } + }, "nix-eval-jobs": { "inputs": { - "flake-parts": "flake-parts_5", + "flake-parts": "flake-parts_3", "nix-github-actions": "nix-github-actions", - "nixpkgs": "nixpkgs_7", + "nixpkgs": "nixpkgs_8", "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1721505437, - "narHash": "sha256-sZpyyf9EiRVyEA9vUVWNxu8yI9MU0nhlEuPBL3hvC60=", + "lastModified": 1723372011, + "narHash": "sha256-zqenoufFiPfobw74idorZMG8AXG3DnFzbHplt/Nkvrg=", "owner": "nix-community", "repo": "nix-eval-jobs", - "rev": "2e522fb78d7613cecaf683875ab27b6c90e8a84f", + "rev": "8802412b8747633e9d80639897e4d58fa6290909", "type": "github" }, "original": { @@ -726,16 +778,16 @@ }, "nix-gaming": { "inputs": { - "flake-parts": "flake-parts_4", + "flake-parts": "flake-parts_2", "nixpkgs": "nixpkgs_4", "umu": "umu" }, "locked": { - "lastModified": 1722734656, - "narHash": "sha256-3Fk8o9WR1oVroPx3hDhmLguzhaFz0OifsIpLXLbef/Q=", + "lastModified": 1724549799, + "narHash": "sha256-F4lN1qmMJpJALwZ2ENb6MDSXG40om7ktZyAt7yh/DS8=", "owner": "fufexan", "repo": "nix-gaming", - "rev": "88aa6c5d59424d979741bc7fc817f02f5b200c08", + "rev": "963803d3be8ed721b21326804513dec884e9d494", "type": "github" }, "original": { @@ -774,11 +826,11 @@ ] }, "locked": { - "lastModified": 1720926593, - "narHash": "sha256-fW6e27L6qY6s+TxInwrS2EXZZfhMAlaNqT0sWS49qMA=", + "lastModified": 1723352546, + "narHash": "sha256-WTIrvp0yV8ODd6lxAq4F7EbrPQv0gscBnyfn559c3k8=", "owner": "nix-community", "repo": "nix-index-database", - "rev": "5fe5b0cdf1268112dc96319388819b46dc051ef4", + "rev": "ec78079a904d7d55e81a0468d764d0fffb50ac06", "type": "github" }, "original": { @@ -795,11 +847,11 @@ "pre-commit-hooks": "pre-commit-hooks" }, "locked": { - "lastModified": 1722338736, - "narHash": "sha256-bSnWgJ7eXgHZ/pwL7+NTDGfOzsbOiw899BV3k7TawWE=", + "lastModified": 1724368485, + "narHash": "sha256-/MzkcvJN8zN+y5vevpT6OQJXTb+sSpxQA0iywn9CD+A=", "owner": "oddlama", "repo": "nix-topology", - "rev": "870dcc9074077a327220b36597098c295944a47d", + "rev": "1826fe50f19dd076f13ede0254e170247e0afb06", "type": "github" }, "original": { @@ -831,11 +883,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1722332872, - "narHash": "sha256-2xLM4sc5QBfi0U/AANJAW21Bj4ZX479MHPMPkB+eKBU=", + "lastModified": 1724878143, + "narHash": "sha256-UjpKo92iZ25M05kgSOw/Ti6VZwpgdlOa73zHj8OcaDk=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "14c333162ba53c02853add87a0000cbd7aa230c2", + "rev": "95c3dfe6ef2e96ddc1ccdd7194e3cda02ca9a8ef", "type": "github" }, "original": { @@ -845,20 +897,56 @@ "type": "github" } }, + "nixos-mailserver": { + "inputs": { + "blobs": "blobs", + "flake-compat": "flake-compat_4", + "nixpkgs": "nixpkgs_6", + "nixpkgs-24_05": "nixpkgs-24_05" + }, + "locked": { + "lastModified": 1722877200, + "narHash": "sha256-qgKDNJXs+od+1UbRy62uk7dYal3h98I4WojfIqMoGcg=", + "owner": "simple-nixos-mailserver", + "repo": "nixos-mailserver", + "rev": "af7d3bf5daeba3fc28089b015c0dd43f06b176f2", + "type": "gitlab" + }, + "original": { + "owner": "simple-nixos-mailserver", + "repo": "nixos-mailserver", + "type": "gitlab" + } + }, "nixpkgs": { "locked": { - "lastModified": 1722630782, - "narHash": "sha256-hMyG9/WlUi0Ho9VkRrrez7SeNlDzLxalm9FwY7n/Noo=", + "lastModified": 1702272962, + "narHash": "sha256-D+zHwkwPc6oYQ4G3A1HuadopqRwUY/JkMwHz1YF7j4Q=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "d04953086551086b44b6f3c6b7eeb26294f207da", + "rev": "e97b3e4186bcadf0ef1b6be22b8558eab1cdeb5d", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-unstable", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-24_05": { + "locked": { + "lastModified": 1717144377, + "narHash": "sha256-F/TKWETwB5RaR8owkPPi+SPJh83AQsm6KrQAlJ8v/uA=", + "owner": "NixOS", "repo": "nixpkgs", + "rev": "805a384895c696f802a9bf5bf4720f37385df547", "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-24.05", + "type": "indirect" } }, "nixpkgs-lib": { @@ -887,11 +975,11 @@ }, "nixpkgs-lib_3": { "locked": { - "lastModified": 1722732880, - "narHash": "sha256-do2Mfm3T6SR7a5A804RhjQ+JTsF5hk4JTPGjCTRM/m8=", + "lastModified": 1724547350, + "narHash": "sha256-WKkGeNpenNMKD1gOF0Xuqi3VsKX/QCAiwz9qe5PDvzA=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "8bebd4c74f368aacb047f0141db09ec6b339733c", + "rev": "b741d900fecd2f0c32d90f853b24be9f5f098b7d", "type": "github" }, "original": { @@ -902,11 +990,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1722651103, - "narHash": "sha256-IRiJA0NVAoyaZeKZluwfb2DoTpBAj+FLI0KfybBeDU0=", + "lastModified": 1724727824, + "narHash": "sha256-0XH9MJk54imJm+RHOLTUJ7e+ponLW00tw5ke4MTVa1Y=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a633d89c6dc9a2a8aae11813a62d7c58b2c0cc51", + "rev": "36bae45077667aff5720e5b3f1a5458f51cf0776", "type": "github" }, "original": { @@ -953,14 +1041,14 @@ "flake-compat": "flake-compat_5", "lib-aggregate": "lib-aggregate", "nix-eval-jobs": "nix-eval-jobs", - "nixpkgs": "nixpkgs_8" + "nixpkgs": "nixpkgs_9" }, "locked": { - "lastModified": 1722802723, - "narHash": "sha256-7Yrsx/qbGCojDFxHSMsehU6a9z8rHCUVgjalKxPW4Eg=", + "lastModified": 1724927668, + "narHash": "sha256-hOkuflGoYCO5fykoJzCkzI3/7wti8Db62KADHu+ySPo=", "owner": "nix-community", "repo": "nixpkgs-wayland", - "rev": "7ff73584dfac4799a253e38c2aedae80b681dd7f", + "rev": "9ec93a8a2911b6fafafb8dfd600440124d098528", "type": "github" }, "original": { @@ -969,7 +1057,7 @@ "type": "github" } }, - "nixpkgs_10": { + "nixpkgs-wezterm": { "locked": { "lastModified": 1722630782, "narHash": "sha256-hMyG9/WlUi0Ho9VkRrrez7SeNlDzLxalm9FwY7n/Noo=", @@ -980,18 +1068,34 @@ }, "original": { "owner": "nixos", + "repo": "nixpkgs", + "rev": "d04953086551086b44b6f3c6b7eeb26294f207da", + "type": "github" + } + }, + "nixpkgs_10": { + "locked": { + "lastModified": 1724819573, + "narHash": "sha256-GnR7/ibgIH1vhoy8cYdmXE6iyZqKqFxQSVkFgosBh6w=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "71e91c409d1e654808b2621f28a327acfdad8dc2", + "type": "github" + }, + "original": { + "owner": "NixOS", "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs_2": { + "nixpkgs_11": { "locked": { - "lastModified": 1722640603, - "narHash": "sha256-TcXjLVNd3VeH1qKPH335Tc4RbFDbZQX+d7rqnDUoRaY=", + "lastModified": 1719082008, + "narHash": "sha256-jHJSUH619zBQ6WdC21fFAlDxHErKVDJ5fpN0Hgx4sjs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "81610abc161d4021b29199aa464d6a1a521e0cc9", + "rev": "9693852a2070b398ee123a329e68f0dab5526681", "type": "github" }, "original": { @@ -1001,13 +1105,45 @@ "type": "github" } }, + "nixpkgs_12": { + "locked": { + "lastModified": 1723637854, + "narHash": "sha256-med8+5DSWa2UnOqtdICndjDAEjxr5D7zaIiK4pn0Q7c=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "c3aa7b8938b17aebd2deecf7be0636000d62a2b9", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1724819573, + "narHash": "sha256-GnR7/ibgIH1vhoy8cYdmXE6iyZqKqFxQSVkFgosBh6w=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "71e91c409d1e654808b2621f28a327acfdad8dc2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_3": { "locked": { - "lastModified": 1722421184, - "narHash": "sha256-/DJBI6trCeVnasdjUo9pbnodCLZcFqnVZiLUfqLH4jA=", + "lastModified": 1723362943, + "narHash": "sha256-dFZRVSgmJkyM0bkPpaYRtG/kRMRTorUIDj8BxoOt1T4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9f918d616c5321ad374ae6cb5ea89c9e04bf3e58", + "rev": "a58bc8ad779655e790115244571758e8de055e3d", "type": "github" }, "original": { @@ -1019,11 +1155,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1722640603, - "narHash": "sha256-TcXjLVNd3VeH1qKPH335Tc4RbFDbZQX+d7rqnDUoRaY=", + "lastModified": 1724395761, + "narHash": "sha256-zRkDV/nbrnp3Y8oCADf5ETl1sDrdmAW6/bBVJ8EbIdQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "81610abc161d4021b29199aa464d6a1a521e0cc9", + "rev": "ae815cee91b417be55d43781eb4b73ae1ecc396c", "type": "github" }, "original": { @@ -1051,11 +1187,26 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1722630782, - "narHash": "sha256-hMyG9/WlUi0Ho9VkRrrez7SeNlDzLxalm9FwY7n/Noo=", + "lastModified": 1717602782, + "narHash": "sha256-pL9jeus5QpX5R+9rsp3hhZ+uplVHscNJh8n8VpqscM0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e8057b67ebf307f01bdcc8fba94d94f75039d1f6", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-unstable", + "type": "indirect" + } + }, + "nixpkgs_7": { + "locked": { + "lastModified": 1724819573, + "narHash": "sha256-GnR7/ibgIH1vhoy8cYdmXE6iyZqKqFxQSVkFgosBh6w=", "owner": "nixos", "repo": "nixpkgs", - "rev": "d04953086551086b44b6f3c6b7eeb26294f207da", + "rev": "71e91c409d1e654808b2621f28a327acfdad8dc2", "type": "github" }, "original": { @@ -1065,13 +1216,13 @@ "type": "github" } }, - "nixpkgs_7": { + "nixpkgs_8": { "locked": { - "lastModified": 1720781449, - "narHash": "sha256-po3TZO9kcZwzvkyMJKb0WCzzDtiHWD34XeRaX1lWXp0=", + "lastModified": 1723221148, + "narHash": "sha256-7pjpeQlZUNQ4eeVntytU3jkw9dFK3k1Htgk2iuXjaD8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8b5a3d5a1d951344d683b442c0739010b80039db", + "rev": "154bcb95ad51bc257c2ce4043a725de6ca700ef6", "type": "github" }, "original": { @@ -1081,13 +1232,13 @@ "type": "github" } }, - "nixpkgs_8": { + "nixpkgs_9": { "locked": { - "lastModified": 1722630782, - "narHash": "sha256-hMyG9/WlUi0Ho9VkRrrez7SeNlDzLxalm9FwY7n/Noo=", + "lastModified": 1724819573, + "narHash": "sha256-GnR7/ibgIH1vhoy8cYdmXE6iyZqKqFxQSVkFgosBh6w=", "owner": "nixos", "repo": "nixpkgs", - "rev": "d04953086551086b44b6f3c6b7eeb26294f207da", + "rev": "71e91c409d1e654808b2621f28a327acfdad8dc2", "type": "github" }, "original": { @@ -1097,29 +1248,39 @@ "type": "github" } }, - "nixpkgs_9": { + "nixvim": { + "inputs": { + "devshell": "devshell_2", + "flake-compat": "flake-compat_6", + "flake-parts": "flake-parts_4", + "git-hooks": "git-hooks", + "home-manager": "home-manager_3", + "nix-darwin": "nix-darwin", + "nixpkgs": "nixpkgs_10", + "nuschtosSearch": "nuschtosSearch", + "treefmt-nix": "treefmt-nix_2" + }, "locked": { - "lastModified": 1719082008, - "narHash": "sha256-jHJSUH619zBQ6WdC21fFAlDxHErKVDJ5fpN0Hgx4sjs=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "9693852a2070b398ee123a329e68f0dab5526681", + "lastModified": 1725269752, + "narHash": "sha256-AtZ9fSo2q6UeMoDy6kw6solM1B+BCABbKgCyUclsctg=", + "owner": "nix-community", + "repo": "nixvim", + "rev": "18b7597e6ca4b98a6c3f20ddc9783165d5998018", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", + "owner": "nix-community", + "repo": "nixvim", "type": "github" } }, "nur": { "locked": { - "lastModified": 1722804382, - "narHash": "sha256-PxqFletWBILWtpDbPSSpJqAKnxyGN+GgsRxxAfDE8xQ=", + "lastModified": 1724931914, + "narHash": "sha256-DNZImq/fRz9WZu9yecVkL1J0g6ZLKaZm2+OllVzZAxA=", "owner": "nix-community", "repo": "NUR", - "rev": "4784272020d8814909f278b59a13e2b3cf63344e", + "rev": "d38e2a6cfd3344858c331c65d3f91b836e666098", "type": "github" }, "original": { @@ -1128,6 +1289,28 @@ "type": "github" } }, + "nuschtosSearch": { + "inputs": { + "flake-utils": "flake-utils_7", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1724584782, + "narHash": "sha256-7FfHv7b1jwMPSu9SPY9hdxStk8E6EeSwzqdvV69U4BM=", + "owner": "NuschtOS", + "repo": "search", + "rev": "5a08d691de30b6fc28d58ce71a5e420f2694e087", + "type": "github" + }, + "original": { + "owner": "NuschtOS", + "repo": "search", + "type": "github" + } + }, "plasma-manager": { "inputs": { "home-manager": [ @@ -1138,11 +1321,11 @@ ] }, "locked": { - "lastModified": 1722804745, - "narHash": "sha256-l6N3QaiDqN2QmHDAxjczQPLPCTv+Kp7PsrtJBltmhTo=", + "lastModified": 1724556439, + "narHash": "sha256-gPR3sxkKxISUvydnqoj54znpUkK8av/HVFuFJuYUw3w=", "owner": "pjones", "repo": "plasma-manager", - "rev": "61d9342fb471cd3c45a047406428fba7b6fb49ad", + "rev": "5c97fe8af2a2e561f14195ed357d8c451fdbff4c", "type": "github" }, "original": { @@ -1153,12 +1336,12 @@ }, "pre-commit-hooks": { "inputs": { - "flake-compat": "flake-compat_4", + "flake-compat": "flake-compat_3", "flake-utils": [ "nix-topology", "flake-utils" ], - "gitignore": "gitignore_2", + "gitignore": "gitignore", "nixpkgs": [ "nix-topology", "nixpkgs" @@ -1181,17 +1364,17 @@ }, "pre-commit-hooks_2": { "inputs": { - "flake-compat": "flake-compat_6", + "flake-compat": "flake-compat_7", "gitignore": "gitignore_3", - "nixpkgs": "nixpkgs_9", + "nixpkgs": "nixpkgs_11", "nixpkgs-stable": "nixpkgs-stable_3" }, "locked": { - "lastModified": 1721042469, - "narHash": "sha256-6FPUl7HVtvRHCCBQne7Ylp4p+dpP3P/OYuzjztZ4s70=", + "lastModified": 1724857454, + "narHash": "sha256-Qyl9Q4QMTLZnnBb/8OuQ9LSkzWjBU1T5l5zIzTxkkhk=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "f451c19376071a90d8c58ab1a953c6e9840527fd", + "rev": "4509ca64f1084e73bc7a721b20c669a8d4c5ebe6", "type": "github" }, "original": { @@ -1204,26 +1387,30 @@ "inputs": { "agenix": "agenix", "arkenfox-user-js": "arkenfox-user-js", + "betterfox": "betterfox", + "deploy-rs": "deploy-rs", "disko": "disko", "emacs-overlay": "emacs-overlay", "flake-parts": "flake-parts", "home-manager": "home-manager_2", "impermanence": "impermanence", - "kitty-scrollback-nvim": "kitty-scrollback-nvim", - "neovim-nightly-overlay": "neovim-nightly-overlay", "nix-alien": "nix-alien", "nix-gaming": "nix-gaming", "nix-topology": "nix-topology", "nixGL": "nixGL", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs_6", + "nixos-mailserver": "nixos-mailserver", + "nixpkgs": "nixpkgs_7", "nixpkgs-wayland": "nixpkgs-wayland", + "nixpkgs-wezterm": "nixpkgs-wezterm", + "nixvim": "nixvim", "nur": "nur", "plasma-manager": "plasma-manager", "pre-commit-hooks": "pre-commit-hooks_2", "shadow-nix": "shadow-nix", - "systems": "systems_7", - "treefmt-nix": "treefmt-nix_2" + "systems": "systems_9", + "treefmt-nix": "treefmt-nix_3", + "vpsadminos": "vpsadminos" } }, "shadow-nix": { @@ -1347,6 +1534,36 @@ "type": "github" } }, + "systems_8": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_9": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "treefmt-nix": { "inputs": { "nixpkgs": [ @@ -1356,11 +1573,11 @@ ] }, "locked": { - "lastModified": 1720930114, - "narHash": "sha256-VZK73b5hG5bSeAn97TTcnPjXUXtV7j/AtS4KN8ggCS0=", + "lastModified": 1723303070, + "narHash": "sha256-krGNVA30yptyRonohQ+i9cnK+CfCpedg6z3qzqVJcTs=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "b92afa1501ac73f1d745526adc4f89b527595f14", + "rev": "14c092e0326de759e16b37535161b3cb9770cea3", "type": "github" }, "original": { @@ -1371,14 +1588,35 @@ }, "treefmt-nix_2": { "inputs": { - "nixpkgs": "nixpkgs_10" + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1724833132, + "narHash": "sha256-F4djBvyNRAXGusJiNYInqR6zIMI3rvlp6WiKwsRISos=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "3ffd842a5f50f435d3e603312eefa4790db46af5", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, + "treefmt-nix_3": { + "inputs": { + "nixpkgs": "nixpkgs_12" }, "locked": { - "lastModified": 1722330636, - "narHash": "sha256-uru7JzOa33YlSRwf9sfXpJG+UAV+bnBEYMjrzKrQZFw=", + "lastModified": 1724833132, + "narHash": "sha256-F4djBvyNRAXGusJiNYInqR6zIMI3rvlp6WiKwsRISos=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "768acdb06968e53aa1ee8de207fd955335c754b7", + "rev": "3ffd842a5f50f435d3e603312eefa4790db46af5", "type": "github" }, "original": { @@ -1396,11 +1634,11 @@ }, "locked": { "dir": "packaging/nix", - "lastModified": 1722710858, - "narHash": "sha256-PzMKVcp5ffL4v8+ukuTZRp78DI3kmjUBJUo0Vz5OYC4=", + "lastModified": 1724179424, + "narHash": "sha256-2r2y1p9YQuaWCxuFj45MVRqJ/uWglhzY5O9BW1jRXcg=", "ref": "refs/heads/main", - "rev": "babc7214d9bc5007eb6c0d59a720dea59fa694ac", - "revCount": 696, + "rev": "dd3105e4ceef83bdc9d7437139f9475325e2a66d", + "revCount": 700, "submodules": true, "type": "git", "url": "https://github.com/Open-Wine-Components/umu-launcher/?dir=packaging/nix" @@ -1411,6 +1649,40 @@ "type": "git", "url": "https://github.com/Open-Wine-Components/umu-launcher/?dir=packaging/nix" } + }, + "utils": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "vpsadminos": { + "flake": false, + "locked": { + "lastModified": 1723930354, + "narHash": "sha256-CRrZECaoPudSPNGeaJB9AZEnXp0b43WIUGk1orKL2H4=", + "owner": "vpsfreecz", + "repo": "vpsadminos", + "rev": "4f31628e96762790f6aca71231d48d007cee7086", + "type": "github" + }, + "original": { + "owner": "vpsfreecz", + "repo": "vpsadminos", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 7ab8cfd..f9a4c08 100644 --- a/flake.nix +++ b/flake.nix @@ -18,6 +18,8 @@ inputs = { # --- BASE DEPENDENCIES --- nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + # TODO wezterm rendering bug https://github.com/NixOS/nixpkgs/issues/336069 + nixpkgs-wezterm.url = "github:nixos/nixpkgs?rev=d04953086551086b44b6f3c6b7eeb26294f207da"; flake-parts.url = "github:hercules-ci/flake-parts"; # --- YOUR DEPENDENCIES --- @@ -32,6 +34,10 @@ url = "github:ryantm/agenix"; inputs.nixpkgs.follows = "nixpkgs"; }; + nixvim = { + url = "github:nix-community/nixvim"; + # inputs.nixpkgs.follows = "nixpkgs"; + }; nix-topology.url = "github:oddlama/nix-topology"; disko = { url = "github:nix-community/disko"; @@ -41,23 +47,23 @@ url = "github:nix-community/nixGL"; inputs.nixpkgs.follows = "nixpkgs"; }; - neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay"; emacs-overlay.url = "github:nix-community/emacs-overlay"; nixos-hardware.url = "github:NixOS/nixos-hardware/master"; + deploy-rs.url = "github:serokell/deploy-rs"; impermanence.url = "github:nix-community/impermanence"; nur.url = "github:nix-community/NUR"; arkenfox-user-js = { url = "github:arkenfox/user.js"; flake = false; }; + betterfox = { + url = "github:yokoffing/Betterfox"; + flake = false; + }; nixpkgs-wayland = { url = "github:nix-community/nixpkgs-wayland"; # nixpkgs-wayland.inputs.nixpkgs.follows = "nixpkgs"; }; - kitty-scrollback-nvim = { - url = "github:mikesmithgh/kitty-scrollback.nvim"; - flake = false; - }; nix-alien.url = "github:thiagokokada/nix-alien"; # TODO some serious maintenance sheningans shadow-nix = { @@ -70,6 +76,16 @@ inputs.home-manager.follows = "home-manager"; }; nix-gaming.url = "github:fufexan/nix-gaming"; + nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver"; + vpsadminos = { + url = "github:vpsfreecz/vpsadminos"; + flake = false; + }; + # neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay"; + # kitty-scrollback-nvim = { + # url = "github:mikesmithgh/kitty-scrollback.nvim"; + # flake = false; + # }; # spicetify-nix = { # url = "github:the-argus/spicetify-nix"; # inputs.nixpkgs.follows = "nixpkgs";