2020-06-17 19:01:57 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.profiles.base;
|
2022-06-05 15:49:19 +02:00
|
|
|
|
2022-06-05 15:46:48 +02:00
|
|
|
helixDesktop = pkgs.makeDesktopItem {
|
2022-06-05 15:49:19 +02:00
|
|
|
name = "Helix";
|
2022-06-05 15:46:48 +02:00
|
|
|
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;
|
|
|
|
};
|
2022-06-05 15:49:19 +02:00
|
|
|
in
|
|
|
|
{
|
2020-06-17 19:01:57 +02:00
|
|
|
options.machine = {
|
|
|
|
name = lib.mkOption {
|
2022-05-02 14:49:06 +02:00
|
|
|
type = lib.types.str;
|
2020-06-17 19:01:57 +02:00
|
|
|
};
|
2023-01-16 11:09:00 +01:00
|
|
|
cores = lib.mkOption {
|
|
|
|
type = lib.types.ints.positive;
|
|
|
|
default = 1;
|
|
|
|
};
|
2023-01-16 06:58:47 +01:00
|
|
|
systemd = lib.mkOption {
|
|
|
|
type = lib.types.bool;
|
|
|
|
default = true;
|
|
|
|
};
|
2022-06-05 15:49:19 +02:00
|
|
|
eth = lib.mkOption { };
|
|
|
|
wlan = lib.mkOption { };
|
2022-05-02 14:49:06 +02:00
|
|
|
secondary-fs = lib.mkOption {
|
2022-05-02 23:45:57 +02:00
|
|
|
type = lib.types.nullOr lib.types.nonEmptyStr;
|
|
|
|
default = null;
|
|
|
|
example = "''${env:HOME}";
|
2022-05-02 14:49:06 +02:00
|
|
|
};
|
2020-06-17 19:01:57 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
options.profiles.base = {
|
|
|
|
enable = lib.mkEnableOption "The base profile, should be always enabled";
|
2022-06-03 12:22:24 +02:00
|
|
|
plus = lib.mkEnableOption "Useful things you arguably don't NEED";
|
2020-06-17 19:01:57 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
2022-06-07 14:50:22 +02:00
|
|
|
home.language = {
|
2022-06-28 15:44:45 +02:00
|
|
|
base = "nb_NO.utf8";
|
|
|
|
messages = "en_US.utf8";
|
2022-06-07 14:50:22 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-06-17 19:01:57 +02:00
|
|
|
home.packages = with pkgs; [
|
2022-12-01 16:27:16 +01:00
|
|
|
unstable.nix-output-monitor
|
2022-04-02 03:04:37 +02:00
|
|
|
nix-top
|
|
|
|
nix-index
|
2022-06-06 03:41:04 +02:00
|
|
|
nix-tree
|
2022-04-02 03:04:37 +02:00
|
|
|
unstable.comma
|
|
|
|
|
2022-06-05 15:46:48 +02:00
|
|
|
rnix-lsp
|
|
|
|
helixDesktop
|
2022-06-05 15:49:19 +02:00
|
|
|
|
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
|
|
|
|
2020-07-11 04:08:58 +02:00
|
|
|
lsof
|
|
|
|
|
2020-06-17 19:01:57 +02:00
|
|
|
htop
|
|
|
|
|
|
|
|
file
|
|
|
|
tmux
|
2022-06-05 15:49:19 +02:00
|
|
|
|
2023-01-19 00:38:49 +01:00
|
|
|
timewarrior
|
|
|
|
|
2020-07-11 04:08:58 +02:00
|
|
|
unzip
|
|
|
|
p7zip
|
2022-04-02 03:04:37 +02:00
|
|
|
|
2020-07-11 04:08:58 +02:00
|
|
|
parallel
|
|
|
|
sshfs
|
|
|
|
jq
|
2020-06-17 19:01:57 +02:00
|
|
|
|
2020-07-11 04:08:58 +02:00
|
|
|
ncdu
|
2020-06-17 19:01:57 +02:00
|
|
|
|
2020-07-11 04:08:58 +02:00
|
|
|
bat
|
2022-04-02 03:53:25 +02:00
|
|
|
exa
|
2020-07-11 04:08:58 +02:00
|
|
|
ripgrep
|
2022-06-03 12:22:24 +02:00
|
|
|
] ++ lib.optionals cfg.plus [
|
2020-07-11 04:08:58 +02:00
|
|
|
ffmpeg-full
|
|
|
|
] ++ lib.optionals config.profiles.gui.enable [
|
2020-06-17 19:01:57 +02:00
|
|
|
mpv
|
|
|
|
sxiv
|
2022-04-24 18:37:29 +02:00
|
|
|
|
2022-06-05 15:49:19 +02:00
|
|
|
dolphin
|
|
|
|
plasma5Packages.dolphin-plugins
|
2021-12-23 05:22:49 +01:00
|
|
|
ffmpegthumbs
|
|
|
|
plasma5Packages.kdegraphics-thumbnailers
|
2022-06-05 15:49:19 +02:00
|
|
|
plasma5Packages.kio
|
|
|
|
plasma5Packages.kio-extras
|
2021-12-23 05:22:49 +01:00
|
|
|
krename
|
|
|
|
konsole # https://bugs.kde.org/show_bug.cgi?id=407990 reeee
|
|
|
|
|
2020-06-17 19:01:57 +02:00
|
|
|
gnome3.gedit
|
2022-06-03 12:22:24 +02:00
|
|
|
|
|
|
|
gimp
|
|
|
|
] ++ lib.optionals (config.profiles.gui.enable && cfg.plus) [
|
|
|
|
mumble
|
|
|
|
|
2022-06-05 15:49:19 +02:00
|
|
|
# texlive.combined.scheme-full
|
|
|
|
# kile
|
2021-06-01 13:10:33 +02:00
|
|
|
libreoffice
|
2022-06-03 12:22:24 +02:00
|
|
|
thunderbird
|
|
|
|
|
2020-06-17 19:01:57 +02:00
|
|
|
kdenlive
|
|
|
|
frei0r
|
2022-06-03 12:22:24 +02:00
|
|
|
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 = {
|
2020-07-11 04:08:58 +02:00
|
|
|
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";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2023-01-16 05:00:27 +01:00
|
|
|
extensions = with pkgs.nur.repos.rycee.firefox-addons; [ bitwarden cookies-txt metamask no-pdf-download sponsorblock ublock-origin ];
|
2020-06-17 19:01:57 +02:00
|
|
|
};
|
|
|
|
|
2022-12-09 03:42:20 +01:00
|
|
|
|
2022-06-03 12:22:24 +02:00
|
|
|
programs.obs-studio.enable = (config.profiles.gui.enable && cfg.plus);
|
2020-06-17 19:01:57 +02:00
|
|
|
|
|
|
|
|
2022-12-28 03:51:09 +01:00
|
|
|
programs.tealdeer.enable = true;
|
2022-12-09 03:42:20 +01:00
|
|
|
|
2022-06-05 15:46:48 +02:00
|
|
|
programs.helix = {
|
|
|
|
enable = true;
|
2022-06-08 04:56:02 +02:00
|
|
|
package = pkgs.helix;
|
2022-06-07 13:41:14 +02:00
|
|
|
settings = let
|
|
|
|
b = command: ":insert-output " + command;
|
|
|
|
c = chars: b "printf " + chars;
|
|
|
|
in {
|
2022-06-05 15:46:48 +02:00
|
|
|
editor.line-number = "relative";
|
|
|
|
editor.mouse = false;
|
|
|
|
keys.normal = {
|
2022-06-07 13:41:14 +02:00
|
|
|
# Empty keys: Ø, æ, Æ, å, Å, *, [ ]
|
2022-06-05 15:46:48 +02:00
|
|
|
"ø" = "collapse_selection"; # For ;
|
|
|
|
"minus" = "search"; # For /
|
|
|
|
"_" = "rsearch"; # for =
|
2022-06-08 04:56:02 +02:00
|
|
|
"+" = "trim_selections"; # for _
|
2022-06-07 13:41:14 +02:00
|
|
|
"å" = {
|
|
|
|
"d" = "goto_prev_diag"; # for [d
|
|
|
|
"D" = "goto_first_diag";
|
|
|
|
"f" = "goto_prev_function";
|
|
|
|
"c" = "goto_prev_class";
|
|
|
|
"a" = "goto_prev_parameter";
|
|
|
|
"o" = "goto_prev_comment";
|
|
|
|
"p" = "goto_prev_paragraph";
|
|
|
|
"space" = "add_newline_above";
|
|
|
|
};
|
|
|
|
"¨" = {
|
|
|
|
"d" = "goto_next_diag";
|
|
|
|
"D" = "goto_last_diag";
|
|
|
|
"f" = "goto_next_function";
|
|
|
|
"c" = "goto_next_class";
|
|
|
|
"a" = "goto_next_parameter";
|
|
|
|
"o" = "goto_next_comment";
|
|
|
|
"p" = "goto_next_paragraph";
|
|
|
|
"space" = "add_newline_below";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
keys.insert = {
|
|
|
|
"S-tab" = "unindent";
|
|
|
|
# Poor man's US-Keyboard
|
2022-12-28 17:58:03 +01:00
|
|
|
"Å" = [(c "{}") "move_char_right"];
|
2022-06-07 13:41:14 +02:00
|
|
|
"º" = c "Å";
|
|
|
|
"^" = c "}";
|
|
|
|
"¤" = c "^";
|
2022-06-05 15:46:48 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-08-02 02:46:39 +02:00
|
|
|
programs.vscode = {
|
|
|
|
enable = config.profiles.gui.enable;
|
|
|
|
package = pkgs.vscodium;
|
|
|
|
extensions = with pkgs.vscode-extensions; [
|
|
|
|
bbenoist.nix
|
2022-10-04 01:57:51 +02:00
|
|
|
|
|
|
|
matklad.rust-analyzer
|
|
|
|
vadimcn.vscode-lldb
|
|
|
|
] ++ lib.optionals config.nixpkgs.config.allowUnfree [
|
2022-08-02 02:46:39 +02:00
|
|
|
ms-vsliveshare.vsliveshare
|
|
|
|
];
|
|
|
|
userSettings = {
|
|
|
|
"editor.insertSpaces" = false;
|
|
|
|
"terminal.integrated.fontFamily" = "MesloLGS NF";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
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";
|
2022-06-06 22:03:28 +02:00
|
|
|
revise = "!${pkgs.git-revise}/bin/git-revise";
|
2022-06-05 03:21:50 +02:00
|
|
|
rc = "rebase --continue";
|
|
|
|
n = "!git commit --all --amend --no-edit && git rc";
|
|
|
|
};
|
2022-07-25 03:38:03 +02:00
|
|
|
ignores = [
|
2022-12-09 03:42:20 +01:00
|
|
|
".envrc"
|
2022-07-25 03:38:03 +02:00
|
|
|
".direnv"
|
2022-10-17 22:24:44 +02:00
|
|
|
".vscode"
|
2022-07-25 03:38:03 +02:00
|
|
|
];
|
2020-12-12 15:26:49 +01:00
|
|
|
extraConfig = {
|
2022-06-05 15:49:19 +02:00
|
|
|
pull.rebase = true;
|
2023-04-27 12:02:42 +02:00
|
|
|
sequence.editor = let
|
|
|
|
# girt = pkgs.unstable.git-interactive-rebase-tool.overrideAttrs (old: rec {
|
|
|
|
# src = pkgs.fetchFromGitHub {
|
|
|
|
# owner = "Dali99";
|
|
|
|
# repo = "git-interactive-rebase-tool";
|
|
|
|
# rev = "590f87d8ed16992373e214bca5994f89c69fa942";
|
|
|
|
# sha256 = "sha256-vUjqnt5ZSpzoohkzDXEqTMhMEkYzPMUZiaYWS0ZQcPQ=";
|
|
|
|
# };
|
|
|
|
# cargoDeps = old.cargoDeps.overrideAttrs (oldB: {
|
|
|
|
# name = "${oldB.name}";
|
|
|
|
# inherit src;
|
|
|
|
# outputHash = "sha256-/I465/PlOckvov9PgSCg7CN5hEKeeQCw8rPsvpKJons=";
|
|
|
|
# });
|
|
|
|
# });
|
|
|
|
girt = pkgs.git-interactive-rebase-tool;
|
|
|
|
in "${girt}/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" = {
|
2023-04-27 11:51:34 +02:00
|
|
|
hostname = "lilith-xxk090fp.daniel";
|
2021-12-22 04:57:40 +01:00
|
|
|
user = "dandellion";
|
|
|
|
};
|
|
|
|
"desktop" = {
|
2023-04-27 11:51:34 +02:00
|
|
|
hostname = "nixos-il0laur2.daniel";
|
2021-12-22 04:57:40 +01:00
|
|
|
user = "dan";
|
|
|
|
};
|
|
|
|
"laptop" = {
|
2023-04-27 11:51:34 +02:00
|
|
|
hostname = "danixlaptop-q4838soc.daniel";
|
2021-12-22 04:57:40 +01:00
|
|
|
user = "daniel";
|
|
|
|
};
|
|
|
|
"pvv.ntnu.no" = {
|
|
|
|
user = "danio";
|
|
|
|
};
|
|
|
|
"*.pvv.ntnu.no" = {
|
|
|
|
user = "danio";
|
|
|
|
};
|
2022-04-02 03:08:29 +02:00
|
|
|
"gitlab.stud.idi.ntnu.no" = {
|
|
|
|
proxyJump = "login.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";
|
|
|
|
};
|
2022-06-05 15:49:19 +02:00
|
|
|
|
2021-12-23 05:23:15 +01:00
|
|
|
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" ];
|
2021-12-23 05:23:15 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
fonts.fontconfig.enable = config.profiles.gui.enable;
|
2020-06-17 19:01:57 +02:00
|
|
|
};
|
|
|
|
}
|