Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve compatibility for home-manager modules #116

Merged
merged 1 commit into from
Feb 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ easy installation.
nix-snapshotter.homeModules.default
];

// # (2) Add overlay.
# (2) Add overlay.
nixpkgs.overlays = [ nix-snapshotter.overlays.default ];

# (3) Enable service.
Expand Down Expand Up @@ -255,7 +255,7 @@ easy installation.
in {
imports = [
./hardware-configuration.nix
# (1) Import home-manager module.
# (1) Import nixos module.
nix-snapshotter.nixosModules.default
];

Expand Down
11 changes: 1 addition & 10 deletions modules/common/containerd.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ config, pkgs, lib, ... }:
{ pkgs, lib, ... }:
let
inherit (lib)
mkEnableOption
Expand All @@ -11,8 +11,6 @@ let
GOARCH
;

cfg = config.virtualisation.containerd;

options = {
k3sIntegration = mkEnableOption "K3s integration";

Expand Down Expand Up @@ -84,11 +82,4 @@ in {
internal = true;
};
};

config = lib.mkIf cfg.enable {
virtualisation.containerd = lib.mkIf cfg.nixSnapshotterIntegration {
setSnapshotter = lib.mkDefault "nix";
settings = mkNixSnapshotterSettings;
};
};
}
3 changes: 2 additions & 1 deletion modules/flake/overlays.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
# See: https://github.com/containerd/containerd/pull/9028
containerd = super.containerd.overrideAttrs(o: {
src = self.fetchFromGitHub {
inherit (o.src) owner repo;
owner = "containerd";
repo = "containerd";
rev = "779875a057ff98e9b754371c193fe3b0c23ae7a2";
hash = "sha256-sXMDMX0QPbnFvRYrAP+sVFjTI9IqzOmLnmqAo8lE9pg=";
};
Expand Down
6 changes: 6 additions & 0 deletions modules/nixos/containerd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ in {
};
};
})
(lib.mkIf cfg.nixSnapshotterIntegration {
virtualisation.containerd = {
setSnapshotter = lib.mkDefault "nix";
settings = cfg.lib.mkNixSnapshotterSettings;
};
})
(lib.mkIf (cfg.k3sIntegration && cfg.nixSnapshotterIntegration) {
services.k3s.moreFlags = [
"--image-service-endpoint unix:///run/nix-snapshotter/nix-snapshotter.sock"
Expand Down
Loading