diff --git a/flake.nix b/flake.nix index ffe0d81..0d3b87c 100644 --- a/flake.nix +++ b/flake.nix @@ -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; diff --git a/hosts/elcafe/configuration.nix b/hosts/elcafe/configuration.nix index 776363c..329b548 100644 --- a/hosts/elcafe/configuration.nix +++ b/hosts/elcafe/configuration.nix @@ -58,6 +58,10 @@ enable = true; trusted = true; }; + creug = { + enable = true; + sudo = true; + }; }; }; diff --git a/system/users/creug.nix b/system/users/creug.nix new file mode 100644 index 0000000..1f7a189 --- /dev/null +++ b/system/users/creug.nix @@ -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"]; + }; + }; +} diff --git a/system/users/default.nix b/system/users/default.nix index e0c591d..617123c 100644 --- a/system/users/default.nix +++ b/system/users/default.nix @@ -1,5 +1,6 @@ { imports = [ + ./creug.nix ./phundrak.nix ./root.nix ]; diff --git a/users/creug/home.nix b/users/creug/home.nix new file mode 100644 index 0000000..219e590 --- /dev/null +++ b/users/creug/home.nix @@ -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; + }; +} diff --git a/users/creug/host/elcafe.nix b/users/creug/host/elcafe.nix new file mode 100644 index 0000000..a8ea848 --- /dev/null +++ b/users/creug/host/elcafe.nix @@ -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; + }; +} diff --git a/users/creug/keys/id_elcafe.pub b/users/creug/keys/id_elcafe.pub new file mode 100644 index 0000000..e7d8bc6 --- /dev/null +++ b/users/creug/keys/id_elcafe.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBdd4cNNhONjhuH4jWZ8Z8K1gbBmeDNqRybKRHMQEvZj gregoryfoulachon@googlemail.com diff --git a/users/modules/desktop/hyprland.nix b/users/modules/desktop/hyprland.nix index 1a230e7..c50b9b7 100644 --- a/users/modules/desktop/hyprland.nix +++ b/users/modules/desktop/hyprland.nix @@ -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" = []; diff --git a/users/phundrak/host/elcafe.nix b/users/phundrak/host/elcafe.nix index 9026e7e..65aa622 100644 --- a/users/phundrak/host/elcafe.nix +++ b/users/phundrak/host/elcafe.nix @@ -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; }; diff --git a/users/phundrak/light-home.nix b/users/phundrak/light-home.nix index 9b5a0bc..e41494d 100644 --- a/users/phundrak/light-home.nix +++ b/users/phundrak/light-home.nix @@ -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 {