feat(elcafe): add creug user
This commit is contained in:
@@ -102,6 +102,10 @@
|
||||
inherit extraSpecialArgs pkgs;
|
||||
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 {
|
||||
inherit extraSpecialArgs pkgs;
|
||||
modules = withUserModules ./users/phundrak/host/elcafe.nix;
|
||||
|
||||
@@ -58,6 +58,10 @@
|
||||
enable = true;
|
||||
trusted = true;
|
||||
};
|
||||
creug = {
|
||||
enable = true;
|
||||
sudo = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
36
system/users/creug.nix
Normal file
36
system/users/creug.nix
Normal 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"];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
imports = [
|
||||
./creug.nix
|
||||
./phundrak.nix
|
||||
./root.nix
|
||||
];
|
||||
|
||||
57
users/creug/home.nix
Normal file
57
users/creug/home.nix
Normal 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;
|
||||
};
|
||||
}
|
||||
8
users/creug/host/elcafe.nix
Normal file
8
users/creug/host/elcafe.nix
Normal 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;
|
||||
};
|
||||
}
|
||||
1
users/creug/keys/id_elcafe.pub
Normal file
1
users/creug/keys/id_elcafe.pub
Normal file
@@ -0,0 +1 @@
|
||||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBdd4cNNhONjhuH4jWZ8Z8K1gbBmeDNqRybKRHMQEvZj gregoryfoulachon@googlemail.com
|
||||
@@ -62,9 +62,9 @@ in {
|
||||
monitor =
|
||||
{
|
||||
"marpa" = [
|
||||
"DP-1, 3440x1440@144, 1080x550, 1"
|
||||
"DP-2, 2560x1080@60, 0x0, 1, transform, 1"
|
||||
# "DP-2, 1366x768@60, 0x0, 1"
|
||||
# "DP-1, 3440x1440@144, 1080x550, 1"
|
||||
# "DP-2, 2560x1080@60, 0x0, 1, transform, 1"
|
||||
"DP-2, 1366x768@60, 0x0, 1"
|
||||
# "DP-2, 1829x1143@60, 0x0, 1"
|
||||
];
|
||||
"gampo" = [];
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
imports = [../light-home.nix];
|
||||
home = {
|
||||
cli.nh.flake = "/tank/phundrak/.dotfiles";
|
||||
cli.nh.flake = "/home/phundrak/.dotfiles";
|
||||
dev.editors.emacs.enable = false;
|
||||
phundrak.sshKey.content = builtins.readFile ../keys/id_elcafe.pub;
|
||||
};
|
||||
|
||||
@@ -13,7 +13,7 @@ in {
|
||||
sshKey = {
|
||||
content = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
example = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGj+J6N6SO+4P8dOZqfR1oiay2yxhhHnagH52avUqw5h";
|
||||
example = "ssh-ed25519 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
|
||||
default = null;
|
||||
};
|
||||
file = mkOption {
|
||||
|
||||
Reference in New Issue
Block a user