Progress
This commit is contained in:
1 parent
760815da50
commit
5e23488cae
42 files changed
+2205
-144
No files matched your search
@@ -0,0 +1,32 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.desktop.gnome;
|
||||
in
|
||||
{
|
||||
options.modules.desktop.gnome = {
|
||||
enable = mkEnableOption "gnome";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# TODO: Enable extensions with dconf
|
||||
|
||||
home.packages =
|
||||
with pkgs;
|
||||
[
|
||||
gnome-control-center
|
||||
gnome-tweaks
|
||||
blackbox-terminal
|
||||
]
|
||||
++ (with pkgs.gnomeExtensions; [
|
||||
gsconnect
|
||||
disable-workspace-animation
|
||||
]);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.desktop.tiling;
|
||||
in
|
||||
{
|
||||
options.modules.desktop.tiling = {
|
||||
enable = mkEnableOption "tiling desktop";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.git;
|
||||
in
|
||||
{
|
||||
options.modules.git = {
|
||||
enable = mkEnableOption "git";
|
||||
|
||||
user = mkOption {
|
||||
type = types.str;
|
||||
description = "Default user name to use.";
|
||||
};
|
||||
|
||||
email = mkOption {
|
||||
type = types.str;
|
||||
description = "Default user email to use.";
|
||||
};
|
||||
|
||||
ignores = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
description = "Paths to globally ignore";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
git
|
||||
lazygit
|
||||
];
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
|
||||
extraConfig = {
|
||||
pull = {
|
||||
rebase = false;
|
||||
};
|
||||
};
|
||||
|
||||
userName = cfg.user;
|
||||
userEmail = cfg.email;
|
||||
ignores = cfg.ignores;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.cpp;
|
||||
in
|
||||
{
|
||||
options.modules.cpp = {
|
||||
enable = mkEnableOption "cpp";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Gitignore additions
|
||||
modules.git.ignores = [
|
||||
".ccls-cache"
|
||||
];
|
||||
|
||||
# Development packages
|
||||
home.packages = with pkgs; [
|
||||
gnumake
|
||||
gcc
|
||||
];
|
||||
|
||||
# VSCode configuration
|
||||
programs.vscode = {
|
||||
profiles.default = {
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
ms-vscode.cpptools
|
||||
ms-vscode.cmake-tools
|
||||
ms-vscode.cpptools-extension-pack
|
||||
];
|
||||
|
||||
userSettings = {
|
||||
# TODO: Add setting to set the compiler, it currently needs to be set for each workspace individually
|
||||
# "C_Cpp.clang_format_fallbackStyle" = "{ BasedOnStyle: Google, IndentWidth: 4 }";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Neovim configuration
|
||||
# programs.nixvim = {
|
||||
# plugins.lsp.servers.ccls.enable = true;
|
||||
# };
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.haskell;
|
||||
in
|
||||
{
|
||||
options.modules.haskell = {
|
||||
enable = mkEnableOption "haskell";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Development packages
|
||||
home.packages = with pkgs; [
|
||||
haskell.compiler.ghc948
|
||||
(haskell-language-server.override { supportedGhcVersions = [ "948" ]; })
|
||||
];
|
||||
|
||||
# VSCode configuration
|
||||
programs.vscode = {
|
||||
profiles.default = {
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
haskell.haskell
|
||||
justusadam.language-haskell
|
||||
];
|
||||
|
||||
userSettings = {
|
||||
"[haskell]" = { };
|
||||
# "haskell.formattingProvider" = "fourmolu";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Neovim configuration
|
||||
# programs.nixvim = { };
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.js;
|
||||
in
|
||||
{
|
||||
options.modules.js = {
|
||||
enable = mkEnableOption "js";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Development packages
|
||||
home.packages = with pkgs; [
|
||||
nodejs
|
||||
tailwindcss
|
||||
];
|
||||
|
||||
# VSCode configuration
|
||||
programs.vscode = {
|
||||
profiles.default = {
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
bradlc.vscode-tailwindcss
|
||||
];
|
||||
|
||||
userSettings = { };
|
||||
};
|
||||
};
|
||||
|
||||
# Neovim configuration
|
||||
# programs.nixvim = { };
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
# TODO: Move to a module for notebooks in general
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.jupyter;
|
||||
in
|
||||
{
|
||||
options.modules.jupyter = {
|
||||
enable = mkEnableOption "jupyter";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Development packages
|
||||
# home.packages = with pkgs; [
|
||||
# evcxr
|
||||
# ];
|
||||
|
||||
# modules.python.extraPythonPackages = p: [
|
||||
# p.jupyter
|
||||
# p.notebook
|
||||
# ];
|
||||
|
||||
# VSCode configuration
|
||||
programs.vscode = {
|
||||
profiles.default = {
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
ms-toolsai.jupyter
|
||||
ms-toolsai.jupyter-renderers
|
||||
];
|
||||
|
||||
userSettings = { };
|
||||
};
|
||||
};
|
||||
|
||||
# Neovim configuration
|
||||
# programs.nixvim = { };
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.nix;
|
||||
in
|
||||
{
|
||||
options.modules.nix = {
|
||||
enable = mkEnableOption "nix";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Development packages
|
||||
home.packages = with pkgs; [
|
||||
nix-tree
|
||||
nixfmt-rfc-style
|
||||
nixd
|
||||
];
|
||||
|
||||
# Add nix tree
|
||||
xdg.desktopEntries.nix-tree = {
|
||||
exec = "${pkgs.nix-tree}/bin/nix-tree";
|
||||
name = "Nix Tree";
|
||||
terminal = true;
|
||||
type = "Application";
|
||||
};
|
||||
|
||||
# VSCode configuration
|
||||
programs.vscode = {
|
||||
profiles.default = {
|
||||
extensions = with pkgs.vscode-extensions; [ jnoortheen.nix-ide ];
|
||||
|
||||
userSettings = {
|
||||
"[nix]" = {
|
||||
"editor.tabSize" = 2;
|
||||
};
|
||||
"nix.enableLanguageServer" = true;
|
||||
"nix.serverPath" = "nixd";
|
||||
"nix.serverSettings" = {
|
||||
nixd = {
|
||||
formatting = {
|
||||
command = [ "nixfmt" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Neovim configuration
|
||||
# programs.nixvim = {
|
||||
|
||||
# };
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.python;
|
||||
in
|
||||
{
|
||||
options.modules.python = {
|
||||
enable = mkEnableOption "python";
|
||||
extraPythonPackages = mkOption {
|
||||
type = types.functionTo (types.listOf types.package) // {
|
||||
merge =
|
||||
loc: defs: p:
|
||||
lib.concatMap (def: (def.value p)) defs;
|
||||
};
|
||||
default = p: [ ];
|
||||
description = "Extra Python packages to install";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Development packages
|
||||
home.packages = [ ];
|
||||
|
||||
# VSCode configuration
|
||||
programs.vscode = {
|
||||
profiles.default = {
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
ms-python.python
|
||||
ms-python.debugpy
|
||||
ms-python.vscode-pylance
|
||||
ms-python.black-formatter
|
||||
];
|
||||
|
||||
userSettings = {
|
||||
"python.defaultInterpreterPath" = "\${env:PYTHONINTERPRETER}";
|
||||
"[python]" = {
|
||||
"editor.defaultFormatter" = "ms-python.black-formatter";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Neovim configuration
|
||||
# programs.nixvim = { };
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.rust;
|
||||
in
|
||||
{
|
||||
options.modules.rust = {
|
||||
enable = mkEnableOption "rust";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Development packages
|
||||
home.packages = with pkgs; [
|
||||
# rustup
|
||||
# rustc
|
||||
# cargo
|
||||
# gcc
|
||||
# lldb
|
||||
# bacon
|
||||
# rust-analyzer
|
||||
# rustfmt
|
||||
# clippy
|
||||
# evcxr
|
||||
];
|
||||
|
||||
# VSCode configuration
|
||||
programs.vscode = {
|
||||
profiles.default = {
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
rust-lang.rust-analyzer
|
||||
vadimcn.vscode-lldb
|
||||
tamasfe.even-better-toml
|
||||
serayuzgur.crates
|
||||
];
|
||||
|
||||
userSettings = {
|
||||
"[rust]" = {
|
||||
"editor.inlayHints.enabled" = "off";
|
||||
};
|
||||
"rust-analyzer.check.command" = "clippy";
|
||||
"rust-analyzer.showUnlinkedFileNotification" = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Neovim configuration
|
||||
# programs.nixvim = {
|
||||
# plugins.rustaceanvim = {
|
||||
# enable = true;
|
||||
# };
|
||||
# };
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.tex;
|
||||
in
|
||||
{
|
||||
options.modules.tex = {
|
||||
enable = mkEnableOption "tex";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Development packages
|
||||
home.packages = with pkgs; [
|
||||
(texlive.combine {
|
||||
inherit (texlive) scheme-full;
|
||||
})
|
||||
];
|
||||
|
||||
# Pygments for minted
|
||||
modules.python.extraPythonPackages = p: [
|
||||
p.pygments
|
||||
];
|
||||
|
||||
# VSCode configuration
|
||||
programs.vscode = {
|
||||
profiles.default = {
|
||||
extensions = with pkgs.vscode-extensions; [ jnoortheen.nix-ide ];
|
||||
|
||||
userSettings = {
|
||||
"[tex]" = { };
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Neovim configuration
|
||||
# programs.nixvim = {
|
||||
# extraConfigVim = ''
|
||||
# " Enforce latexmk
|
||||
# let g:vimtex_compiler_method = 'latexmk'
|
||||
|
||||
# " Set latexmk compilation settings
|
||||
# let g:vimtex_compiler_latexmk = {
|
||||
# \ 'options': [
|
||||
# \ '-shell-escape',
|
||||
# \ '-verbose',
|
||||
# \ '-file-line-error',
|
||||
# \ '-synctex=1',
|
||||
# \ '-interaction=nonstopmode',
|
||||
# \ ],
|
||||
# \}
|
||||
# '';
|
||||
|
||||
# # Vimtex plugin
|
||||
# plugins.vimtex = {
|
||||
# enable = true;
|
||||
# texlivePackage = null;
|
||||
# settings = {
|
||||
# view_method = "zathura";
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.mathematica;
|
||||
|
||||
my-mathematica = pkgs.mathematica.override {
|
||||
# TODO: Just use a generic name for the installer?
|
||||
# source = ./Wolfram_14.2.1_LIN_Bndl.sh;
|
||||
};
|
||||
in
|
||||
{
|
||||
options.modules.mathematica = {
|
||||
enable = mkEnableOption "mathematica";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [
|
||||
my-mathematica
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,190 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.neovim;
|
||||
# theme = config.desktop.theming;
|
||||
# colors = theme.colors;
|
||||
in
|
||||
{
|
||||
options.modules.neovim = {
|
||||
enable = mkEnableOption "neovim";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# programs.nixvim = {
|
||||
# enable = true;
|
||||
# defaultEditor = true;
|
||||
# viAlias = true;
|
||||
# vimAlias = true;
|
||||
|
||||
# # extraPackages = with pkgs; [ ];
|
||||
|
||||
# opts = {
|
||||
# number = true;
|
||||
# relativenumber = true;
|
||||
|
||||
# signcolumn = "yes";
|
||||
|
||||
# ignorecase = true;
|
||||
# smartcase = true;
|
||||
|
||||
# tabstop = 4;
|
||||
# shiftwidth = 4;
|
||||
# softtabstop = 0;
|
||||
# expandtab = true;
|
||||
# smarttab = true;
|
||||
|
||||
# list = true;
|
||||
# listchars = "tab:»┈«,trail:·,extends:→,precedes:←,nbsp:␣";
|
||||
# };
|
||||
|
||||
# diagnostic.settings = {
|
||||
# enable = true;
|
||||
# signs = true;
|
||||
# underline = true;
|
||||
# update_in_insert = true;
|
||||
# };
|
||||
|
||||
# extraConfigLua = ''
|
||||
# vim.fn.sign_define("DiagnosticSignError",
|
||||
# {text = "", texthl = "DiagnosticSignError"})
|
||||
# vim.fn.sign_define("DiagnosticSignWarn",
|
||||
# {text = "", texthl = "DiagnosticSignWarn"})
|
||||
# vim.fn.sign_define("DiagnosticSignInfo",
|
||||
# {text = "", texthl = "DiagnosticSignInfo"})
|
||||
# vim.fn.sign_define("DiagnosticSignHint",
|
||||
# {text = "💡", texthl = "DiagnosticSignHint"})
|
||||
# '';
|
||||
|
||||
# keymaps = [
|
||||
# # Save shortcut
|
||||
# {
|
||||
# action = ":update<CR>";
|
||||
# key = "<C-s>";
|
||||
# mode = "n";
|
||||
# }
|
||||
# {
|
||||
# action = "<C-o>:update<CR>";
|
||||
# key = "<C-s>";
|
||||
# mode = "i";
|
||||
# }
|
||||
|
||||
# # Neo tree
|
||||
# {
|
||||
# action = ":Neotree action=focus reveal toggle<CR>";
|
||||
# key = "<leader>n";
|
||||
# mode = "n";
|
||||
# options.silent = true;
|
||||
# }
|
||||
# ];
|
||||
|
||||
# autoCmd = [
|
||||
# {
|
||||
# desc = "Automatic formatting";
|
||||
# event = "BufWritePre";
|
||||
# callback = {
|
||||
# __raw = ''
|
||||
# function()
|
||||
# vim.lsp.buf.format {
|
||||
# async = false,
|
||||
# }
|
||||
# end
|
||||
# '';
|
||||
# };
|
||||
# }
|
||||
# ];
|
||||
|
||||
# # highlight = {
|
||||
# # Comment = {
|
||||
# # italic = true;
|
||||
# # fg = theme.schemeColors.withHashtag.base03; # TODO: Come up with a good name colors.muted maybe?
|
||||
# # };
|
||||
# # };
|
||||
|
||||
# plugins.lsp = {
|
||||
# enable = true;
|
||||
# };
|
||||
|
||||
# #plugins.treesitter = {
|
||||
# # enable = true;
|
||||
# #};
|
||||
|
||||
# plugins.cmp = {
|
||||
# enable = true;
|
||||
|
||||
# settings = {
|
||||
# mapping = {
|
||||
# "<C-Space>" = "cmp.mapping.complete()";
|
||||
# "<C-d>" = "cmp.mapping.scroll_docs(-4)";
|
||||
# "<C-e>" = "cmp.mapping.close()";
|
||||
# "<C-f>" = "cmp.mapping.scroll_docs(4)";
|
||||
# "<CR>" = "cmp.mapping.confirm({ select = true })";
|
||||
# "<S-Tab>" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})";
|
||||
# "<Tab>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
|
||||
# };
|
||||
# sources = [
|
||||
# { name = "path"; }
|
||||
# { name = "nvim_lsp"; }
|
||||
# ];
|
||||
# };
|
||||
# };
|
||||
|
||||
# plugins.web-devicons = {
|
||||
# enable = true;
|
||||
# };
|
||||
|
||||
# plugins.neo-tree = {
|
||||
# enable = true;
|
||||
|
||||
# closeIfLastWindow = true;
|
||||
# window = {
|
||||
# width = 30;
|
||||
# autoExpandWidth = true;
|
||||
# };
|
||||
|
||||
# extraOptions = {
|
||||
# default_component_configs.git_status.symbols = {
|
||||
# # Change type
|
||||
# added = "+";
|
||||
# deleted = "✕";
|
||||
# modified = "✦";
|
||||
# renamed = "→";
|
||||
|
||||
# # Status type
|
||||
# untracked = "?";
|
||||
# ignored = "▫";
|
||||
# unstaged = "□";
|
||||
# staged = "■";
|
||||
# conflict = "‼";
|
||||
# };
|
||||
# };
|
||||
# };
|
||||
|
||||
# #plugins.cmp-nvim-lsp.enable = true;
|
||||
|
||||
# plugins.gitsigns = {
|
||||
# enable = true;
|
||||
# settings.current_line_blame = true;
|
||||
# };
|
||||
|
||||
# #plugins.copilot-vim = {
|
||||
# # enable = true;
|
||||
# #};
|
||||
|
||||
# # plugins.vimtex = {
|
||||
# # enable = true;
|
||||
# # texlivePackage = null;
|
||||
# # settings = {
|
||||
# # view_method = "zathura";
|
||||
# # };
|
||||
# # };
|
||||
# };
|
||||
# programs.neovim.defaultEditor = true;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.vscode;
|
||||
# theme = config.desktop.theming;
|
||||
in
|
||||
{
|
||||
options.modules.vscode = {
|
||||
enable = mkEnableOption "vscode";
|
||||
# codeFont = mkOption {
|
||||
# type = types.anything;
|
||||
# default = theme.fonts.pkgs."Fira Code";
|
||||
# };
|
||||
# fallbackFont = mkOption {
|
||||
# type = types.anything;
|
||||
# default = theme.fonts.pkgs."Symbols Nerd Font Mono";
|
||||
# };
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# TODO: Fix theming
|
||||
# desktop.theming.fonts.extraFonts = [ cfg.codeFont ];
|
||||
|
||||
programs.vscode = {
|
||||
enable = true;
|
||||
|
||||
mutableExtensionsDir = false;
|
||||
profiles.default = {
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
eamodio.gitlens
|
||||
ms-vscode.hexeditor
|
||||
mkhl.direnv
|
||||
usernamehw.errorlens
|
||||
gruntfuggly.todo-tree
|
||||
github.copilot
|
||||
github.copilot-chat
|
||||
tomoki1207.pdf
|
||||
ms-vsliveshare.vsliveshare
|
||||
ms-vscode-remote.remote-ssh
|
||||
];
|
||||
|
||||
userSettings =
|
||||
let
|
||||
# font-family = mkForce "'${cfg.codeFont.name}', '${cfg.fallbackFont.name}'";
|
||||
# TODO: Move the conversion factor to theme settings
|
||||
# font-size = mkForce cfg.codeFont.recommendedSize; # Convert pt to px
|
||||
in
|
||||
{
|
||||
# Font setup
|
||||
# "editor.fontFamily" = font-family;
|
||||
# "editor.inlayHints.fontFamily" = font-family;
|
||||
# "editor.inlineSuggest.fontFamily" = font-family;
|
||||
# "editor.fontSize" = font-size;
|
||||
# "editor.fontLigatures" = true;
|
||||
# "terminal.integrated.fontFamily" = font-family;
|
||||
# "terminal.integrated.fontSize" = font-size;
|
||||
# "chat.editor.fontFamily" = font-family; # TODO: Change this font to the standard UI font
|
||||
# "chat.editor.fontSize" = font-size;
|
||||
# "debug.console.fontFamily" = font-family;
|
||||
# "debug.console.fontSize" = font-size;
|
||||
# "scm.inputFontFamily" = font-family; # TODO: Change this font to the standard UI font
|
||||
# "scm.inputFontSize" = font-size;
|
||||
# "markdown.preview.fontFamily" = mkForce theme.fonts.sansSerif.name; # TODO: Change this font to the standard UI font
|
||||
# "markdown.preview.fontSize" = mkForce theme.fonts.sansSerif.recommendedSize;
|
||||
|
||||
# Formatting
|
||||
"editor.formatOnSave" = true;
|
||||
"editor.tabSize" = 4;
|
||||
|
||||
# Layout
|
||||
"window.menuBarVisibility" = "hidden";
|
||||
|
||||
# Git settings
|
||||
"git.autofetch" = true;
|
||||
"git.enableSmartCommit" = false;
|
||||
"git.suggestSmartCommit" = false;
|
||||
|
||||
# Disable update notifications
|
||||
"update.mode" = "none";
|
||||
|
||||
# TODO: Move to direnv module
|
||||
# Ignore direnv folder
|
||||
"files.exclude" = {
|
||||
".direnv" = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.bash;
|
||||
in
|
||||
{
|
||||
options.modules.bash = {
|
||||
enable = mkEnableOption "bash";
|
||||
aliases = mkOption {
|
||||
type = types.attrsOf types.str;
|
||||
default = {
|
||||
"..." = "cd ../..";
|
||||
};
|
||||
description = "Shell aliases";
|
||||
};
|
||||
};
|
||||
|
||||
config.programs.bash = {
|
||||
enable = cfg.enable;
|
||||
shellAliases = cfg.aliases;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.direnv;
|
||||
in
|
||||
{
|
||||
options.modules.direnv = {
|
||||
enable = mkEnableOption "direnv";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
};
|
||||
modules.git.ignores = [
|
||||
".direnv"
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.fish;
|
||||
in
|
||||
{
|
||||
options.modules.fish = {
|
||||
enable = mkEnableOption "fish";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Make bash load into fish
|
||||
# Bash will remain the default shell as fish is not POSIX compliant.
|
||||
modules.bash.enable = true;
|
||||
programs.bash.initExtra = ''
|
||||
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
|
||||
'';
|
||||
|
||||
# Actual fish configuration
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
|
||||
shellAliases = config.modules.bash.aliases;
|
||||
|
||||
plugins = [
|
||||
{
|
||||
name = "done";
|
||||
src = pkgs.fishPlugins.done.src;
|
||||
}
|
||||
{
|
||||
name = "fzf";
|
||||
src = pkgs.fishPlugins.fzf-fish.src;
|
||||
}
|
||||
{
|
||||
name = "grc";
|
||||
src = pkgs.fishPlugins.grc.src;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# Fish plugin dependencies
|
||||
home.packages = with pkgs; [
|
||||
fzf
|
||||
grc
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.xpra;
|
||||
in
|
||||
{
|
||||
options.modules.xpra = {
|
||||
enable = mkEnableOption "Enable xpra";
|
||||
hosts = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = { };
|
||||
description = "xpra hosts";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
xpra
|
||||
];
|
||||
|
||||
xdg.desktopEntries = (
|
||||
listToAttrs (
|
||||
map
|
||||
(entry: {
|
||||
name = "xpra${
|
||||
builtins.substring 0 12 (builtins.hashString "sha256" "${entry.name} (${entry.comment})")
|
||||
}";
|
||||
value = entry // {
|
||||
type = "Application";
|
||||
terminal = false;
|
||||
genericName = entry.comment;
|
||||
};
|
||||
})
|
||||
(
|
||||
concatMap (
|
||||
host:
|
||||
let
|
||||
uri = "tcp://${host}:15151/7";
|
||||
in
|
||||
[
|
||||
{
|
||||
name = "Xpra - Attach";
|
||||
comment = host;
|
||||
exec = "xpra attach --min-quality=100 --min-speed=100 --encoding=png --speaker=off ${uri}";
|
||||
}
|
||||
{
|
||||
name = "Xpra - Detach";
|
||||
comment = host;
|
||||
exec = "xpra detach ${uri}";
|
||||
}
|
||||
]
|
||||
) cfg.hosts
|
||||
)
|
||||
)
|
||||
);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{ lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.bluetooth;
|
||||
in
|
||||
{
|
||||
options.modules.bluetooth = {
|
||||
enable = mkEnableOption "bluetooth";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
# Enable bluetooth
|
||||
hardware.bluetooth = {
|
||||
enable = true;
|
||||
powerOnBoot = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{ lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.bootloader;
|
||||
in
|
||||
{
|
||||
options.modules.bootloader = {
|
||||
enable = mkEnableOption "bootloader";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
# Bootloader
|
||||
boot.loader = {
|
||||
timeout = 0;
|
||||
systemd-boot.enable = true;
|
||||
systemd-boot.editor = false;
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.fonts;
|
||||
in
|
||||
{
|
||||
options.modules.fonts = {
|
||||
enable = mkEnableOption "fonts";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
console.packages = [
|
||||
pkgs.dina-psfu
|
||||
];
|
||||
console.font = "dina";
|
||||
console.earlySetup = true;
|
||||
|
||||
# TODO: Disable default fonts, fonts should be managed per user
|
||||
# fonts.enableDefaultPackages = false;
|
||||
# fonts.fontconfig = {
|
||||
# enable = true;
|
||||
# defaultFonts = {
|
||||
# serif = mkDefault [ ];
|
||||
# sansSerif = mkDefault [ ];
|
||||
# monospace = mkDefault [ ];
|
||||
# emoji = mkDefault [ ];
|
||||
# };
|
||||
# };
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.gnome;
|
||||
in
|
||||
{
|
||||
options.modules.gnome = {
|
||||
enable = mkEnableOption "gnome";
|
||||
# TODO: Add RDP toggle
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Enable GDM and Gnome
|
||||
services.xserver.enable = true;
|
||||
services.xserver.displayManager.gdm.enable = true;
|
||||
services.xserver.desktopManager.gnome.enable = true;
|
||||
services.gnome.core-utilities.enable = false;
|
||||
services.gnome.games.enable = false;
|
||||
services.gnome.core-developer-tools.enable = false;
|
||||
environment.gnome.excludePackages = with pkgs; [
|
||||
adwaita-icon-theme
|
||||
(derivation { name = "nixos-background-info"; })
|
||||
gnome-backgrounds
|
||||
gnome-bluetooth
|
||||
gnome-color-manager
|
||||
gnome-control-center
|
||||
gnome-shell-extensions
|
||||
gnome-tour
|
||||
gnome-user-docs
|
||||
glib
|
||||
gnome-menus
|
||||
gtk3.out
|
||||
xdg-user-dirs
|
||||
xdg-user-dirs-gtk
|
||||
];
|
||||
|
||||
# Set up desktop entries for possible desktop environments
|
||||
services.displayManager.sessionPackages = [
|
||||
(pkgs.writeTextFile {
|
||||
name = "river.desktop";
|
||||
text = ''
|
||||
[Desktop Entry]
|
||||
Name=River
|
||||
Comment=A dynamic tiling Wayland compositor
|
||||
Exec=river
|
||||
Type=Application
|
||||
'';
|
||||
destination = "/share/wayland-sessions/river.desktop";
|
||||
passthru.providedSessions = [ "river" ];
|
||||
})
|
||||
];
|
||||
|
||||
# Enable Gnome Remote Desktop
|
||||
services.gnome.gnome-remote-desktop.enable = true;
|
||||
systemd.services."gnome-remote-desktop".wantedBy = [ "graphical.target" ];
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [
|
||||
3389
|
||||
3390
|
||||
];
|
||||
allowedUDPPorts = [
|
||||
3389
|
||||
3390
|
||||
];
|
||||
};
|
||||
|
||||
# For GSConnect/KDE Connect
|
||||
# TODO: Move to host config?
|
||||
networking.firewall = {
|
||||
allowedTCPPortRanges = [
|
||||
{
|
||||
from = 1714;
|
||||
to = 1764;
|
||||
}
|
||||
];
|
||||
allowedUDPPortRanges = [
|
||||
{
|
||||
from = 1714;
|
||||
to = 1764;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# Enable dependencies
|
||||
modules = {
|
||||
networkmanager.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{ lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.graphics;
|
||||
in
|
||||
{
|
||||
options.modules.graphics = {
|
||||
enable = mkEnableOption "graphics";
|
||||
# TODO: Add toggle for hybrid graphics
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
hardware.graphics.enable = true;
|
||||
hardware.graphics.enable32Bit = true;
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
# TODO: Add nvidia settings back in
|
||||
# TODO: Move to nvidia module
|
||||
hardware.nvidia = {
|
||||
open = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{ lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.networkmanager;
|
||||
in
|
||||
{
|
||||
options.modules.networkmanager = {
|
||||
enable = mkEnableOption "networkmanager";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
# TODO: Add sudo users to the networkmanager group?
|
||||
networking.networkmanager.enable = true;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{ lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.power-saving;
|
||||
in
|
||||
{
|
||||
options.modules.power-saving = {
|
||||
enable = mkEnableOption "power saving";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
# Setup power management
|
||||
powerManagement.enable = true;
|
||||
services.thermald.enable = true;
|
||||
services.power-profiles-daemon.enable = true;
|
||||
|
||||
# Enable wifi power saving
|
||||
networking.networkmanager.wifi.powersave = true;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{ lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.printing;
|
||||
in
|
||||
{
|
||||
options.modules.printing = {
|
||||
enable = mkEnableOption "printing";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
# Enable CUPS
|
||||
services.printing.enable = true;
|
||||
|
||||
# Enable Avahi to auto-detect network printers
|
||||
services.avahi = {
|
||||
enable = true;
|
||||
nssmdns4 = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
{
|
||||
mkModule,
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.profiles.base;
|
||||
in
|
||||
{
|
||||
options.modules.profiles.base = {
|
||||
enable = mkEnableOption "base profile";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
modules = {
|
||||
bootloader.enable = mkDefault true;
|
||||
ssh.enable = mkDefault true;
|
||||
};
|
||||
|
||||
# Localization
|
||||
time.timeZone = "Europe/Amsterdam";
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
console.keyMap = "us";
|
||||
|
||||
# Enable neovim
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
};
|
||||
|
||||
# Allow unfree packages
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
# Enable the usage of flakes
|
||||
nix.settings.experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
|
||||
# Clean tmp
|
||||
boot.tmp.cleanOnBoot = true;
|
||||
|
||||
# Base packages
|
||||
environment.systemPackages = with pkgs; [
|
||||
git
|
||||
wget
|
||||
curl
|
||||
dig
|
||||
procps
|
||||
wireguard-tools
|
||||
usbutils
|
||||
pciutils
|
||||
zip
|
||||
unzip
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.profiles.desktop;
|
||||
in
|
||||
{
|
||||
options.modules.profiles.desktop = {
|
||||
enable = mkEnableOption "desktop profile";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
modules = {
|
||||
profiles.base.enable = mkDefault true;
|
||||
fonts.enable = mkDefault true;
|
||||
graphics.enable = mkDefault true;
|
||||
gnome.enable = mkDefault true; # TODO: Rename to display manager?
|
||||
networkmanager.enable = mkDefault true;
|
||||
printing.enable = mkDefault true;
|
||||
sound.enable = mkDefault true;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.profiles.laptop;
|
||||
in
|
||||
{
|
||||
options.modules.profiles.laptop = {
|
||||
enable = mkEnableOption "laptop profile";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Setup modules
|
||||
modules = {
|
||||
profiles.desktop.enable = mkDefault true;
|
||||
bluetooth.enable = mkDefault true;
|
||||
power-saving.enable = mkDefault true;
|
||||
};
|
||||
|
||||
# Add packages
|
||||
environment.systemPackages = with pkgs; [
|
||||
brightnessctl
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{ lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.sound;
|
||||
in
|
||||
{
|
||||
options.modules.sound = {
|
||||
enable = mkEnableOption "sound";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
# Enable pipewire
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
jack.enable = true;
|
||||
};
|
||||
|
||||
# Recommended by wiki, allows user processes to use realtime kernel
|
||||
security.rtkit.enable = true;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{ lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.ssh;
|
||||
in
|
||||
{
|
||||
options.modules.ssh = {
|
||||
enable = mkEnableOption "ssh";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
services.openssh.enable = true;
|
||||
# TODO: Is this default configuration secure?
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user