Move users directory up

This commit is contained in:
Tibo De Peuter 2023-10-20 20:29:11 +02:00
parent 10ad4de0c5
commit 00e003214f
10 changed files with 17 additions and 18 deletions

View file

@ -2,7 +2,6 @@
imports = [
./programs
./services
./users
./virtualisation
];
}

View file

@ -1,5 +0,0 @@
{
imports = [
./tdpeuter
];
}

View file

@ -1,136 +0,0 @@
{ config, lib, pkgs, pkgs-unstable, ... }:
let
cfg = config.sisyphus.users.tdpeuter;
user = config.users.users.tdpeuter.name;
installedPkgs = config.environment.systemPackages ++ config.home-manager.users.tdpeuter.home.packages;
in {
imports = [
./dotfiles.nix
./firefox.nix # Enables Firefox without setting options
./mail.nix # Enables Thunderbird without setting options
./secrets.nix
];
options.sisyphus.users.tdpeuter.enable = lib.mkEnableOption "user Tibo De Peuter";
config = lib.mkIf cfg.enable {
users.users.tdpeuter = {
description = "Tibo De Peuter";
isNormalUser = true;
extraGroups = [
config.users.groups.keys.name
config.users.groups.networkmanager.name
config.users.groups.wheel.name
];
initialPassword = "ChangeMe";
shell = pkgs.zsh;
};
fonts.fonts = with pkgs; [
corefonts # Calibri for Uni
font-awesome_5 # Dependency of Vifm config
font-awesome # Dependency of zsh
letter # Personal font
noto-fonts-cjk # Dependency of Zellij config
noto-fonts # Dependency of Zellij config
vistafonts # Microsoft fonts
];
home-manager.users.tdpeuter = lib.mkIf config.sisyphus.programs.home-manager.enable {
programs.home-manager.enable = true;
home = {
username = user;
homeDirectory = "/home/${user}";
inherit (config.system) stateVersion;
# If you specify an application here, it will be detected by the configuration module
# and the configuration files will be put in place for you.
packages = (with pkgs; [
chafa # Terminal image viewer
cmdtime # Zsh plugin
duf # Df alternative
fzf
glow # Terminal Markdown renderer
icosystem # Personal icon theme
jellyfin-media-player
kitty
libreoffice-fresh
nextcloud-client
nsxiv # Lightweight image viewer
obsidian
oh-my-zsh
qalculate-gtk # Calculator
spotify
tea # Gitea CLI
unzip
vifm # File manager
zathura # PDF viewer
zellij # Tmux + screen alternative
zsh
zsh-autosuggestions
zsh-syntax-highlighting
]) ++ (with pkgs-unstable; [
mpv
]) ++ (with pkgs.vimPlugins; [
statix
vim-plug
]);
};
# GNOME ricing
# Browse available settings by running:
# gsettings list-schemas | xargs -I % sh -c 'echo %; gsettings list-keys %' | less
dconf.settings = lib.mkIf config.sisyphus.services.desktop.gnome.enable {
"org/gnome/desktop/background" = {
picture-uri = "file:///home/tdpeuter/Nextcloud/Afbeeldingen/wallpapers/bg";
picture-uri-dark = "file:///home/tdpeuter/Nextcloud/Afbeeldingen/wallpapers/bg-dark";
};
"org/gnome/desktop/interface" = {
enable-animations = false;
enable-hot-corners = false;
};
"org/gnome/desktop/notifications" = {
show-in-lock-screen = false;
};
"org/gnome/desktop/peripherals.touchpad" = {
tap-to-click = true;
};
"org/gnome/mutter" = {
dynamic-workspaces = true;
workspaces-only-on-primary = false;
};
"org/gnome/shell/app-switcher" = {
current-workspace-only = true;
};
};
xdg.mimeApps = {
enable = true;
defaultApplications = let
browser = "firefox.desktop";
image-viewer = "nsxiv.desktop";
pdf-viewer = "org.pwmt.zathura-pdf-mupdf.desktop";
in {
"application/pdf" = pdf-viewer;
"application/x-extension-htm" = browser;
"application/x-extension-html" = browser;
"application/x-extension-shtml" = browser;
"application/x-extension-xht" = browser;
"application/x-extension-xhtml" = browser;
"application/xhtml+xml" = browser;
"image/jpeg" = image-viewer;
"image/png" = image-viewer;
"image/webp" = image-viewer;
"text/html" = browser;
"x-scheme-handler/chrome" = browser;
"x-scheme-handler/http" = browser;
"x-scheme-handler/https" = browser;
};
};
};
};
}

View file

@ -1,83 +0,0 @@
{ config, lib, pkgs, pkgs-unstable, ... }:
let
cfg = config.sisyphus.users.tdpeuter;
user = config.users.users.tdpeuter.name;
installedPkgs = config.environment.systemPackages ++ config.home-manager.users.tdpeuter.home.packages;
in {
config = lib.mkIf cfg.enable {
home-manager.users.tdpeuter = lib.mkIf config.sisyphus.programs.home-manager.enable {
home = {
file = {
".config/alacritty" = lib.mkIf (builtins.elem pkgs.alacritty installedPkgs) {
source = ../../../../stow/alacritty/.config/alacritty;
};
".config/git" = {
enable = (builtins.elem pkgs.git installedPkgs);
source = ../../../../stow/git/.config/git;
recursive = true;
};
".config/kitty" = {
enable = builtins.elem pkgs.kitty installedPkgs;
source = ../../../../stow/kitty/.config/kitty;
recursive = true;
};
".config/mpv" = {
enable = (builtins.elem pkgs-unstable.mpv installedPkgs);
source = ../../../../stow/mpv/.config/mpv;
};
".ssh/config" = lib.mkIf config.sisyphus.programs.ssh.enable {
source = ../../../../stow/ssh/.ssh/config;
};
".config/vifm" = {
enable = (builtins.elem pkgs.vifm installedPkgs);
source = ../../../../stow/vifm/.config/vifm;
recursive = true;
};
".config/zellij" = {
enable = (builtins.elem pkgs.zellij installedPkgs);
source = ../../../../stow/zellij/.config/zellij;
};
".oh-my-zsh" = {
enable = (builtins.elem pkgs.zsh installedPkgs);
source = "${pkgs.oh-my-zsh}/share/oh-my-zsh";
recursive = true;
};
".oh-my-zsh/themes/tdpeuter.zsh-theme" = {
enable = (builtins.elem pkgs.zsh installedPkgs);
source = ../../../../stow/zsh/.oh-my-zsh/themes/tdpeuter.zsh-theme;
};
".vim" = {
enable = (builtins.elem pkgs.vim installedPkgs);
source = ../../../../stow/vim/.vim;
recursive = true;
};
".vim/autoload/plug.vim" = {
enable = (builtins.elem pkgs.vim installedPkgs);
source = "${pkgs.vimPlugins.vim-plug}/plug.vim";
};
".vimrc" = {
enable = (builtins.elem pkgs.vim installedPkgs);
source = ../../../../stow/vim/.vimrc;
};
".zshrc" = {
enable = (config.users.users.tdpeuter.shell == pkgs.zsh);
source = ../../../../stow/zsh/.zshrc;
};
".zsh/plugins/cmdtime/cmdtime.plugin.zsh" = {
enable = (builtins.elem pkgs.cmdtime installedPkgs);
source = "${pkgs.cmdtime}/share/cmdtime/cmdtime.plugin.zsh";
};
".zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh" = {
enable = (builtins.elem pkgs.zsh-autosuggestions installedPkgs);
source = "${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh";
};
".zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" = {
enable = (builtins.elem pkgs.zsh-syntax-highlighting installedPkgs);
source = "${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh";
};
};
};
};
};
}

View file

@ -1,60 +0,0 @@
{ config, lib, pkgs, pkgs-unstable, ... }:
let
cfg = config.sisyphus.users.tdpeuter;
user = config.users.users.tdpeuter.name;
in {
config = lib.mkIf cfg.enable {
home-manager.users.tdpeuter.programs.firefox = lib.mkIf config.sisyphus.programs.home-manager.enable {
enable = true;
package = pkgs.firefox.override {
cfg = {
enableTridactylNative = true;
speechSynthesisSupport = true; # Allow Text-to-speech in e.g. Discord
};
extraPolicies = {
DisableFirefoxStudies = true;
DisablePocket = true;
DisableTelemetry = true;
ExtensionSettings = {};
OfferToSaveLogins = false;
};
};
profiles.tdpeuter = {
search = {
default = "DuckDuckGo";
force = true;
engines = {
"Bing".metaData.hidden = true;
"eBay".metaData.hidden = true;
"Nix Packages" = {
urls = [{
template = "https://search.nixos.org/packages";
params = [
{ name = "type"; value = "packages"; }
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@np" ];
};
"GitHub" = {
urls = [{
template = "https://github.com/search";
params = [
{ name = "q"; value = "{searchTerms}"; }
{ name = "type"; value = "repositories"; }
];
}];
icon = "${pkgs.icosystem}/share/icons/icosystem/scalable/apps/github-mark.svg";
definedAliases = [ "@gh" ];
};
};
};
};
};
};
}

View file

@ -1,130 +0,0 @@
{ config, lib, pkgs, pkgs-unstable, ... }:
let
cfg = config.sisyphus.users.tdpeuter;
user = config.users.users.tdpeuter.name;
signatures = {
default = ''
Met vriendelijke groeten
Tibo De Peuter
'';
UGent = ''
Met vriendelijke groeten
Tibo De Peuter
Student 2Ba/3Ba Informatica
'';
MrFortem = ''
Kind regards
MrFortem Fiducia
'';
};
in {
config = lib.mkIf cfg.enable {
home-manager.users.tdpeuter = lib.mkIf config.sisyphus.programs.home-manager.enable {
accounts.email.accounts = {
Telenet = {
address = "tibo.depeuter@telenet.be";
userName = "tibo.depeuter@telenet.be";
imap = {
host = "imap.telenet.be";
port = 993;
tls.enable = true;
};
smtp = {
host = "smtp.telenet.be";
port = 587;
tls = {
enable = true;
useStartTls = true;
};
};
realName = config.users.users.tdpeuter.description;
signature = {
showSignature = "append";
text = signatures.default;
};
primary = true;
thunderbird = {
enable = true;
settings = id: {
"mail.identity.id_${id}.htmlSigText" = signatures.default;
};
};
};
UGent = {
flavor = "outlook.office365.com";
address = "tibo.depeuter@ugent.be";
realName = config.users.users.tdpeuter.description;
signature = {
showSignature = "append";
text = signatures.UGent;
};
thunderbird = {
enable = true;
settings = id: {
"mail.server.server_${id}.authMethod" = 10;
"mail.smtpserver.smtp_${id}.authMethod" = 10;
"mail.identity.id_${id}.htmlSigText" = signatures.UGent;
};
};
};
Gmail = {
flavor = "gmail.com";
address = "tibo.depeuter@gmail.com";
realName = config.users.users.tdpeuter.description;
signature = {
showSignature = "append";
text = signatures.default;
};
thunderbird = {
enable = true;
settings = id: {
"mail.identity.id_${id}.htmlSigText" = signatures.default;
};
};
};
MrFortem = {
flavor = "gmail.com";
address = "fortemfiducia@gmail.com";
realName = "Fortem Fiducia";
signature = {
showSignature = "append";
text = signatures.MrFortem;
};
thunderbird = {
enable = true;
settings = id: {
"mail.server.server_${id}.directory" = ".thunderbird/tdpeuter/ImapMail/imap.gmail.com-mrfortem";
"mail.server.server_${id}.directory-rel" = "[ProfD]ImapMail/imap.gmail.com-mrfortem";
"mail.identity.id_${id}.htmlSigText" = signatures.MrFortem;
};
};
};
};
programs = {
thunderbird = {
enable = true;
profiles.tdpeuter = {
isDefault = true;
settings = {
"mailnews.default_sort_order" = 2; # Sort descending
"mailnews.mark_message_read.delay" = true;
"mailnews.start_page.enabled" = false;
"mail.pane_config.dynamic" = 2; # Vertical view
};
};
};
};
};
};
}

View file

@ -1,34 +0,0 @@
{ config, lib, pkgs, pkgs-unstable, ... }:
let
cfg = config.sisyphus.users.tdpeuter;
user = config.users.users.tdpeuter.name;
in {
config = lib.mkIf cfg.enable {
sops.secrets = lib.mkIf config.sisyphus.programs.sops.enable (
let
Hugo = {
format = "yaml";
sopsFile = ../../../secrets/Hugo.yaml;
owner = user;
};
UGent = {
format = "yaml";
sopsFile = ../../../secrets/UGent.yaml;
owner = user;
};
in {
"Hugo/ssh" = Hugo;
"UGent/HPC/ssh" = UGent;
"GitHub/ssh" = {
format = "yaml";
sopsFile = ../../../secrets/GitHub.yaml;
owner = user;
};
"Hugo/Gitea/ssh" = Hugo;
"UGent/GitHub/ssh" = UGent;
"UGent/SubGit/ssh" = UGent;
});
};
}