From f97b96387dcc5cf417943ebb40ac293db237d6d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sun, 4 Dec 2022 04:27:44 +0100 Subject: [PATCH] Cleanup unused variable, remove global with lib --- flake.nix | 3 --- modules/default.nix | 10 ++-------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/flake.nix b/flake.nix index 34a72240..4a35cbd7 100644 --- a/flake.nix +++ b/flake.nix @@ -176,7 +176,6 @@ outputs = inputs@{ self, fenix, harmonia, heliwatch, microvm, naersk, nixos, nixos-hardware, nixos-unstable, caveman, oparl-scraper, scrapers, secrets, skyflake, sshlogd, sops-nix, spacemsg, ticker, tigger, yammat, zentralwerk, ... }: let inherit (nixos) lib; - forAllSystems = lib.genAttrs [ "aarch64-linux" "x86_64-linux" ]; # all the input flakes for `nix copy` to the build machine, # allowing --override-input @@ -318,7 +317,6 @@ target = ''root@"${host}"''; rebuildArg = "--flake ${self}#${name} --option extra-substituters https://nix-serve.hq.c3d2.de"; hostConfig = self.nixosConfigurations."${name}".config; - profile = hostConfig.system.build.toplevel; # let /var/lib/microvm/*/flake point to the flake-update branch so that # `microvm -u $NAME` updates to what hydra built today. selfRef = "git+https://gitea.c3d2.de/c3d2/nix-config?ref=flake-update"; @@ -1014,7 +1012,6 @@ }; }; - nixosModule = self.nixosModules.c3d2; nixosModules = { c3d2 = { imports = [ diff --git a/modules/default.nix b/modules/default.nix index 575d04ab..4cae18bd 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,7 +1,5 @@ { config, lib, pkgs, ... }: -with lib; - let # TODO: move to flake nixcloud-webservices = pkgs.fetchFromGitHub { @@ -30,19 +28,15 @@ let else throw "Invalid LXC config value"; toLxcConfig = toLxcConfig' ""; - - lxc-rootfs = pkgs.runCommand "lxc-rootfs" { } '' - mkdir -p $out/share/lxc/rootfs/{dev,nix/store,proc,run,sys,tmp} - ''; in { - options = with types; { + options = with lib.types; { lxc.containers = mkOption { type = attrs; default = { }; }; }; - config = mkIf (containers != { }) { + config = lib.mkIf (containers != { }) { virtualisation.lxc.enable = true; environment.systemPackages = [ nixcloud.container ];