diff --git a/flake.lock b/flake.lock index da3a10f..71a1602 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,25 @@ { "nodes": { + "disko": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1705540973, + "narHash": "sha256-kNt/qAEy7ueV7NKbVc8YMHWiQAAgrir02MROYNI8fV0=", + "owner": "nix-community", + "repo": "disko", + "rev": "0033adc6e3f1ed076f3ed1c637ef1dfe6bef6733", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "disko", + "type": "github" + } + }, "firefox-addons": { "inputs": { "flake-utils": [ @@ -11,11 +31,11 @@ }, "locked": { "dir": "pkgs/firefox-addons", - "lastModified": 1705103913, - "narHash": "sha256-PX6zS6uni5IXZMUQB2DUbhj+oV7QyAfwEEenOb/DstU=", + "lastModified": 1705534402, + "narHash": "sha256-mOWT45HLd8dm8FJNmrgngotE5NRJ+2arz65m1Kk0LBA=", "owner": "rycee", "repo": "nur-expressions", - "rev": "c8e94a42015531a061a4518aff7aee03d5a4f215", + "rev": "6a928ce99e4ccb09e59c1f58052bd65027249c8a", "type": "gitlab" }, "original": { @@ -84,11 +104,11 @@ ] }, "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", "owner": "numtide", "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", "type": "github" }, "original": { @@ -164,11 +184,11 @@ ] }, "locked": { - "lastModified": 1705169127, - "narHash": "sha256-j9OEtNxOIPWZWjbECVMkI1TO17SzlpHMm0LnVWKOR/g=", + "lastModified": 1705535278, + "narHash": "sha256-V5+XKfNbiY0bLKLQlH+AXyhHttEL7XcZBH9iSbxxexA=", "owner": "nix-community", "repo": "home-manager", - "rev": "f2942f3385f1b35cc8a1abb03a45e29c9cb4d3c8", + "rev": "b84191db127c16a92cbdf7f7b9969d58bb456699", "type": "github" }, "original": { @@ -185,11 +205,11 @@ ] }, "locked": { - "lastModified": 1705231543, - "narHash": "sha256-W8j0A5n2WOpCgdFRqMqwd9adNORcN1r/DpjRVxiFkAw=", + "lastModified": 1705487282, + "narHash": "sha256-eX/0O2ybmFKD/MzYO8gDlr4tAurekDbJQa7olAFFbRo=", "owner": "Jovian-Experiments", "repo": "Jovian-NixOS", - "rev": "ab807f9740c533070e8b68b0d86034d4a293b5f1", + "rev": "a00331e522b9a732f876cf707174ce37ae702762", "type": "github" }, "original": { @@ -201,15 +221,17 @@ "kde2nix": { "inputs": { "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs", + "nixpkgs": [ + "nixpkgs" + ], "pre-commit-hooks": "pre-commit-hooks" }, "locked": { - "lastModified": 1705232580, - "narHash": "sha256-OJHqtLx+VHgwJL8GcpDouQiwDybQ4mzwLwtXPG9QLqg=", + "lastModified": 1705586702, + "narHash": "sha256-nypd81B18pEHBT/TiKe/rXHUesJGSDy3aObWO61N25M=", "owner": "nix-community", "repo": "kde2nix", - "rev": "155d24c82dde0f4738f05760e5dfc1c13d84fe11", + "rev": "3a7bb677935b857327d7f4fa5e7bb1dfaa274331", "type": "github" }, "original": { @@ -236,11 +258,11 @@ }, "nix-filter": { "locked": { - "lastModified": 1701697642, - "narHash": "sha256-L217WytWZHSY8GW9Gx1A64OnNctbuDbfslaTEofXXRw=", + "lastModified": 1705332318, + "narHash": "sha256-kcw1yFeJe9N4PjQji9ZeX47jg0p9A0DuU4djKvg1a7I=", "owner": "numtide", "repo": "nix-filter", - "rev": "c843418ecfd0344ecb85844b082ff5675e02c443", + "rev": "3449dc925982ad46246cfc36469baf66e1b64f17", "type": "github" }, "original": { @@ -296,11 +318,11 @@ ] }, "locked": { - "lastModified": 1701689616, - "narHash": "sha256-ewnfgvRy73HoP5KnYmy1Rcr4m4yShvsb6TCCaKoW8pc=", + "lastModified": 1705400161, + "narHash": "sha256-0MFaNIwwpVWB1N9m7cfHAM2pSVtYESQ7tlHxnDTOhM4=", "owner": "nix-community", "repo": "nixos-generators", - "rev": "246219bc21b943c6f6812bb7744218ba0df08600", + "rev": "521fb4cdd8a2e1a00d1adf0fea7135d1faf04234", "type": "github" }, "original": { @@ -311,11 +333,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1705187059, - "narHash": "sha256-dSj+iIYqLA+7/5rLXWfUxw9IXRm0w8Mrm39af8klUH0=", + "lastModified": 1705312285, + "narHash": "sha256-rd+dY+v61Y8w3u9bukO/hB55Xl4wXv4/yC8rCGVnK5U=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "ef811636cc847355688804593282078bac7758d4", + "rev": "bee2202bec57e521e3bd8acd526884b9767d7fa0", "type": "github" }, "original": { @@ -326,11 +348,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1705133751, - "narHash": "sha256-rCIsyE80jgiOU78gCWN3A0wE0tR2GI5nH6MlS+HaaSQ=", + "lastModified": 1705496572, + "narHash": "sha256-rPIe9G5EBLXdBdn9ilGc0nq082lzQd0xGGe092R/5QE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9b19f5e77dd906cb52dade0b7bd280339d2a1f3d", + "rev": "842d9d80cfd4560648c785f8a4e6f3b096790e19", "type": "github" }, "original": { @@ -343,11 +365,11 @@ "nixpkgs-lib": { "locked": { "dir": "lib", - "lastModified": 1705133751, - "narHash": "sha256-rCIsyE80jgiOU78gCWN3A0wE0tR2GI5nH6MlS+HaaSQ=", + "lastModified": 1705496572, + "narHash": "sha256-rPIe9G5EBLXdBdn9ilGc0nq082lzQd0xGGe092R/5QE=", "owner": "nixos", "repo": "nixpkgs", - "rev": "9b19f5e77dd906cb52dade0b7bd280339d2a1f3d", + "rev": "842d9d80cfd4560648c785f8a4e6f3b096790e19", "type": "github" }, "original": { @@ -374,30 +396,14 @@ "type": "github" } }, - "nixpkgs_2": { - "locked": { - "lastModified": 1705133751, - "narHash": "sha256-rCIsyE80jgiOU78gCWN3A0wE0tR2GI5nH6MlS+HaaSQ=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "9b19f5e77dd906cb52dade0b7bd280339d2a1f3d", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "openrgb": { "flake": false, "locked": { - "lastModified": 1705174352, - "narHash": "sha256-ZRraHGcGHctHi1pNAOOKhvWPSbkdnBGbEJOQd+o7IDQ=", + "lastModified": 1705251489, + "narHash": "sha256-UaShlE/VT2mmSO1F91GIUYwTmSPdOOPJRhkzgKIjwkY=", "owner": "CalcProgrammer1", "repo": "OpenRGB", - "rev": "ccec0828f99616db36fca4e451c62e35d2833355", + "rev": "b79cf82d9676ff1993e43fcec0630b906f84773c", "type": "gitlab" }, "original": { @@ -488,11 +494,11 @@ ] }, "locked": { - "lastModified": 1705222259, - "narHash": "sha256-JAsVJjT3hCMXZk6YJIcGBH03rPREIUI0GLILPhKA1YU=", + "lastModified": 1705531696, + "narHash": "sha256-4d3fGCTx/gwhFliXJg1f6hx9IIIF7zXY2KHSz2XRPPk=", "owner": "PrismLauncher", "repo": "PrismLauncher", - "rev": "5a0240e709856c3cc4e2ebeeebcf6e56ab544bfc", + "rev": "b2c2bf1460eaa89e921ea3fe4cd53ac21c656b79", "type": "github" }, "original": { @@ -503,6 +509,7 @@ }, "root": { "inputs": { + "disko": "disko", "firefox-addons": "firefox-addons", "flake-compat": "flake-compat", "flake-parts": "flake-parts", @@ -516,7 +523,7 @@ "nix-systems": "nix-systems", "nixos-generators": "nixos-generators", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs", "nixpkgs-lib": "nixpkgs-lib", "openrgb": "openrgb", "pre-commit-hooks": "pre-commit-hooks_2", @@ -542,11 +549,11 @@ "tela-icon-theme": { "flake": false, "locked": { - "lastModified": 1702743716, - "narHash": "sha256-Ec8AjgDkpsqa8ZcXIT4235N1FJHlCX8+XwtBQ70uxHI=", + "lastModified": 1705509115, + "narHash": "sha256-J9SUKqpr9kZ0h6KJf2j5FYfu+fWEvQhVYUZ2hETAIz4=", "owner": "vinceliuice", "repo": "Tela-icon-theme", - "rev": "6b1c74d9aa7b26e188a65757a9df1fb1f4a3eddd", + "rev": "7a700e563df55ae2b28f15033e8b2ce766c06243", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 9e8d121..b68e36b 100644 --- a/flake.nix +++ b/flake.nix @@ -2,8 +2,15 @@ description = "jopejoe1 NixOS configuration"; inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - kde2nix.url = "github:nix-community/kde2nix"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + kde2nix = { + url = "github:nix-community/kde2nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + disko = { + url = "github:nix-community/disko"; + inputs.nixpkgs.follows = "nixpkgs"; + }; firefox-addons = { url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/modules/default.nix b/modules/default.nix index e4e6b6b..6f6a1bb 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -22,9 +22,11 @@ ./steam ./sway ./users + ./zerotierone ../upstream self.inputs.home-manager.nixosModules.home-manager self.inputs.kde2nix.nixosModules.plasma6 + self.inputs.disko.nixosModules.disko self.inputs.nixos-generators.nixosModules.all-formats ]; } diff --git a/modules/zerotierone/default.nix b/modules/zerotierone/default.nix new file mode 100644 index 0000000..d21e4e2 --- /dev/null +++ b/modules/zerotierone/default.nix @@ -0,0 +1,17 @@ +{ config, lib, pkgs, ... }: + +let cfg = config.jopejoe1.zerotierone; +in { + options.jopejoe1.zerotierone = { + enable = lib.mkEnableOption "Enable zerotierone"; + }; + + config = lib.mkIf cfg.enable { + services.zerotierone.enable = true; + services.zerotierone.joinNetworks = [ "7c31a21e86f9a75c" ]; + environment.systemPackages = with pkgs; [ + moonlight-qt + ]; + }; +} + diff --git a/systems/default.nix b/systems/default.nix index f4a2d6a..e2992a3 100644 --- a/systems/default.nix +++ b/systems/default.nix @@ -25,4 +25,6 @@ in benzaiten = mkSystem "x86_64-unknown-linux-gnu" "benzaiten"; kamimusubi = mkSystem "x86_64-unknown-linux-gnu" "kamimusubi"; ebisu = mkSystem "x86_64-unknown-linux-gnu" "ebisu"; + hetzner = mkSystem "x86_64-unknown-linux-gnu" "hetzner"; + zap = mkSystem "x86_64-unknown-linux-gnu" "zap"; } diff --git a/systems/hetzner/default.nix b/systems/hetzner/default.nix new file mode 100644 index 0000000..69ca8f5 --- /dev/null +++ b/systems/hetzner/default.nix @@ -0,0 +1,123 @@ +{ config, pkgs, lib, ... }: + +{ + jopejoe1 = { + local.enable = true; + nix.enable = true; + user = { + jopejoe1.enable = true; + root.enable = true; + }; + ssh.enable = true; + }; + + boot.initrd.availableKernelModules = [ "ahci" "nvme" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + boot.loader = { + grub = { + enable = true; + }; + }; + + + networking = { + wireless.enable = lib.mkForce false; + }; + + time.timeZone = "Europe/Berlin"; + + services.openssh.settings.PermitRootLogin = lib.mkForce "yes"; + + console = { + enable = true; + }; + disko.devices = { + disk = { + one = { + type = "disk"; + device = "/dev/nvme0n1"; + content = { + type = "gpt"; + partitions = { + BOOT = { + size = "1M"; + type = "EF02"; # for grub MBR + }; + ESP = { + size = "500M"; + type = "EF00"; + content = { + type = "mdraid"; + name = "boot"; + }; + }; + mdadm = { + size = "100%"; + content = { + type = "mdraid"; + name = "raid1"; + }; + }; + }; + }; + }; + two = { + type = "disk"; + device = "/dev/nvme1n1"; + content = { + type = "gpt"; + partitions = { + boot = { + size = "1M"; + type = "EF02"; # for grub MBR + }; + ESP = { + size = "500M"; + type = "EF00"; + content = { + type = "mdraid"; + name = "boot"; + }; + }; + mdadm = { + size = "100%"; + content = { + type = "mdraid"; + name = "raid1"; + }; + }; + }; + }; + }; + }; + mdadm = { + boot = { + type = "mdadm"; + level = 1; + metadata = "1.0"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + raid1 = { + type = "mdadm"; + level = 1; + content = { + type = "gpt"; + partitions.primary = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + }; + }; + }; + }; + }; +} diff --git a/systems/kuraokami/default.nix b/systems/kuraokami/default.nix index 9320ba1..5d6fd38 100644 --- a/systems/kuraokami/default.nix +++ b/systems/kuraokami/default.nix @@ -27,6 +27,7 @@ sway.enable = true; minecraft-server.enable = true; repo-sync.enable = true; + zerotierone.enable = true; keyboard = { enable = true; layout = "de"; @@ -102,5 +103,6 @@ gamemode.enable = true; }; - nix.settings.system-features = [ "gccarch-alderlake" "benchmark" "big-parallel" "kvm" "nixos-test" ]; + nix.settings.system-features = [ "gccarch-alderlake" "benchmark" "big-parallel" "kvm" "nixos-test" ] + ++ map (x: "gccarch-${x}") (lib.systems.architectures.inferiors.alderlake or []); } diff --git a/systems/zap/default.nix b/systems/zap/default.nix new file mode 100644 index 0000000..ef36cac --- /dev/null +++ b/systems/zap/default.nix @@ -0,0 +1,84 @@ +{ config, pkgs, lib, modulesPath, ... }: + +{ + jopejoe1 = { + local.enable = true; + nix.enable = true; + user = { + jopejoe1.enable = true; + root.enable = true; + }; + ssh.enable = true; + }; + + imports = + [ (modulesPath + "/profiles/qemu-guest.nix") + ]; + + boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ]; + + boot.loader = { + grub = { + enable = true; + device = "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi0"; + }; + }; + + services.openssh.listenAddresses = [ + { + addr = "134.255.219.135"; + port = 22; + } + ] + + + + networking = { + wireless.enable = lib.mkForce false; + }; + + time.timeZone = "Europe/Berlin"; + + services.openssh.settings.PermitRootLogin = lib.mkForce "yes"; + + console = { + enable = true; + }; + disko.devices = { + disk = { + vdb = { + device = "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi0"; + type = "disk"; + content = { + type = "table"; + format = "msdos"; + partitions = [ + { + name = "ESP"; + start = "1M"; + end = "500M"; + bootable = true; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + } + { + name = "root"; + start = "500M"; + end = "100%"; + part-type = "primary"; + bootable = true; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + } + ]; + }; + }; + }; + }; +}