summaryrefslogtreecommitdiff
path: root/machines/xnet
diff options
context:
space:
mode:
authorKleidi Bujari <mail@4kb.net>2025-01-24 19:37:50 -0500
committerKleidi Bujari <mail@4kb.net>2025-01-24 19:37:50 -0500
commit221d7084c23dce02e3f47ab18db2bfba78efe83b (patch)
tree925c98e92854280e29f6171de6050443d31340c1 /machines/xnet
parentdef88b34145d81472d3f2856501c157889f42ba2 (diff)
downloaddepot-221d7084c23dce02e3f47ab18db2bfba78efe83b.tar.gz
depot-221d7084c23dce02e3f47ab18db2bfba78efe83b.tar.bz2
depot-221d7084c23dce02e3f47ab18db2bfba78efe83b.zip
move users to depot, add gitignore
Diffstat (limited to 'machines/xnet')
-rw-r--r--machines/xnet/default.nix44
-rw-r--r--machines/xnet/desktop/default.nix8
-rw-r--r--machines/xnet/users.nix106
3 files changed, 49 insertions, 109 deletions
diff --git a/machines/xnet/default.nix b/machines/xnet/default.nix
index 578db03..138bd53 100644
--- a/machines/xnet/default.nix
+++ b/machines/xnet/default.nix
@@ -1,11 +1,10 @@
-{ lib, ... }:
+{ pkgs, lib, ... }:
let
inherit (lib) mkDefault;
in
{
imports = [
./disk.nix
- ./users.nix
./nginx.nix
./persist.nix
./net
@@ -36,4 +35,45 @@ in
doc.enable = mkDefault false;
info.enable = mkDefault false;
};
+
+ users.mutableUsers = false;
+
+ security.sudo = {
+ execWheelOnly = true;
+ extraConfig = "Defaults lecture = never";
+ };
+
+ programs.ssh = {
+ knownHosts = {
+ "github.com".publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl";
+ "gitlab.com".publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAfuCHKVTjquxvt6CM6tdG4SLp1Btn/nOeHHE5UOzRdf";
+ "git.sr.ht".publicKey = " ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMZvRd4EtM7R+IHVMWmDkVU3VLQTSwQDSAvW0t2Tkj60";
+ "pascal.ee.ryerson.ca".publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFmWInQNT6EoU1NtUYzTs5jtpfbO/m6yvCckOiEGjvDc";
+ };
+ extraConfig = ''
+ Host github
+ HostName github.com
+ User git
+ PreferredAuthentications publickey
+
+ Host ee
+ HostName pascal.ee.ryerson.ca
+ User kbujari
+ '';
+ };
+
+ programs.git = {
+ enable = true;
+ config = {
+ init.defaultBranch = "master";
+ fetch.prune = true;
+ core.excludesFile = pkgs.writeText "gitignore" ''
+ # dev shell caching
+ .direnv/
+ .envrc
+ '';
+ push.default = "upstream";
+ push.autoSetupRemote = true;
+ };
+ };
}
diff --git a/machines/xnet/desktop/default.nix b/machines/xnet/desktop/default.nix
index 16c6873..9a1f701 100644
--- a/machines/xnet/desktop/default.nix
+++ b/machines/xnet/desktop/default.nix
@@ -79,7 +79,13 @@ in
};
programs = {
- fish.enable = true;
+ fish = {
+ enable = true;
+ interactiveShellInit = ''
+ # disable greeting
+ set fish_greeting
+ '';
+ };
light.enable = mkDefault true;
direnv = {
enable = true;
diff --git a/machines/xnet/users.nix b/machines/xnet/users.nix
deleted file mode 100644
index 7995b94..0000000
--- a/machines/xnet/users.nix
+++ /dev/null
@@ -1,106 +0,0 @@
-{ pkgs, lib, config, ... }:
-let
- inherit (builtins)
- elem
- ;
-
- inherit (lib)
- mkOption
- mkIf
- types
- ;
-
- cfg = config.xnet.users;
-
- userEn = user: elem user cfg.enable;
-
- gitKeys = builtins.fetchurl {
- url = "https://github.com/kbujari.keys";
- sha256 = "0fpa679zkrpx77vangzf3gnidwvmky8ifivn8411xx6albrikaqx";
- };
-
-in
-{
-
- options.xnet.users = {
- enable = mkOption {
- type = types.listOf (types.enum [ "kle" ]);
- default = [ ];
- description = "Users to enable.";
- };
- };
-
- config = {
- users = {
- mutableUsers = false;
- users.root = {
- initialHashedPassword = "$y$j9T$eGwGb5tZwhk/.K0Lezsx4/$dJ4AODPBo0RBkVoCh1MVZTtkkDRn/C6A/XQIKt2YBNA";
- openssh.authorizedKeys.keys = lib.splitString "\n" (builtins.readFile gitKeys);
- };
- users.kle = mkIf (userEn "kle") {
- initialHashedPassword = "$6$R4dDhaftX.vapGMd$.An36hlp3DXfkIC7bPZ0MDPo6Zvpk8JRrhy2LES.lZZj6JDa74oJkcMW3DCsIySvLJxOPXSShos0TpgJ/w0fH/";
- isNormalUser = true;
- shell = pkgs.fish;
- home = "/persist/usr/kle";
- createHome = true;
- extraGroups = [ "wheel" "users" "networkmanager" "video" ];
- packages = with pkgs; [
- btop
- curl
- fzf
- jq
- lynx
- neovim
- ranger
- ripgrep
- rsync
- sshfs
- tree
- zip
- ];
- openssh.authorizedKeys.keys = lib.splitString "\n" (builtins.readFile gitKeys);
- };
- };
-
- disko.devices.zpool.zroot.datasets = { };
-
- security.sudo = {
- execWheelOnly = true;
- extraConfig = "Defaults lecture = never";
- };
-
- programs.ssh = {
- knownHosts = {
- "github.com".publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl";
- "gitlab.com".publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAfuCHKVTjquxvt6CM6tdG4SLp1Btn/nOeHHE5UOzRdf";
- "git.sr.ht".publicKey = " ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMZvRd4EtM7R+IHVMWmDkVU3VLQTSwQDSAvW0t2Tkj60";
- "pascal.ee.ryerson.ca".publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFmWInQNT6EoU1NtUYzTs5jtpfbO/m6yvCckOiEGjvDc";
- };
- extraConfig = ''
- Host github
- HostName github.com
- User git
- PreferredAuthentications publickey
-
- Host ee
- HostName pascal.ee.ryerson.ca
- User kbujari
- '';
- };
-
- programs.git = {
- enable = true;
- config = {
- init.defaultBranch = "master";
- fetch.prune = true;
- core.excludesFile = pkgs.writeText "gitignore" ''
- # dev shell caching
- .direnv/
- .envrc
- '';
- push.default = "upstream";
- push.autoSetupRemote = true;
- };
- };
- };
-}