diff --git a/.forgejo/workflows/discord.yml b/.forgejo/workflows/discord.yml index 559def8..a1c1034 100644 --- a/.forgejo/workflows/discord.yml +++ b/.forgejo/workflows/discord.yml @@ -5,6 +5,7 @@ on: push: paths: - 'devices/oksys/*' + - 'devices/servivi/*' jobs: discord_commits: diff --git a/devices/servivi/default.nix b/devices/servivi/default.nix new file mode 100644 index 0000000..da3b418 --- /dev/null +++ b/devices/servivi/default.nix @@ -0,0 +1,49 @@ +{config, ...}: { + imports = [ + ./hardware-configuration.nix + + ../../modules/kmscon.nix + ../../modules/tailscale.nix + ]; + + vars = { + user = "matt"; + hostName = "servivi"; + }; + + users.users.${config.vars.user} = { + isNormalUser = true; + extraGroups = [ + "wheel" + "adm" + ]; + }; + home-manager.users.${config.vars.user} = { + imports = []; + + # No touchy + home.stateVersion = "24.05"; + }; + + networking = { + inherit (config.vars) hostName; + resolvconf.enable = true; + firewall.enable = false; + }; + + services = { + openssh = { + enable = true; + settings = { + PasswordAuthentication = false; + PermitRootLogin = "no"; + }; + }; + }; + + # Set your time zone. + time.timeZone = "America/Montreal"; + + # No touchy + system.stateVersion = "24.05"; +} diff --git a/devices/servivi/hardware-configuration.nix b/devices/servivi/hardware-configuration.nix new file mode 100644 index 0000000..28992b4 --- /dev/null +++ b/devices/servivi/hardware-configuration.nix @@ -0,0 +1,43 @@ +{ + config, + modulesPath, + ... +}: { + nixpkgs.hostPlatform = "x86_64-linux"; + imports = [(modulesPath + "/installer/scan/not-detected.nix")]; + + boot = { + loader = { + timeout = 2; + + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + + kernelModules = ["kvm-amd"]; + initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "ahci" + "usb_storage" + "usbhid" + "sd_mod" + ]; + }; + + fileSystems = { + "/" = { + device = "/dev/disk/by-label/NIXROOT"; + fsType = "btrfs"; + }; + + "/boot" = { + device = "/dev/disk/by-label/NIXBOOT"; + fsType = "vfat"; + }; + }; + + zramSwap.enable = true; + + hardware.cpu.amd.updateMicrocode = config.hardware.enableRedistributableFirmware; +} diff --git a/flake.nix b/flake.nix index 987109c..e7df663 100644 --- a/flake.nix +++ b/flake.nix @@ -33,6 +33,7 @@ wim = mkNixOS [./devices/wim]; binto = mkNixOS [./devices/binto]; + servivi = mkNixOS [./devices/servivi]; oksys = mkNixOS [ ./devices/oksys secrets.nixosModules.oksys diff --git a/modules/tailscale.nix b/modules/tailscale.nix index c0c0791..b1de07f 100644 --- a/modules/tailscale.nix +++ b/modules/tailscale.nix @@ -12,13 +12,14 @@ home-manager.users.${config.vars.user}.programs.bash.shellAliases = { tup = "tailscale up --login-server https://headscale.nelim.org"; - pc = "mosh matt@binto -- tmux -2u new -At laptop"; - oksys = "mosh matt@oksys -- tmux -2u new -At laptop"; - pve = "mosh matt@pve -- tmux -2u new -At laptop"; + pc = "mosh matt@binto -- tmux -2u new -At ${config.vars.hostName}"; + oksys = "mosh matt@oksys -- tmux -2u new -At ${config.vars.hostName}"; + servivi = "mosh matt@servivi -- tmux -2u new -At ${config.vars.hostName}"; + pve = "mosh matt@pve -- tmux -2u new -At ${config.vars.hostName}"; - mc = "mosh mc@mc -- tmux -2u new -At laptop"; - pod = "mosh matt@pve -- ssh -t -p 6768 matt@10.0.0.122 'tmux -2u new -At laptop'"; - jelly = "mosh matt@pve -- ssh -t matt@10.0.0.123 'tmux -2u new -At laptop'"; - qbit = "mosh matt@pve -- ssh -t matt@10.0.0.128 'tmux -2u new -At laptop'"; + mc = "mosh mc@mc -- tmux -2u new -At ${config.vars.hostName}"; + pod = "mosh matt@pve -- ssh -t -p 6768 matt@10.0.0.122 'tmux -2u new -At ${config.vars.hostName}'"; + jelly = "mosh matt@pve -- ssh -t matt@10.0.0.123 'tmux -2u new -At ${config.vars.hostName}'"; + qbit = "mosh matt@pve -- ssh -t matt@10.0.0.128 'tmux -2u new -At ${config.vars.hostName}'"; }; }