dotfiles/profiles/base/default.nix

232 lines
5.6 KiB
Nix
Raw Normal View History

2020-06-17 19:01:57 +02:00
{ config, lib, pkgs, ... }:
let
cfg = config.profiles.base;
2022-06-05 15:46:48 +02:00
helixDesktop = pkgs.makeDesktopItem {
name = "Helix";
type = "Application";
desktopName = "Helix";
genericName = "Text Editor";
comment = "Edit text files";
tryExec = "hx";
exec = "kitty hx %F";
terminal = false; # Until you can globally set a prefered terminal we hardcoding this
mimeTypes = [ "ext/english" "text/plain" "text/x-makefile" "text/x-c++hdr" "text/x-c++src" "text/x-chdr" "text/x-csrc" "text/x-java" "text/x-moc" "text/x-pascal" "text/x-tcl" "text/x-tex" "application/x-shellscript" "text/x-c" "text/x-c++" ];
categories = [ "Utility" "TextEditor" ];
keywords = [ "Text" "editor" ];
startupNotify = false;
};
2020-06-17 19:01:57 +02:00
in {
options.machine = {
name = lib.mkOption {
type = lib.types.str;
2020-06-17 19:01:57 +02:00
};
eth = lib.mkOption {};
2021-08-20 19:20:18 +02:00
wlan = lib.mkOption {};
secondary-fs = lib.mkOption {
2022-05-02 23:45:57 +02:00
type = lib.types.nullOr lib.types.nonEmptyStr;
default = null;
example = "''${env:HOME}";
};
2020-06-17 19:01:57 +02:00
};
options.profiles.base = {
enable = lib.mkEnableOption "The base profile, should be always enabled";
plus = lib.mkEnableOption "Useful things you arguably don't NEED";
2020-06-17 19:01:57 +02:00
};
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [
2022-04-02 03:04:37 +02:00
nix-output-monitor
nix-top
nix-index
unstable.comma
2022-06-05 15:46:48 +02:00
rnix-lsp
helixDesktop
2020-06-17 19:01:57 +02:00
ldns
2022-04-02 04:33:24 +02:00
mtr
2020-06-17 19:01:57 +02:00
lsof
2020-06-17 19:01:57 +02:00
htop
file
tmux
unzip
p7zip
2022-04-02 03:04:37 +02:00
parallel
sshfs
jq
2020-06-17 19:01:57 +02:00
ncdu
2020-06-17 19:01:57 +02:00
bat
2022-04-02 03:53:25 +02:00
exa
ripgrep
] ++ lib.optionals cfg.plus [
ffmpeg-full
] ++ lib.optionals config.profiles.gui.enable [
2020-06-17 19:01:57 +02:00
mpv
sxiv
2021-12-23 05:22:49 +01:00
dolphin plasma5Packages.dolphin-plugins
ffmpegthumbs
plasma5Packages.kdegraphics-thumbnailers
plasma5Packages.kio plasma5Packages.kio-extras
krename
konsole # https://bugs.kde.org/show_bug.cgi?id=407990 reeee
2020-06-17 19:01:57 +02:00
gnome3.gedit
2022-06-02 05:08:38 +02:00
vscodium
gimp
] ++ lib.optionals (config.profiles.gui.enable && cfg.plus) [
mumble
2020-07-09 12:36:16 +02:00
# texlive.combined.scheme-full
# kile
2021-06-01 13:10:33 +02:00
libreoffice
thunderbird
2020-06-17 19:01:57 +02:00
kdenlive
frei0r
audacity
inkscape
blender
mkvtoolnix
] ++ lib.optionals (config.nixpkgs.config.allowUnfree && config.profiles.gui.enable) [
2021-06-01 13:10:33 +02:00
geogebra
2020-06-17 19:01:57 +02:00
];
programs.firefox = {
enable = config.profiles.gui.enable;
2021-12-22 04:55:24 +01:00
profiles = {
daniel = {
settings = {
"browser.startup.homepage" = "https://nixos.org";
};
bookmarks = {
"NixOS Options" = {
keyword = "no";
url = "https://search.nixos.org/options?query=%s";
};
"NixOS Packages" = {
keyword = "np";
url = "https://search.nixos.org/packages?query=%s";
};
"Home-Manager Options" = {
keyword = "hm";
url = "https://rycee.gitlab.io/home-manager/options.html#opt-%s";
};
};
};
};
extensions = with pkgs.nur.repos.rycee.firefox-addons; [ bitwarden cookies-txt https-everywhere metamask no-pdf-download sponsorblock ublock-origin ];
2020-06-17 19:01:57 +02:00
};
programs.obs-studio.enable = (config.profiles.gui.enable && cfg.plus);
2020-06-17 19:01:57 +02:00
2022-06-05 15:46:48 +02:00
programs.helix = {
enable = true;
package = pkgs.unstable.helix;
settings = {
editor.line-number = "relative";
editor.mouse = false;
keys.normal = {
# Empty keys: Ø, æ, Æ, å, Å, *,
"ø" = "collapse_selection"; # For ;
"minus" = "search"; # For /
"_" = "rsearch"; # for =
"plus" = "trim_selections"; # for _
"å"."d" = "goto_prev_diag"; # for [d
"¨"."d" = "goto_next_diag";
};
};
};
2020-06-17 19:01:57 +02:00
programs.git = {
enable = true;
userEmail = "daniel.olsen99@gmail.com";
userName = "Daniel Olsen";
2022-06-05 03:21:50 +02:00
aliases = {
absorb = "!${pkgs.git-absorb}/bin/git-absorb";
rc = "rebase --continue";
n = "!git commit --all --amend --no-edit && git rc";
};
2020-12-12 15:26:49 +01:00
extraConfig = {
pull.rebase = true;
2022-06-05 03:21:50 +02:00
sequence.editor = "${pkgs.git-interactive-rebase-tool}/bin/interactive-rebase-tool";
2020-12-12 15:26:49 +01:00
};
2022-04-02 04:02:44 +02:00
delta.enable = true;
2020-06-17 19:01:57 +02:00
};
2021-12-22 04:57:40 +01:00
programs.ssh = {
enable = true;
matchBlocks = {
"lilith" = {
hostname = "lilith.d.d.dodsorf.as";
user = "dandellion";
};
"desktop" = {
hostname = "10.42.42.10";
proxyJump = "lilith";
2021-12-22 04:57:40 +01:00
user = "dan";
};
"laptop" = {
hostname = "10.42.42.13";
user = "daniel";
};
"pvv.ntnu.no" = {
user = "danio";
};
"*.pvv.ntnu.no" = {
user = "danio";
};
"gitlab.stud.idi.ntnu.no" = {
proxyJump = "login.pvv.ntnu.no";
};
2022-04-03 17:28:22 +02:00
"workshop" = {
user = "student";
hostname = "129.241.99.15";
proxyJump = "hildring.pvv.ntnu.no";
};
2021-12-22 04:57:40 +01:00
};
};
2020-06-17 19:01:57 +02:00
services.gpg-agent = {
enable = true;
defaultCacheTtl = 1800;
enableSshSupport = true;
};
2022-06-05 15:46:48 +02:00
home.sessionVariables = {
EDITOR = "hx";
};
xdg.mimeApps = {
enable = true;
defaultApplications = {
"image/png" = [ "sxiv.desktop" "gimp.desktop" ];
2022-06-05 03:21:50 +02:00
"image/jpeg" = [ "sxiv.desktop" ];
2022-06-05 15:46:48 +02:00
"text/plain" = [ "Helix.desktop" "gedit.desktop" "code.desktop" ];
2022-04-24 18:43:06 +02:00
"video/x-matroska" = [ "mpv.desktop" ];
2022-04-02 03:09:11 +02:00
};
associations.removed = {
"text/plain" = [ "writer.desktop" ];
};
};
fonts.fontconfig.enable = config.profiles.gui.enable;
2020-06-17 19:01:57 +02:00
};
}