From 441d9785c93c4522094db9ff5454ac53d5ec8b04 Mon Sep 17 00:00:00 2001 From: iofq Date: Sat, 27 Jan 2024 14:28:21 -0600 Subject: [PATCH] init htz --- flake.lock | 546 +++++++++++++++++- flake.nix | 13 +- .../shared/wayland/alacritty/default.nix | 4 +- home-manager/shared/wayland/sway/default.nix | 6 + home-manager/t14/home.nix | 9 +- nixos/contabo/hardware-configuration.nix | 10 - nixos/default.nix | 8 +- nixos/{contabo => htz}/configuration.nix | 6 +- nixos/htz/eth.nix | 71 +++ nixos/htz/hardware-configuration.nix | 63 ++ nixos/htz/vms.nix | 15 + nixos/t14/configuration.nix | 33 +- 12 files changed, 744 insertions(+), 40 deletions(-) delete mode 100755 nixos/contabo/hardware-configuration.nix rename nixos/{contabo => htz}/configuration.nix (93%) create mode 100644 nixos/htz/eth.nix create mode 100755 nixos/htz/hardware-configuration.nix create mode 100644 nixos/htz/vms.nix diff --git a/flake.lock b/flake.lock index b52de72..7eed0e9 100755 --- a/flake.lock +++ b/flake.lock @@ -1,9 +1,162 @@ { "nodes": { - "flake-utils": { + "devour-flake": { + "flake": false, + "locked": { + "lastModified": 1699722684, + "narHash": "sha256-LapKkHNZ8D3k/uLaJjmGxx7GuYRinGBxEkIAGb/8pCo=", + "owner": "srid", + "repo": "devour-flake", + "rev": "c89ad7a611caef31899292bc8f9aae9e7aa251cb", + "type": "github" + }, + "original": { + "owner": "srid", + "repo": "devour-flake", + "type": "github" + } + }, + "devshell": { "inputs": { + "nixpkgs": [ + "ethereum-nix", + "nixpkgs" + ], "systems": "systems" }, + "locked": { + "lastModified": 1701787589, + "narHash": "sha256-ce+oQR4Zq9VOsLoh9bZT8Ip9PaMLcjjBUHVPzW5d7Cw=", + "owner": "numtide", + "repo": "devshell", + "rev": "44ddedcbcfc2d52a76b64fb6122f209881bd3e1e", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, + "ethereum-nix": { + "inputs": { + "devour-flake": "devour-flake", + "devshell": "devshell", + "flake-compat": "flake-compat", + "flake-parts": "flake-parts", + "flake-root": "flake-root", + "foundry-nix": "foundry-nix", + "lib-extras": "lib-extras", + "mynixpkgs": "mynixpkgs", + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-unstable": "nixpkgs-unstable", + "poetry2nix": "poetry2nix", + "treefmt-nix": "treefmt-nix_2" + }, + "locked": { + "lastModified": 1705787058, + "narHash": "sha256-jN7EObGkFC0ciri2g/PDUrgfryiHEorhCAULN9+UJ+I=", + "ref": "refs/heads/main", + "rev": "0407591fca0931ec2b3762ba893eeabf0c4af296", + "revCount": 302, + "type": "git", + "url": "file:///home/e/dev/ethereum.nix/" + }, + "original": { + "type": "git", + "url": "file:///home/e/dev/ethereum.nix/" + } + }, + "flake-compat": { + "locked": { + "lastModified": 1688025799, + "narHash": "sha256-ktpB4dRtnksm9F5WawoIkEneh1nrEvuxb5lJFt1iOyw=", + "owner": "nix-community", + "repo": "flake-compat", + "rev": "8bf105319d44f6b9f0d764efa4fdef9f1cc9ba1c", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "ethereum-nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1704152458, + "narHash": "sha256-DS+dGw7SKygIWf9w4eNBUZsK+4Ug27NwEWmn2tnbycg=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "88a2cd8166694ba0b6cb374700799cec53aef527", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-root": { + "locked": { + "lastModified": 1692742795, + "narHash": "sha256-f+Y0YhVCIJ06LemO+3Xx00lIcqQxSKJHXT/yk1RTKxw=", + "owner": "srid", + "repo": "flake-root", + "rev": "d9a70d9c7a5fd7f3258ccf48da9335e9b47c3937", + "type": "github" + }, + "original": { + "owner": "srid", + "repo": "flake-root", + "type": "github" + } + }, + "flake-utils": { + "locked": { + "lastModified": 1644229661, + "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_3": { + "inputs": { + "systems": "systems_4" + }, "locked": { "lastModified": 1701680307, "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", @@ -18,6 +171,67 @@ "type": "github" } }, + "flake-utils_4": { + "inputs": { + "systems": "systems_5" + }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "foundry-nix": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1706346533, + "narHash": "sha256-ccqnThgOxMPh0/8T+uxcECkFUyr1oJ00MmaT1/WwcWM=", + "owner": "shazow", + "repo": "foundry.nix", + "rev": "09fccbe99e5e7763f3f0cdc3eb5ae15d07f45c36", + "type": "github" + }, + "original": { + "owner": "shazow", + "ref": "monthly", + "repo": "foundry.nix", + "type": "github" + } + }, + "haumea": { + "inputs": { + "nixpkgs": [ + "ethereum-nix", + "mynixpkgs", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1685133229, + "narHash": "sha256-FePm/Gi9PBSNwiDFq3N+DWdfxFq0UKsVVTJS3cQPn94=", + "owner": "nix-community", + "repo": "haumea", + "rev": "34dd58385092a23018748b50f9b23de6266dffc2", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "v0.2.2", + "repo": "haumea", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -25,11 +239,11 @@ ] }, "locked": { - "lastModified": 1703808179, - "narHash": "sha256-svlFDbozZlZJwnnSoeh5yE9jEnCmgmuRMRX866CL4J0=", + "lastModified": 1705823474, + "narHash": "sha256-2C4uRe9/U3QwSPC4dYKM1/njgCQk0Mltezy4VcjAqa4=", "owner": "nix-community", "repo": "home-manager", - "rev": "77c698fa4b3081b6019ad77d1bfedf06dbbde0db", + "rev": "928f2528f9ee952ba0a47bbb1ece8d93ed66e784", "type": "github" }, "original": { @@ -38,13 +252,141 @@ "type": "github" } }, + "lib-extras": { + "inputs": { + "devshell": [ + "ethereum-nix", + "devshell" + ], + "flake-parts": [ + "ethereum-nix", + "flake-parts" + ], + "flake-root": [ + "ethereum-nix", + "flake-root" + ], + "nixpkgs": [ + "ethereum-nix", + "nixpkgs" + ], + "treefmt-nix": [ + "ethereum-nix", + "treefmt-nix" + ] + }, + "locked": { + "lastModified": 1699974671, + "narHash": "sha256-4EsuPiX4pGEg8ME9ONn8ebY1ZKYLOp9DRCcdTrOj8sY=", + "owner": "aldoborrero", + "repo": "lib-extras", + "rev": "83c8935af27738b8b155e0077522220d81865269", + "type": "github" + }, + "original": { + "owner": "aldoborrero", + "ref": "v0.2.2", + "repo": "lib-extras", + "type": "github" + } + }, + "microvm": { + "inputs": { + "flake-utils": "flake-utils_3", + "nixpkgs": [ + "nixpkgs" + ], + "spectrum": "spectrum" + }, + "locked": { + "lastModified": 1706214321, + "narHash": "sha256-42FZWeJQNYgz0ZkclMzShuvjT9TvJNRN78Iu3SEyD4M=", + "owner": "astro", + "repo": "microvm.nix", + "rev": "186b8bf6dbacc1ab55fe8ac8d5a2bbf76a1a70e1", + "type": "github" + }, + "original": { + "owner": "astro", + "repo": "microvm.nix", + "type": "github" + } + }, + "mynixpkgs": { + "inputs": { + "devour-flake": [ + "ethereum-nix", + "devour-flake" + ], + "devshell": [ + "ethereum-nix", + "devshell" + ], + "flake-parts": [ + "ethereum-nix", + "flake-parts" + ], + "flake-root": [ + "ethereum-nix", + "flake-root" + ], + "haumea": "haumea", + "lib-extras": [ + "ethereum-nix", + "lib-extras" + ], + "nixpkgs": [ + "ethereum-nix", + "nixpkgs-unstable" + ], + "treefmt-nix": [ + "ethereum-nix", + "treefmt-nix" + ] + }, + "locked": { + "lastModified": 1702230402, + "narHash": "sha256-PwhdihM7lOp9l8jxqiNHDT29h0saSgedw6TYs1Y+bkQ=", + "owner": "aldoborrero", + "repo": "mynixpkgs", + "rev": "67a7db27330f85af19f3ce52ae06671e573968ea", + "type": "github" + }, + "original": { + "owner": "aldoborrero", + "repo": "mynixpkgs", + "type": "github" + } + }, + "nix-github-actions": { + "inputs": { + "nixpkgs": [ + "ethereum-nix", + "poetry2nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1698974481, + "narHash": "sha256-yPncV9Ohdz1zPZxYHQf47S8S0VrnhV7nNhCawY46hDA=", + "owner": "nix-community", + "repo": "nix-github-actions", + "rev": "4bb5e752616262457bc7ca5882192a564c0472d2", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-github-actions", + "type": "github" + } + }, "nixos-hardware": { "locked": { - "lastModified": 1703545041, - "narHash": "sha256-nvQA+k1rSszrf4kA4eK2i/SGbzoXyoKHzzyzq/Jca1w=", + "lastModified": 1705312285, + "narHash": "sha256-rd+dY+v61Y8w3u9bukO/hB55Xl4wXv4/yC8rCGVnK5U=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "a15b6e525f5737a47b4ce28445c836996fb2ea8c", + "rev": "bee2202bec57e521e3bd8acd526884b9767d7fa0", "type": "github" }, "original": { @@ -56,11 +398,40 @@ }, "nixpkgs": { "locked": { - "lastModified": 1703438236, - "narHash": "sha256-aqVBq1u09yFhL7bj1/xyUeJjzr92fXVvQSSEx6AdB1M=", + "lastModified": 1705496572, + "narHash": "sha256-rPIe9G5EBLXdBdn9ilGc0nq082lzQd0xGGe092R/5QE=", + "path": "/nix/store/wcidiyklj0nrljlz5m3qlkvhv8f2ddv8-source", + "rev": "842d9d80cfd4560648c785f8a4e6f3b096790e19", + "type": "path" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1704161960, + "narHash": "sha256-QGua89Pmq+FBAro8NriTuoO/wNaUtugt29/qqA8zeeM=", "owner": "nixos", "repo": "nixpkgs", - "rev": "5f64a12a728902226210bf01d25ec6cbb9d9265b", + "rev": "63143ac2c9186be6d9da6035fa22620018c85932", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1705677747, + "narHash": "sha256-eyM3okYtMgYDgmYukoUzrmuoY4xl4FUujnsv/P6I/zI=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "bbe7d8f876fbbe7c959c90ba2ae2852220573261", "type": "github" }, "original": { @@ -72,17 +443,17 @@ }, "nvim": { "inputs": { - "flake-utils": "flake-utils", + "flake-utils": "flake-utils_4", "nixpkgs": [ "nixpkgs" ] }, "locked": { - "lastModified": 1703231060, - "narHash": "sha256-oAiG8DuK+zO9niSSb2qbA0YM6gBlpChM6qoXtuD6e4w=", + "lastModified": 1706385404, + "narHash": "sha256-Q7yUQBCH5J0xiWlH7w2Vux1QD2KCuWvshnA4rkz+HXI=", "owner": "iofq", "repo": "nvim.nix", - "rev": "0c397bd3c752daa6b5e5c27c029723a5ca00ffde", + "rev": "8bd50ae3b2f028dccdd586bbedaa96361b301cca", "type": "github" }, "original": { @@ -91,15 +462,58 @@ "type": "github" } }, + "poetry2nix": { + "inputs": { + "flake-utils": "flake-utils_2", + "nix-github-actions": "nix-github-actions", + "nixpkgs": [ + "ethereum-nix", + "nixpkgs" + ], + "systems": "systems_3", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1704540236, + "narHash": "sha256-VKQ7JUjINd34sYhH7DKTtqnARvRySJ808cW9hoYA8NQ=", + "owner": "nix-community", + "repo": "poetry2nix", + "rev": "74921da7e0cc8918adc2e9989bd3e9c127b25ff6", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "poetry2nix", + "type": "github" + } + }, "root": { "inputs": { + "ethereum-nix": "ethereum-nix", "home-manager": "home-manager", + "microvm": "microvm", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "nvim": "nvim", "tfa": "tfa" } }, + "spectrum": { + "flake": false, + "locked": { + "lastModified": 1703273931, + "narHash": "sha256-CJ1Crdi5fXHkCiemovsp20/RC4vpDaZl1R6V273FecI=", + "ref": "refs/heads/main", + "rev": "97e2f3429ee61dc37664b4d096b2fec48a57b691", + "revCount": 597, + "type": "git", + "url": "https://spectrum-os.org/git/spectrum" + }, + "original": { + "type": "git", + "url": "https://spectrum-os.org/git/spectrum" + } + }, "systems": { "locked": { "lastModified": 1681028828, @@ -115,6 +529,65 @@ "type": "github" } }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "id": "systems", + "type": "indirect" + } + }, + "systems_4": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_5": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "tfa": { "inputs": { "nixpkgs": [ @@ -134,6 +607,49 @@ "repo": "2fa", "type": "github" } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "ethereum-nix", + "poetry2nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1699786194, + "narHash": "sha256-3h3EH1FXQkIeAuzaWB+nK0XK54uSD46pp+dMD3gAcB4=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "e82f32aa7f06bbbd56d7b12186d555223dc399d1", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, + "treefmt-nix_2": { + "inputs": { + "nixpkgs": [ + "ethereum-nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1704233915, + "narHash": "sha256-GYDC4HjyVizxnyKRbkrh1GugGp8PP3+fJuh40RPCN7k=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "e434da615ef74187ba003b529cc72f425f5d941e", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index b8a3e38..93d0319 100755 --- a/flake.nix +++ b/flake.nix @@ -16,8 +16,17 @@ url = "github:iofq/2fa"; inputs.nixpkgs.follows = "nixpkgs"; }; + ethereum-nix = { + url = "git+file:///home/e/dev/ethereum.nix/"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.foundry-nix.url = "github:shazow/foundry.nix"; + }; + microvm = { + url = "github:astro/microvm.nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = { self, nixpkgs, home-manager, nixos-hardware, nvim, ... } @inputs: + outputs = { self, nixpkgs, home-manager, nixos-hardware, nvim, ethereum-nix, ... } @inputs: let attrs = { username = "e"; @@ -35,7 +44,7 @@ }; in { nixosConfigurations = ( - import ./nixos { inherit inputs pkgs attrs system; } + import ./nixos { inherit inputs pkgs attrs system ethereum-nix; } ); homeConfigurations = ( import ./home-manager { inherit inputs pkgs attrs; } diff --git a/home-manager/shared/wayland/alacritty/default.nix b/home-manager/shared/wayland/alacritty/default.nix index f3776fc..9188c0f 100755 --- a/home-manager/shared/wayland/alacritty/default.nix +++ b/home-manager/shared/wayland/alacritty/default.nix @@ -28,8 +28,8 @@ style = "Block"; unfocused_hollow = true; }; - draw_bold_text_with_bright_colors = true; colors = { + draw_bold_text_with_bright_colors = true; primary = { background = "#090410"; foreground = "#bababd"; @@ -59,7 +59,7 @@ cursor = "#00CC22"; }; }; - key_bindings = [ + keyboard.bindings = [ { key = "Q"; mode = "Vi"; diff --git a/home-manager/shared/wayland/sway/default.nix b/home-manager/shared/wayland/sway/default.nix index fcd4445..a7e5123 100644 --- a/home-manager/shared/wayland/sway/default.nix +++ b/home-manager/shared/wayland/sway/default.nix @@ -5,6 +5,7 @@ autotiling-rs gammastep sway-contrib.grimshot + jq ]; home.sessionVariables = { # needed for Sway and Firefox to play nice @@ -122,6 +123,7 @@ "type:touchpad" = { natural_scroll = "enabled"; accel_profile = "flat"; + pointer_accel = "0.4"; tap = "enabled"; tap_button_map = "lrm"; dwt = "enabled"; @@ -137,6 +139,10 @@ }; }; }; + extraConfig = '' + bindswitch --reload --locked lid:on exec "[ $(swaymsg -t get_outputs | jq '. | length') -gt 1 ] && swaymsg output eDP-1 disable" + bindswitch --reload --locked lid:off output eDP-1 enable + ''; }; programs.i3status = { enable = true; diff --git a/home-manager/t14/home.nix b/home-manager/t14/home.nix index 379a75a..18d4fd1 100755 --- a/home-manager/t14/home.nix +++ b/home-manager/t14/home.nix @@ -18,7 +18,6 @@ discord # apps - framesh chromium # font @@ -33,12 +32,12 @@ programs.ssh = { enable = true; matchBlocks = { - "racknerd.10110110.xyz" = { - hostname = "contabo.10110110.xyz"; + "racknerd" = { + hostname = "racknerd.10110110.xyz"; identityFile = "/home/e/.ssh/racknerd"; }; - "contabo.10110110.xyz" = { - hostname = "contabo.10110110.xyz"; + "htz" = { + hostname = "htz.10110110.xyz"; identityFile = "/home/e/.ssh/id_ed25519"; }; "consensus" = { diff --git a/nixos/contabo/hardware-configuration.nix b/nixos/contabo/hardware-configuration.nix deleted file mode 100755 index b8fa980..0000000 --- a/nixos/contabo/hardware-configuration.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ lib, modulesPath, ... }: -{ - imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - boot.loader.grub.device = "/dev/sda"; - boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi" ]; - boot.initrd.kernelModules = [ "nvme" ]; - fileSystems."/" = { device = "/dev/sda3"; fsType = "ext4"; }; - -} diff --git a/nixos/default.nix b/nixos/default.nix index d54dae2..c65bd7e 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -27,17 +27,19 @@ ./racknerd/configuration.nix ]; }; - contabo = inputs.nixpkgs.lib.nixosSystem { + htz = inputs.nixpkgs.lib.nixosSystem { specialArgs = { inherit inputs system pkgs; host = { - hostName = "eef"; + hostName = "htz"; username = attrs.username; }; }; modules = [ ./configuration.nix - ./contabo/configuration.nix + ./htz/configuration.nix + inputs.ethereum-nix.nixosModules.default + inputs.microvm.nixosModules.host ]; }; } diff --git a/nixos/contabo/configuration.nix b/nixos/htz/configuration.nix similarity index 93% rename from nixos/contabo/configuration.nix rename to nixos/htz/configuration.nix index 039160a..5aa8202 100644 --- a/nixos/contabo/configuration.nix +++ b/nixos/htz/configuration.nix @@ -1,13 +1,16 @@ { pkgs, ... }: { imports = [ ./hardware-configuration.nix + ./vms.nix + #./eth.nix ]; environment.systemPackages = with pkgs; [ nfs-utils + vim ]; boot.tmp.cleanOnBoot = true; zramSwap.enable = false; - networking.hostName = "eef"; + networking.hostName = "htz"; networking.domain = ""; networking.firewall = { enable = true; @@ -34,5 +37,4 @@ }; security.sudo.wheelNeedsPassword = false; nix.settings.trusted-users = ["e"]; - system.stateVersion = "22.11"; } diff --git a/nixos/htz/eth.nix b/nixos/htz/eth.nix new file mode 100644 index 0000000..eaa73f7 --- /dev/null +++ b/nixos/htz/eth.nix @@ -0,0 +1,71 @@ +{ system, ethereum-nix, ...}: { + services.ethereum.geth.mainnet = { + enable = true; + package = ethereum-nix.packages.${system}.geth; + openFirewall = true; + args = { + http = { + enable = false; + api = ["net" "web3" "eth"]; + }; + authrpc.jwtsecret = "/etc/nixos/eth_jwt"; + }; + }; + services.nginx.enable = true; + services.nginx.virtualHosts."contabo.10110110.xyz" = { + addSSL = true; + enableACME = true; + root = "/var/www/fam"; + }; + security.acme = { + acceptTerms = true; + defaults.email = "cjriddz@protonmail.com"; + }; + networking.firewall = { + enable = true; + allowedTCPPorts = [80 443]; + allowedUDPPorts = []; + logRefusedConnections = true; + }; + services.ethereum.nimbus-beacon.mainnet = { + enable = true; + package = ethereum-nix.packages.${system}.nimbus; + openFirewall = true; + args = { + nat = "any"; + network = "mainnet"; + jwt-secret = "/etc/nixos/eth_jwt"; + trusted-node-url = "https://sync.invis.tools"; + el = ["http://127.0.0.1:8551"]; + listen-address = "0.0.0.0"; + tcp-port = 9000; + udp-port = 9000; + enr-auto-update = true; + max-peers = "160"; + doppelganger-detection = true; + history = "prune"; + graffiti = "yo"; + metrics = { + enable = true; + port = 5054; + address = "127.0.0.1"; + }; + rest = { + enable = true; + port = 5052; + address = "0.0.0.0"; + allow-origin = "*"; + }; + payload-builder = { + enable = true; + url = "http://localhost"; + }; + light-client-data = { + serve = true; + import-mode = "only-new"; + max-periods = "3"; + }; + }; + }; + +} diff --git a/nixos/htz/hardware-configuration.nix b/nixos/htz/hardware-configuration.nix new file mode 100755 index 0000000..fc4d5b4 --- /dev/null +++ b/nixos/htz/hardware-configuration.nix @@ -0,0 +1,63 @@ +{ modulesPath, lib, ... }: +{ + system.stateVersion = "23.11"; + imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + boot = { + loader.grub = { + efiSupport = true; + efiInstallAsRemovable = true; + device = "nodev"; + }; + initrd.availableKernelModules = [ + "ata_piix" + "uhci_hcd" + "xen_blkfront" + "vmw_pvscsi" + ]; + initrd.kernelModules = [ "nvme" ]; + }; + fileSystems = { + "/boot" = { + device = "/dev/disk/by-uuid/5679-B4CD"; + fsType = "vfat"; + }; + "/" = { + device = "/dev/mapper/ssd1-root"; + fsType = "ext4"; + }; + }; + swapDevices = [{ + device = "/dev/dm-1"; + }]; + networking.useNetworkd = true; + networking.nat = { + enable = true; + externalInterface = "enp0s31f6"; + internalInterfaces = [ "microvm" ]; + }; + systemd.network = { + enable = true; + netdevs = { + "10-microvm".netdevConfig = { + Kind = "bridge"; + Name = "microvm"; + }; + }; + networks = { + "10-microvm" = { + matchConfig.Name = "microvm"; + networkConfig = { + DHCPServer = true; + }; + addresses = [ { + addressConfig.Address = "10.0.0.1/24"; + }]; + }; + "11-microvm" = { + matchConfig.Name = "vm-*"; + networkConfig.Bridge = "microvm"; + }; + }; + }; +} diff --git a/nixos/htz/vms.nix b/nixos/htz/vms.nix new file mode 100644 index 0000000..0c449c7 --- /dev/null +++ b/nixos/htz/vms.nix @@ -0,0 +1,15 @@ +{ ... }: { + microvm.vms = { + vm-test = { + config = { + microvm.shares = [{ + source = "/nix/store"; + mountPoint = "/nix/.ro-store"; + tag = "ro-store"; + proto = "virtiofs"; + }]; + system.stateVersion = "23.11"; + }; + }; + }; +} diff --git a/nixos/t14/configuration.nix b/nixos/t14/configuration.nix index 88f0bf7..cde41a5 100755 --- a/nixos/t14/configuration.nix +++ b/nixos/t14/configuration.nix @@ -11,7 +11,7 @@ networking.networkmanager.enable = true; networking.firewall = { enable = true; - allowedTCPPorts = [11111]; + allowedTCPPorts = [11111 80]; allowedUDPPorts = []; logRefusedConnections = true; }; @@ -52,6 +52,37 @@ }; }; }; + + services.tlp = { + enable = true; + settings = { + WIFI_PWR_ON_BAT = "off"; + CPU_BOOST_ON_BAT = "0"; + CPU_BOOST_ON_AC = "1"; + + PLATFORM_PROFILE_ON_AC = "performance"; + PLATFORM_PROFILE_ON_BAT = "low-power"; + CPU_SCALING_GOVERNOR_ON_AC = "performance"; + CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; + + CPU_ENERGY_PERF_POLICY_ON_BAT = "power"; + CPU_ENERGY_PERF_POLICY_ON_AC = "performance"; + + CPU_MIN_PERF_ON_AC = 0; + CPU_MAX_PERF_ON_AC = 100; + CPU_MIN_PERF_ON_BAT = 0; + CPU_MAX_PERF_ON_BAT = 25; + RADEON_DPM_STATE_ON_AC="performance"; + RADEON_DPM_STATE_ON_BAT="battery"; + RADEON_POWER_PROFILE_ON_AC="high"; + RADEON_POWER_PROFILE_ON_BAT="low"; + + #Optional helps save long term battery health + START_CHARGE_THRESH_BAT0 = 80; # bellow it starts to charge + STOP_CHARGE_THRESH_BAT0 = 95; # above it stops charging + }; + }; + hardware.opengl.enable = true; hardware.opengl.extraPackages = [ pkgs.mesa.drivers