diff --git a/nix/os/devices/steveej-x13s/configuration.nix b/nix/os/devices/steveej-x13s/configuration.nix index 3068a0a..8fd0122 100644 --- a/nix/os/devices/steveej-x13s/configuration.nix +++ b/nix/os/devices/steveej-x13s/configuration.nix @@ -157,40 +157,7 @@ ../../snippets/holo-zerotier.nix - # experiment with k3s, nix-snapshotter, and nixos images - { - # (1) Import nixos module. - imports = [ - nodeFlake.inputs.nix-snapshotter.nixosModules.default - ]; - - # (2) Add overlay. - nixpkgs.overlays = [nodeFlake.inputs.nix-snapshotter.overlays.default]; - - # (3) Enable service. - virtualisation.containerd = { - enable = true; - k3sIntegration = false; - nixSnapshotterIntegration = true; - - # TODO: understand if this has an influence on the systemd LoadCredential issue - settings.plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options.SystemdCgroup = lib.mkForce true; - }; - services.nix-snapshotter = { - enable = true; - }; - - # (4) Add a containerd CLI like nerdctl. - environment.systemPackages = [ - pkgs.nerdctl - nodeFlake.inputs.nix-snapshotter.packages.${system}.nix-snapshotter - ]; - - services.k3s = { - enable = false; - setKubeConfig = true; - }; - } + ../../snippets/k3s-w-nix-snapshotter.nix ]; networking.hostName = nodeName; diff --git a/nix/os/devices/steveej-x13s/flake.lock b/nix/os/devices/steveej-x13s/flake.lock index dcad237..9633bbc 100644 --- a/nix/os/devices/steveej-x13s/flake.lock +++ b/nix/os/devices/steveej-x13s/flake.lock @@ -1,21 +1,5 @@ { "nodes": { - "ath11k-firmware": { - "flake": false, - "locked": { - "lastModified": 1720482684, - "narHash": "sha256-p6ifwtRNUOyQ2FN2VhSXS6dcrvrtiFZawu/iVXQ4uR0=", - "ref": "refs/heads/main", - "rev": "bb527dcebac835c47ed4f5428a7687769fa9b1b2", - "revCount": 152, - "type": "git", - "url": "https://git.codelinaro.org/clo/ath-firmware/ath11k-firmware.git" - }, - "original": { - "type": "git", - "url": "https://git.codelinaro.org/clo/ath-firmware/ath11k-firmware.git" - } - }, "crane": { "inputs": { "nixpkgs": [ @@ -178,22 +162,6 @@ "type": "github" } }, - "mobile-nixos": { - "flake": false, - "locked": { - "lastModified": 1722056346, - "narHash": "sha256-50fcuCppaLMfSOTFO4IkCBs4folToCwlhTgc6IdZFHg=", - "owner": "NixOS", - "repo": "mobile-nixos", - "rev": "717ce90cfadffa449480bae2e155185c651e9993", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "mobile-nixos", - "type": "github" - } - }, "mycelium": { "inputs": { "crane": "crane", @@ -350,11 +318,9 @@ }, "root": { "inputs": { - "ath11k-firmware": "ath11k-firmware", "disko": "disko", "get-flake": "get-flake", "home-manager": "home-manager", - "mobile-nixos": "mobile-nixos", "mycelium": "mycelium", "nix-snapshotter": "nix-snapshotter", "nixos-x13s": "nixos-x13s", diff --git a/nix/os/devices/steveej-x13s/flake.nix b/nix/os/devices/steveej-x13s/flake.nix index d749c07..6b8ed7e 100644 --- a/nix/os/devices/steveej-x13s/flake.nix +++ b/nix/os/devices/steveej-x13s/flake.nix @@ -26,19 +26,12 @@ # url = "github:pdtpartners/nix-snapshotter"; inputs.nixpkgs.follows = "nixpkgs"; }; - - nix-snapshotter = { - url = "github:yu-re-ka/nix-snapshotter"; - # url = "github:pdtpartners/nix-snapshotter"; - inputs.nixpkgs.follows = "nixpkgs"; - }; }; outputs = { self, get-flake, nixpkgs, - ath11k-firmware, ... }: let targetPlatform = "aarch64-linux"; diff --git a/nix/os/snippets/k3s-w-nix-snapshotter.nix b/nix/os/snippets/k3s-w-nix-snapshotter.nix new file mode 100644 index 0000000..0243018 --- /dev/null +++ b/nix/os/snippets/k3s-w-nix-snapshotter.nix @@ -0,0 +1,41 @@ +# experiment with k3s, nix-snapshotter, and nixos images +{ + nodeFlake, + nodeFlakeInputs', + pkgs, + lib, + system, + ... +}: { + # (1) Import nixos module. + imports = [ + nodeFlake.inputs.nix-snapshotter.nixosModules.default + ]; + + # (2) Add overlay. + nixpkgs.overlays = [nodeFlake.inputs.nix-snapshotter.overlays.default]; + + # (3) Enable service. + virtualisation.containerd = { + enable = true; + k3sIntegration = false; + nixSnapshotterIntegration = true; + + # TODO: understand if this has an influence on the systemd LoadCredential issue + settings.plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options.SystemdCgroup = lib.mkForce true; + }; + services.nix-snapshotter = { + enable = true; + }; + + # (4) Add a containerd CLI like nerdctl. + environment.systemPackages = [ + pkgs.nerdctl + nodeFlake.inputs.nix-snapshotter.packages.${system}.default + ]; + + services.k3s = { + enable = false; + setKubeConfig = true; + }; +}