2024-05-07 22:02:59 +00:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
...
|
|
|
|
}:
|
2024-02-29 14:53:34 +00:00
|
|
|
|
|
|
|
# Define 'gremlin' user
|
|
|
|
let
|
2024-06-24 15:38:28 +00:00
|
|
|
cfg = config.aux.system.users.gremlin;
|
2024-02-29 14:53:34 +00:00
|
|
|
in
|
|
|
|
{
|
2024-05-07 22:02:59 +00:00
|
|
|
options = {
|
2024-06-24 15:38:28 +00:00
|
|
|
aux.system.users.gremlin = {
|
2024-08-02 21:55:48 +00:00
|
|
|
enable = lib.mkEnableOption "Enables gremlin user account";
|
2024-05-07 22:02:59 +00:00
|
|
|
|
|
|
|
services.syncthing = {
|
2024-08-02 21:55:48 +00:00
|
|
|
enable = lib.mkEnableOption "Enables Syncthing";
|
|
|
|
enableTray = lib.mkEnableOption "Enables the Syncthing Tray application";
|
2024-09-08 17:17:40 +00:00
|
|
|
home = lib.mkOption {
|
|
|
|
default = "${config.users.users.gremlin.home}/.config/syncthing";
|
|
|
|
type = lib.types.str;
|
|
|
|
description = "Where to store Syncthing's configuration files";
|
2024-05-07 22:02:59 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-08-02 21:55:48 +00:00
|
|
|
config = lib.mkMerge [
|
|
|
|
(lib.mkIf cfg.enable {
|
2024-05-07 22:02:59 +00:00
|
|
|
# Add Gremlin account
|
|
|
|
users.users.gremlin = {
|
|
|
|
isNormalUser = true;
|
|
|
|
description = "Gremlin";
|
|
|
|
uid = 1001;
|
2024-05-16 16:19:04 +00:00
|
|
|
hashedPassword = config.secrets.users.gremlin.hashedPassword;
|
2024-05-07 22:02:59 +00:00
|
|
|
extraGroups = [
|
|
|
|
"networkmanager"
|
|
|
|
"input"
|
|
|
|
];
|
|
|
|
|
|
|
|
# Allow systemd services to keep running even while gremlin is logged out
|
|
|
|
linger = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
# Install gremlin-specific flatpaks
|
2024-06-28 14:14:30 +00:00
|
|
|
aux.system.ui.flatpak.packages = [
|
2024-05-07 22:02:59 +00:00
|
|
|
"com.google.Chrome"
|
|
|
|
"com.slack.Slack"
|
|
|
|
];
|
|
|
|
|
|
|
|
home-manager.users.gremlin = {
|
|
|
|
imports = [
|
|
|
|
../common/home-manager/gnome.nix
|
|
|
|
../common/home-manager/zsh.nix
|
|
|
|
];
|
|
|
|
|
|
|
|
home = {
|
|
|
|
# Basic setup
|
|
|
|
username = "gremlin";
|
|
|
|
homeDirectory = "/home/gremlin";
|
|
|
|
|
|
|
|
# The state version is required and should stay at the version you originally installed.
|
|
|
|
stateVersion = "24.05";
|
|
|
|
|
|
|
|
# Set environment variables
|
|
|
|
sessionVariables = {
|
|
|
|
KUBECONFIG = "/home/gremlin/.kube/config";
|
|
|
|
};
|
|
|
|
|
|
|
|
# Install packages specific to Gremlin
|
2024-08-30 14:34:13 +00:00
|
|
|
packages = [
|
|
|
|
pkgs.awscli2
|
|
|
|
pkgs.unstable.figma-linux
|
|
|
|
];
|
2024-05-27 00:23:42 +00:00
|
|
|
|
|
|
|
# Create .face file
|
|
|
|
file.".face".source = ./face.png;
|
2024-05-07 22:02:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
programs = {
|
|
|
|
# Let home Manager install and manage itself.
|
|
|
|
home-manager.enable = true;
|
|
|
|
|
2024-06-27 19:14:49 +00:00
|
|
|
# Set up git to match Aires' configuration
|
|
|
|
git = config.home-manager.users.aires.programs.git;
|
2024-05-07 22:02:59 +00:00
|
|
|
|
2024-05-17 00:08:57 +00:00
|
|
|
# Set up SSH
|
|
|
|
ssh = {
|
|
|
|
enable = true;
|
|
|
|
matchBlocks = config.secrets.users.gremlin.sshConfig;
|
|
|
|
};
|
|
|
|
|
2024-05-07 22:02:59 +00:00
|
|
|
# Set up Zsh
|
|
|
|
zsh = {
|
|
|
|
# Install and source the p10k theme
|
|
|
|
plugins = [
|
|
|
|
{
|
|
|
|
name = "powerlevel10k";
|
|
|
|
src = pkgs.zsh-powerlevel10k;
|
|
|
|
file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "powerlevel10k-config";
|
|
|
|
src = ./p10k-config;
|
|
|
|
file = "p10k.zsh";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
})
|
|
|
|
|
|
|
|
# Enable Syncthing
|
2024-08-02 21:55:48 +00:00
|
|
|
(lib.mkIf cfg.services.syncthing.enable {
|
2024-05-07 22:02:59 +00:00
|
|
|
users.users.gremlin = {
|
|
|
|
packages = [
|
|
|
|
pkgs.syncthing
|
2024-08-02 21:55:48 +00:00
|
|
|
(lib.mkIf cfg.services.syncthing.enableTray pkgs.syncthingtray)
|
2024-05-07 22:02:59 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
home-manager.users.gremlin = {
|
|
|
|
# Syncthing options
|
|
|
|
services.syncthing = {
|
|
|
|
enable = true;
|
|
|
|
extraOptions = [
|
|
|
|
"--gui-address=0.0.0.0:8081"
|
2024-09-08 17:17:40 +00:00
|
|
|
"--home=${cfg.services.syncthing.home}"
|
2024-05-07 22:02:59 +00:00
|
|
|
"--no-default-folder"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2024-09-08 17:55:06 +00:00
|
|
|
systemd.user.services."syncthing".Unit.RequiresMountsFor = cfg.services.syncthing.home;
|
2024-05-07 22:02:59 +00:00
|
|
|
};
|
|
|
|
})
|
|
|
|
];
|
2024-02-29 14:53:34 +00:00
|
|
|
}
|