feat(elcafe): add creug user

This commit is contained in:
2026-02-08 00:20:44 +01:00
parent 35541ea5ae
commit 0815dd3a30
10 changed files with 116 additions and 5 deletions

View File

@@ -102,6 +102,10 @@
inherit extraSpecialArgs pkgs; inherit extraSpecialArgs pkgs;
modules = withUserModules ./users/phundrak/host/alys.nix; modules = withUserModules ./users/phundrak/host/alys.nix;
}; };
"creug@elcafe" = home-manager.lib.homeManagerConfiguration {
inherit extraSpecialArgs pkgs;
modules = withUserModules ./users/creug/host/elcafe.nix;
};
"phundrak@elcafe" = home-manager.lib.homeManagerConfiguration { "phundrak@elcafe" = home-manager.lib.homeManagerConfiguration {
inherit extraSpecialArgs pkgs; inherit extraSpecialArgs pkgs;
modules = withUserModules ./users/phundrak/host/elcafe.nix; modules = withUserModules ./users/phundrak/host/elcafe.nix;

View File

@@ -58,6 +58,10 @@
enable = true; enable = true;
trusted = true; trusted = true;
}; };
creug = {
enable = true;
sudo = true;
};
}; };
}; };

36
system/users/creug.nix Normal file
View File

@@ -0,0 +1,36 @@
{
lib,
config,
pkgs,
...
}:
with lib; let
cfg = config.mySystem.users.creug;
in {
options.mySystem.users.creug = {
enable = mkEnableOption "Enables user creug";
sudo = mkEnableOption "Make the user a superuser";
trusted = mkOption {
description = "Mark the user as trusted by Nix";
default = cfg.sudo;
example = true;
};
};
config = {
users.users.creug = mkIf cfg.enable {
isNormalUser = true;
description = "Greg";
extraGroups =
["networkmanager" "dialout" "games" "audio" "input"]
++ lists.optional config.mySystem.dev.docker.enable "docker"
++ lists.optional config.mySystem.dev.docker.podman.enable "podman"
++ lists.optional cfg.sudo "wheel";
shell = pkgs.zsh;
openssh.authorizedKeys.keyFiles = lib.filesystem.listFilesRecursive ../../users/creug/keys;
};
nix.settings = mkIf cfg.trusted {
trusted-users = ["creug"];
};
};
}

View File

@@ -1,5 +1,6 @@
{ {
imports = [ imports = [
./creug.nix
./phundrak.nix ./phundrak.nix
./root.nix ./root.nix
]; ];

57
users/creug/home.nix Normal file
View File

@@ -0,0 +1,57 @@
{
lib,
pkgs,
config,
...
}:
with lib; let
cfg = config.home.creug;
in {
imports = [../modules];
options.home.creug = {
sshKey = {
content = mkOption {
type = types.nullOr types.str;
example = "ssh-ed25519 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
default = null;
};
file = mkOption {
type = with types; nullOr path;
default = "/home/creug/.ssh/id_ed25519.pub";
};
};
};
config = {
nixpkgs.config.allowUnfree = true;
home = {
username = "creug";
homeDirectory = "/home/creug";
packages = [pkgs.tree pkgs.ncdu];
preferXdgDirectories = true;
creug.sshKey.file = "${config.home.homeDirectory}/.ssh/id_ed25519.pub";
dev.vcs = {
jj.enable = false;
git.enable = true;
publicKey = cfg.sshKey;
};
security.ssh.enable = true;
shell = {
bash.enable = true;
zsh.enable = true;
starship.enable = true;
tmux.enable = false;
zoxide.enable = false;
};
stateVersion = "24.11"; # Do not modify!
};
manual.manpages.enable = true;
};
}

View File

@@ -0,0 +1,8 @@
{
imports = [../home.nix];
home = {
cli.nh.flake = "/home/creug/.dotfiles";
dev.editors.emacs.enable = false;
creug.sshKey.content = builtins.readFile ../keys/id_elcafe.pub;
};
}

View File

@@ -0,0 +1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBdd4cNNhONjhuH4jWZ8Z8K1gbBmeDNqRybKRHMQEvZj gregoryfoulachon@googlemail.com

View File

@@ -62,9 +62,9 @@ in {
monitor = monitor =
{ {
"marpa" = [ "marpa" = [
"DP-1, 3440x1440@144, 1080x550, 1" # "DP-1, 3440x1440@144, 1080x550, 1"
"DP-2, 2560x1080@60, 0x0, 1, transform, 1" # "DP-2, 2560x1080@60, 0x0, 1, transform, 1"
# "DP-2, 1366x768@60, 0x0, 1" "DP-2, 1366x768@60, 0x0, 1"
# "DP-2, 1829x1143@60, 0x0, 1" # "DP-2, 1829x1143@60, 0x0, 1"
]; ];
"gampo" = []; "gampo" = [];

View File

@@ -1,7 +1,7 @@
{ {
imports = [../light-home.nix]; imports = [../light-home.nix];
home = { home = {
cli.nh.flake = "/tank/phundrak/.dotfiles"; cli.nh.flake = "/home/phundrak/.dotfiles";
dev.editors.emacs.enable = false; dev.editors.emacs.enable = false;
phundrak.sshKey.content = builtins.readFile ../keys/id_elcafe.pub; phundrak.sshKey.content = builtins.readFile ../keys/id_elcafe.pub;
}; };

View File

@@ -13,7 +13,7 @@ in {
sshKey = { sshKey = {
content = mkOption { content = mkOption {
type = types.nullOr types.str; type = types.nullOr types.str;
example = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGj+J6N6SO+4P8dOZqfR1oiay2yxhhHnagH52avUqw5h"; example = "ssh-ed25519 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
default = null; default = null;
}; };
file = mkOption { file = mkOption {