Add user module

This commit is contained in:
Tibo De Peuter 2023-10-17 23:09:40 +02:00
parent 97db5d05d3
commit afa0baf28c
3 changed files with 88 additions and 1 deletions

View file

@ -55,7 +55,9 @@
modules = [
home-manager.nixosModule
sops-nix.nixosModules.sops
./modules-old
./modules
./modules-old # Wordt stilaan weggewerkt
];
};

View file

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

View file

@ -0,0 +1,80 @@
{ config, lib, pkgs, ... }:
let
cfg = config.sisyphus.users.tdpeuter;
installedPkgs = config.home-manager.users.tdpeuter.home.packages;
in {
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";
};
home-manager.users.tdpeuter = lib.mkIf config.sisyphus.programs.home-manager.enable {
programs.home-manager.enable = true;
home = {
username = "tdpeuter";
homeDirectory = "/home/tdpeuter";
stateVersion = 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; [
brave
duf
jellyfin-media-player
libreoffice-fresh
nextcloud-client
nsxiv
obsidian
qalculate-gtk
spotify
unzip
zathura
zenith-nvidia
];
file = {
".config/alacritty" = lib.mkIf (builtins.elem pkgs.alacritty installedPkgs) {
source = ../../../../stow/alacritty/.config/alacritty;
};
};
};
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;
};
};
};
};
}