transform the other hosts to flake

This commit is contained in:
Vinzenz Schroeter 2024-10-26 14:59:00 +02:00
parent 5944fe5cca
commit f41cd58e54
12 changed files with 90 additions and 90 deletions

View file

@ -22,14 +22,11 @@
zsh.enable = true; zsh.enable = true;
htop.enable = true; htop.enable = true;
iotop.enable = true; iotop.enable = true;
git.enable = true;
nano = { nano = {
enable = true; enable = true;
syntaxHighlight = true; syntaxHighlight = true;
}; };
git = {
enable = true;
package = pkgs.gitFull;
};
}; };
}; };
} }

View file

@ -19,7 +19,6 @@
}: let }: let
common-modules = [ common-modules = [
lix-module.nixosModules.default lix-module.nixosModules.default
home-manager.nixosModules.home-manager
./common ./common
]; ];
in { in {
@ -29,9 +28,32 @@
modules = modules =
common-modules common-modules
++ [ ++ [
home-manager.nixosModules.home-manager
./hosts/vinzenz-lpt2 ./hosts/vinzenz-lpt2
]; ];
}; };
vinzenz-pc2 = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules =
common-modules
++ [
home-manager.nixosModules.home-manager
./hosts/vinzenz-pc2
];
};
hetzner-vpn1 = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
modules =
common-modules
++ [
./hosts/hetzner-vpn1
{
# uncomment for build check on non arm system (requires --impure)
# nixpkgs.buildPlatform = builtins.currentSystem;
}
];
};
}; };
}; };
} }

View file

@ -0,0 +1,9 @@
{...}: {
imports = [
./hardware.nix
./environment.nix
];
config = {
networking.hostName = "hetzner-vpn1";
};
}

View file

@ -24,18 +24,11 @@
pc2 = "vinzenz-pc2.donkey-pentatonic.ts.net"; pc2 = "vinzenz-pc2.donkey-pentatonic.ts.net";
in { in {
imports = [ imports = [
(import ./modules { ../../users/vinzenz.nix
hostName = "hetzner-vpn1"; ../../users/ronja.nix
enableHomeManager = false;
})
]; ];
config = { config = {
my = {
enabledUsers = ["ronja" "vinzenz"];
tailscale.enable = true;
};
users.users = { users.users = {
root.openssh.authorizedKeys.keys = [ root.openssh.authorizedKeys.keys = [
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf''

View file

@ -96,7 +96,6 @@
services.udev.extraRules = '' services.udev.extraRules = ''
ATTR{address}=="96:00:02:87:7f:c9", NAME="eth0" ATTR{address}=="96:00:02:87:7f:c9", NAME="eth0"
''; '';
}; };
} }

View file

@ -5,5 +5,7 @@
]; ];
config = { config = {
networking.hostName = "vinzenz-lpt2"; networking.hostName = "vinzenz-lpt2";
nix.settings.extra-platforms = ["aarch64-linux"];
}; };
} }

View file

@ -27,11 +27,11 @@
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH''
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming''
]; ];
#
#users.users.ronja.openssh.authorizedKeys.keys = [ #users.users.ronja.openssh.authorizedKeys.keys = [
# ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' # ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key''
#]; #];
#
services.nginx = { services.nginx = {
enable = true; enable = true;

View file

@ -0,0 +1,9 @@
{...}: {
imports = [
./hardware.nix
./environment.nix
];
config = {
networking.hostName = "vinzenz-pc2";
};
}

View file

@ -1,26 +1,18 @@
{pkgs, ...}: { {pkgs, ...}: {
imports = [ imports = [
(import ./modules { ../../home
hostName = "vinzenz-pc2"; ../../home/gnome.nix
enableHomeManager = true; ../../users/vinzenz.nix
}) ../../modules/desktop-environment.nix
../../modules/gnome.nix
../../modules/gaming.nix
../../modules/printing.nix
]; ];
config = { config = {
my = { home-manager.users = {
enabledUsers = ["vinzenz" "ronja"]; vinzenz = import ../../home/vinzenz;
tailscale.enable = true; ronja = import ../../home/ronja;
desktop = {
enableGnome = true;
enableGaming = true;
enablePrinting = true;
};
buildtools = {
native = true;
dotnet = true;
rust = true;
jetbrains-remote-server = true;
};
}; };
users.users.vinzenz.openssh.authorizedKeys.keys = [ users.users.vinzenz.openssh.authorizedKeys.keys = [
@ -39,7 +31,7 @@
port = 8542; port = 8542;
host = "100.125.93.127"; # tailscale host = "100.125.93.127"; # tailscale
withoutConnectionToken = true; withoutConnectionToken = true;
extraPackages = with pkgs; [nodejs gitFull gh direnv]; extraPackages = with pkgs; [nodejs git gh direnv];
}; };
virtualisation.podman = { virtualisation.podman = {

View file

@ -1,12 +1,12 @@
{...}: { {...}: {
imports = [
../../modules/desktop-hardware.nix
../../modules/amd-graphics.nix
];
config = { config = {
my.hardware = { # amd cpu
enableCommonDesktopSettings = true; boot.kernelModules = ["kvm-amd"];
amd = { hardware.cpu.amd.updateMicrocode = true;
cpu = true;
gpu = true;
};
};
boot = { boot = {
initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "sd_mod"]; # "usb_storage" initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "sd_mod"]; # "usb_storage"

24
modules/amd-graphics.nix Normal file
View file

@ -0,0 +1,24 @@
{
lib,
config,
pkgs,
...
}: {
config = {
boot.kernelModules = ["amdgpu"];
services.xserver.videoDrivers = ["amdgpu"];
hardware.opengl = {
extraPackages = with pkgs; [
amdvlk
];
extraPackages32 = with pkgs; [
driversi686Linux.amdvlk
];
};
environment.systemPackages = with pkgs; [
nvtopPackages.amd
];
};
}

View file

@ -1,47 +0,0 @@
{
lib,
config,
pkgs,
...
}: let
cfg = config.my.hardware.amd;
in {
options.my.hardware.amd = {
cpu = lib.mkEnableOption "amd cpu";
gpu = lib.mkEnableOption "amd gpu";
radeon = lib.mkEnableOption "amd legacy gpu"; # old hardware, dont judge
};
config = lib.mkMerge [
(lib.mkIf cfg.cpu {
boot.kernelModules = ["kvm-amd"];
hardware.cpu.amd.updateMicrocode = true;
})
(lib.mkIf cfg.gpu {
boot.kernelModules = ["amdgpu"];
services.xserver.videoDrivers = ["amdgpu"];
hardware.opengl = {
extraPackages = with pkgs; [
amdvlk
];
extraPackages32 = with pkgs; [
driversi686Linux.amdvlk
];
};
environment.systemPackages = with pkgs; [
nvtopPackages.amd
];
})
(lib.mkIf cfg.radeon {
boot.kernelModules = ["radeon"];
services.xserver.videoDrivers = ["radeon"];
environment.systemPackages = with pkgs; [
radeontop
];
})
];
}