From 676da78f40461c059fd9b35750a07e35f0295f0b Mon Sep 17 00:00:00 2001 From: Leon Liu Date: Sat, 2 Nov 2024 20:36:11 +0900 Subject: [PATCH] update --- configuration.nix | 31 +++++++++-- containers.nix | 12 +++-- flake.lock | 107 ++++++++++++++++++++----------------- flake.nix | 2 +- hardware-configuration.nix | 3 +- 5 files changed, 96 insertions(+), 59 deletions(-) diff --git a/configuration.nix b/configuration.nix index f8c71bb..2472405 100644 --- a/configuration.nix +++ b/configuration.nix @@ -2,7 +2,7 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, pkgs, ... }: +{ config, pkgs, lib, ... }: let kubeMasterIP = "192.168.11.2"; @@ -69,7 +69,6 @@ in services.printing.enable = true; # Enable sound with pipewire. - sound.enable = true; hardware.pulseaudio.enable = false; security.rtkit.enable = true; services.pipewire = { @@ -121,7 +120,7 @@ in ubuntu_font_family font-awesome source-han-serif - noto-fonts-cjk + noto-fonts-cjk-sans ]; fontconfig = { @@ -141,9 +140,29 @@ in systemd.services."getty@tty1".enable = false; systemd.services."autovt@tty1".enable = false; + systemd.services.NetworkManager-wait-online.enable = lib.mkForce false; + systemd.services.systemd-networkd-wait-online.enable = lib.mkForce false; + + systemd.services.easytier = { + enable = true; + description = "Easytier"; + after = ["network.target" "syslog.target"]; + wants = ["network.target"]; + serviceConfig = { + Type = "simple"; + User = "root"; + Environment = "PATH=/run/current-system/sw/bin"; + ExecStart = "${pkgs.easytier}/bin/easytier-core --file-log-level debug -i 10.144.144.1 --network-name 5b601a6b-fbc0-4c26-b8fb-0b6be0edfbf9 --network-secret d112e133-c80d-4b48-86bc-a2ec83a5e652 -e tcp://oracle-amd-ubuntu-1.ly-dodo.win:11010"; + # ... + }; + wantedBy = [ "multi-user.target" ]; + # ... + }; + # Allow unfree packages nixpkgs.config.allowUnfree = true; - + # services.netclient.enable = true; + services.netbird.enable = true; # List packages installed in system profile. To search, run: # $ nix search wget environment.systemPackages = with pkgs; [ @@ -155,6 +174,9 @@ in argocd cifs-utils samba + pavucontrol + netbird + easytier ]; # Some programs need SUID wrappers, can be configured further or are @@ -177,6 +199,7 @@ in securePort = kubeMasterAPIServerPort; advertiseAddress = kubeMasterIP; allowPrivileged = true; + extraOpts = "--service-node-port-range=20000-40000"; }; easyCerts = true; diff --git a/containers.nix b/containers.nix index 20bce2b..337d9ca 100644 --- a/containers.nix +++ b/containers.nix @@ -4,8 +4,14 @@ { config, lib, pkgs, modulesPath, ... }: { - virtualisation.oci-containers.backend = "podman"; - # virtualisation.oci-containers.containers = { + # virtualisation.oci-containers.backend = "podman"; + virtualisation.oci-containers.containers = { +# factorio = { +# image = "factoriotools/factorio:stable-2.0.13"; +# autoStart = true; +# volumes = ["/opt/factorio:/factorio"]; +# ports = ["34197:34197/udp" "27015:27015/tcp"]; +# }; # jellyfin = { # image = "docker.io/jellyfin/jellyfin:latest"; # autoStart = true; @@ -31,5 +37,5 @@ # # "--device=/dev/dri:/dev/dri" # # ]; # # }; - # }; + }; } diff --git a/flake.lock b/flake.lock index 48b2649..3d79d34 100644 --- a/flake.lock +++ b/flake.lock @@ -2,18 +2,17 @@ "nodes": { "devshell": { "inputs": { - "flake-utils": "flake-utils", "nixpkgs": [ "nixvim", "nixpkgs" ] }, "locked": { - "lastModified": 1717408969, - "narHash": "sha256-Q0OEFqe35fZbbRPPRdrjTUUChKVhhWXz3T9ZSKmaoVY=", + "lastModified": 1728330715, + "narHash": "sha256-xRJ2nPOXb//u1jaBnDP56M7v5ldavjbtR6lfGqSvcKg=", "owner": "numtide", "repo": "devshell", - "rev": "1ebbe68d57457c8cae98145410b164b5477761f4", + "rev": "dd6b80932022cea34a019e2bb32f6fa9e494dfef", "type": "github" }, "original": { @@ -36,22 +35,6 @@ "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" } }, - "flake-compat_2": { - "flake": false, - "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, "flake-parts": { "inputs": { "nixpkgs-lib": [ @@ -60,11 +43,11 @@ ] }, "locked": { - "lastModified": 1717285511, - "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=", + "lastModified": 1727826117, + "narHash": "sha256-K5ZLCyfO/Zj9mPFldf3iwS6oZStJcU4tSpiXTMYaaL0=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8", + "rev": "3d04084d54bedc3d6b8b736c70ef449225c361b1", "type": "github" }, "original": { @@ -78,11 +61,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", "type": "github" }, "original": { @@ -93,7 +76,10 @@ }, "git-hooks": { "inputs": { - "flake-compat": "flake-compat_2", + "flake-compat": [ + "nixvim", + "flake-compat" + ], "gitignore": "gitignore", "nixpkgs": [ "nixvim", @@ -105,11 +91,11 @@ ] }, "locked": { - "lastModified": 1718879355, - "narHash": "sha256-RTyqP4fBX2MdhNuMP+fnR3lIwbdtXhyj7w7fwtvgspc=", + "lastModified": 1729104314, + "narHash": "sha256-pZRZsq5oCdJt3upZIU4aslS9XwFJ+/nVtALHIciX/BI=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "8cd35b9496d21a6c55164d8547d9d5280162b07a", + "rev": "3c3e88f0f544d6bb54329832616af7eb971b6be6", "type": "github" }, "original": { @@ -147,11 +133,11 @@ ] }, "locked": { - "lastModified": 1719037157, - "narHash": "sha256-aOKd8+mhBsLQChCu1mn/W5ww79ta5cXVE59aJFrifM8=", + "lastModified": 1729551526, + "narHash": "sha256-7LAGY32Xl14OVQp3y6M43/0AtHYYvV6pdyBcp3eoz0s=", "owner": "nix-community", "repo": "home-manager", - "rev": "cd886711998fe5d9ff7979fdd4b4cbd17b1f1511", + "rev": "5ec753a1fc4454df9285d8b3ec0809234defb975", "type": "github" }, "original": { @@ -168,11 +154,11 @@ ] }, "locked": { - "lastModified": 1718788307, - "narHash": "sha256-SqiOz0sljM0GjyQEVinPXQxaGcbOXw5OgpCWGPgh/vo=", + "lastModified": 1729260213, + "narHash": "sha256-jAvHoU/1y/yCuXzr2fNF+q6uKmr8Jj2xgAisK4QB9to=", "owner": "nix-community", "repo": "home-manager", - "rev": "d7830d05421d0ced83a0f007900898bdcaf2a2ca", + "rev": "09a0c0c02953318bf94425738c7061ffdc4cba75", "type": "github" }, "original": { @@ -189,11 +175,11 @@ ] }, "locked": { - "lastModified": 1718662658, - "narHash": "sha256-AKG7BsqtVWDlefgzyKz7vjaKTLi4+bmTSBhowbQoZtM=", + "lastModified": 1728901530, + "narHash": "sha256-I9Qd0LnAsEGHtKE9+uVR0iDFmsijWSy7GT0g3jihG4Q=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "29b3096a6e283d7e6779187244cb2a3942239fdf", + "rev": "a60ac02f9466f85f092e576fd8364dfc4406b5a6", "type": "github" }, "original": { @@ -204,16 +190,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1719075281, - "narHash": "sha256-CyyxvOwFf12I91PBWz43iGT1kjsf5oi6ax7CrvaMyAo=", + "lastModified": 1729501122, + "narHash": "sha256-tScdcYQ37kMqlyqb5yizNDTKXZASLB4zHitlHwOg+/o=", "owner": "nixos", "repo": "nixpkgs", - "rev": "a71e967ef3694799d0c418c98332f7ff4cc5f6af", + "rev": "56c7c4a3f5fdbef5bf81c7d9c28fbb45dc626611", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-unstable", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } @@ -229,14 +215,15 @@ "nixpkgs": [ "nixpkgs" ], + "nuschtosSearch": "nuschtosSearch", "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1719042662, - "narHash": "sha256-xwj8hxu02myIPkNsch/v2NbxuRmuvlcphrbYPECE49c=", + "lastModified": 1729602958, + "narHash": "sha256-eKGQKlj1oShfR6uqE1RjB4CgQ3DBrMS4VPrGPDKq1J4=", "owner": "nix-community", "repo": "nixvim", - "rev": "49452662b7b4dd2467cbac19e0f9820d570d8976", + "rev": "b076f006c6b0cc6644a651bd21d4449cc3e7e56d", "type": "github" }, "original": { @@ -245,6 +232,28 @@ "type": "github" } }, + "nuschtosSearch": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1728905062, + "narHash": "sha256-W/lClt0bRgFRO0WFtytX/LEILpPNq+FOjIfESpkeu5c=", + "owner": "NuschtOS", + "repo": "search", + "rev": "f82d3e1c1c9d1eaeb91878519e2d27b27c66ce84", + "type": "github" + }, + "original": { + "owner": "NuschtOS", + "repo": "search", + "type": "github" + } + }, "root": { "inputs": { "home-manager": "home-manager", @@ -275,11 +284,11 @@ ] }, "locked": { - "lastModified": 1718522839, - "narHash": "sha256-ULzoKzEaBOiLRtjeY3YoGFJMwWSKRYOic6VNw2UyTls=", + "lastModified": 1729242555, + "narHash": "sha256-6jWSWxv2crIXmYSEb3LEVsFkCkyVHNllk61X4uhqfCs=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "68eb1dc333ce82d0ab0c0357363ea17c31ea1f81", + "rev": "d986489c1c757f6921a48c1439f19bfb9b8ecab5", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 13a8526..8e861a3 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "NixOS configuration"; inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; home-manager.url = "github:nix-community/home-manager"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; nixvim = { diff --git a/hardware-configuration.nix b/hardware-configuration.nix index fc19899..c5357ec 100644 --- a/hardware-configuration.nix +++ b/hardware-configuration.nix @@ -40,11 +40,10 @@ hardware.opengl = { enable = true; - driSupport = true; driSupport32Bit = true; }; # Load nvidia driver for Xorg and Wayland services.xserver.videoDrivers = ["nvidia"]; - + hardware.nvidia.open = false; }