From b4bb50ab6cdbfbb40aab48b20ff4ee671f0e1705 Mon Sep 17 00:00:00 2001 From: = <=> Date: Tue, 4 Feb 2025 21:24:49 +0100 Subject: [PATCH] Removed old base image config --- lxc-nix/buildLxcImage.sh | 13 ---- lxc-nix/configuration-empty.nix | 91 ---------------------- lxc-nix/configuration.nix | 134 -------------------------------- lxc-nix/parameters.nix | 10 --- lxc-nix/services/networking.nix | 31 -------- lxc-nix/services/rutorrent.nix | 68 ---------------- 6 files changed, 347 deletions(-) delete mode 100755 lxc-nix/buildLxcImage.sh delete mode 100644 lxc-nix/configuration-empty.nix delete mode 100644 lxc-nix/configuration.nix delete mode 100644 lxc-nix/parameters.nix delete mode 100644 lxc-nix/services/networking.nix delete mode 100644 lxc-nix/services/rutorrent.nix diff --git a/lxc-nix/buildLxcImage.sh b/lxc-nix/buildLxcImage.sh deleted file mode 100755 index 40f60ea..0000000 --- a/lxc-nix/buildLxcImage.sh +++ /dev/null @@ -1,13 +0,0 @@ -#! /usr/bin/env nix-shell -#! nix-shell -p nixos-generators -#! nix-shell -i bash -set -xe - -CONFIGURATIONNIX=$1 -ALIASNAME=$2 -METAIMG=$(nixos-generate -f lxc-metadata) -# IMG_PROXMOX=`nixos-generate -c ${CONFIGURATIONNIX} -f proxmox-lxc` -IMG=$(nixos-generate -c "${CONFIGURATIONNIX}" -f lxc) - -lxc image delete nixos || echo true -lxc image import --alias "${ALIASNAME}" "${METAIMG}" "${IMG}" diff --git a/lxc-nix/configuration-empty.nix b/lxc-nix/configuration-empty.nix deleted file mode 100644 index 0318c59..0000000 --- a/lxc-nix/configuration-empty.nix +++ /dev/null @@ -1,91 +0,0 @@ -{ config, pkgs, ... }: - -let - - parameters = import ./parameters.nix { }; - - # GID = 888; - # user = "rtorrent"; - # passwordHash = "$y$j9T$dA94KVg1/jYLqclQQbTDk.$cnfxBWUN8P4shr8Kkipv5bU/RCtQNoAwYFDZ0X/BYs5"; - - timeZone = "Europe/Rome"; - defaultLocale = "en_US.UTF-8"; -in -{ - imports = [ - - # Need to load some defaults for running in an lxc container. - # This is explained in: - # https://github.com/nix-community/nixos-generators/issues/79 - # "${modulesPath}/virtualisation/lxc-container.nix" - ]; - - # This doesn't do _everything_ we need, because `boot.isContainer` is - # specifically talking about light-weight NixOS containers, not LXC. But it - # does at least gives us something to start with. - boot.isContainer = true; - - networking = { - hostName = parameters.containerName; - }; - - nixpkgs.config.allowUnfree = true; - - # Extra packages - # environment.systemPackages = with pkgs; [ ]; - - services = { - openssh.enable = true; - }; - - time.timeZone = parameters.timeZone; - - i18n = { - defaultLocale = defaultLocale; - extraLocaleSettings = { - LC_ADDRESS = defaultLocale; - LC_IDENTIFICATION = defaultLocale; - LC_MEASUREMENT = defaultLocale; - LC_MONETARY = defaultLocale; - LC_NAME = defaultLocale; - LC_PAPER = defaultLocale; - LC_TELEPHONE = defaultLocale; - # LC_NUMERIC = defaultLocale; - # LC_TIME = defaultLocale; - }; - }; - - users = { - - # If set to false, the contents of the user and group files will simply - # be replaced on system activation. - # This also holds for the user passwords. - # All changed passwords will be reset according - # to the `users.users` configuration on activation. - mutableUsers = false; - - users.root = { - hashedPassword = "$6$gir1YD6tNdC9xAj0$zLr1yt/ea9PvwygjHfQVnPmeCd1.2zrAKWiN80duidwOkZF6hwm06ta6J3O9uw6F3uUHC0N7iiKYhCgXXR.Q7/"; - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDhiGLc/whCY3lCmDiRlYnMJOLiO/gvcRj/sKVEFVAhQ pazpi@deadbeef" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILrVYJrU6Ys2o/QYfI6Es5yqVVyjUyDYj6Fglvz63ywP krzo@pazpi.top" - ]; - }; - - }; - - # Supress systemd units that don't work because of LXC. - # https://blog.xirion.net/posts/nixos-proxmox-lxc/#configurationnix-tweak - systemd.suppressedSystemUnits = [ - "dev-mqueue.mount" - "sys-kernel-debug.mount" - "sys-fs-fuse-connections.mount" - ]; - - nix.settings.experimental-features = [ - "nix-command" - "flakes" - ]; - - system.stateVersion = "24.05"; -} diff --git a/lxc-nix/configuration.nix b/lxc-nix/configuration.nix deleted file mode 100644 index 51e100b..0000000 --- a/lxc-nix/configuration.nix +++ /dev/null @@ -1,134 +0,0 @@ -{ config, pkgs, ... }: - -let - - parameters = import ./parameters.nix { }; - - # GID = 888; - # user = "rtorrent"; - # passwordHash = "$y$j9T$dA94KVg1/jYLqclQQbTDk.$cnfxBWUN8P4shr8Kkipv5bU/RCtQNoAwYFDZ0X/BYs5"; - - timeZone = "Europe/Rome"; - defaultLocale = "en_US.UTF-8"; -in -{ - imports = [ - - # Need to load some defaults for running in an lxc container. - # This is explained in: - # https://github.com/nix-community/nixos-generators/issues/79 - # "${modulesPath}/virtualisation/lxc-container.nix" - - # ./modules/qbittorrent.nix - ./modules/rutorrent.nix - - # ./services/qbittorrent.nix - ./services/rutorrent.nix - ./services/networking.nix - ]; - - # This doesn't do _everything_ we need, because `boot.isContainer` is - # specifically talking about light-weight NixOS containers, not LXC. But it - # does at least gives us something to start with. - boot.isContainer = true; - - networking = { - hostName = parameters.containerName; - }; - - nixpkgs.config.allowUnfree = true; - - # Extra packages - # environment.systemPackages = with pkgs; [ ]; - - services = { - openssh.enable = true; - tailscale = { - enable = false; - useRoutingFeatures = "both"; - extraUpFlags = [ "--exit-node=${parameters.tailscaleExitNodeIP}" ]; - authKeyFile = builtins.toFile "authKey" ''${parameters.tailscaleAuthKey}''; - }; - }; - - time.timeZone = parameters.timeZone; - - i18n = { - defaultLocale = defaultLocale; - extraLocaleSettings = { - LC_ADDRESS = defaultLocale; - LC_IDENTIFICATION = defaultLocale; - LC_MEASUREMENT = defaultLocale; - LC_MONETARY = defaultLocale; - LC_NAME = defaultLocale; - LC_PAPER = defaultLocale; - LC_TELEPHONE = defaultLocale; - # LC_NUMERIC = defaultLocale; - # LC_TIME = defaultLocale; - }; - }; - - users = { - - # If set to false, the contents of the user and group files will simply - # be replaced on system activation. - # This also holds for the user passwords. - # All changed passwords will be reset according - # to the `users.users` configuration on activation. - mutableUsers = false; - - users.root = { - hashedPassword = "$6$gir1YD6tNdC9xAj0$zLr1yt/ea9PvwygjHfQVnPmeCd1.2zrAKWiN80duidwOkZF6hwm06ta6J3O9uw6F3uUHC0N7iiKYhCgXXR.Q7/"; - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDhiGLc/whCY3lCmDiRlYnMJOLiO/gvcRj/sKVEFVAhQ pazpi@deadbeef" - ]; - }; - - users.pazpi = { - isNormalUser = true; - shell = pkgs.bash; - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDhiGLc/whCY3lCmDiRlYnMJOLiO/gvcRj/sKVEFVAhQ pazpi@deadbeef" - ]; - }; - - # groups = { - # qbittorrent = { gid = GID; }; - # }; - - # users."${user}" = { - # isNormalUser = true; - # group = "qbittorrent"; - # extraGroups = [ "user" "multimedia" ]; - # # initialHashedPassword = passwordHash; - # }; - }; - - # # Enable passwordless sudo. - # security.sudo.extraRules = [ - # { - # users = [ user ]; - # commands = [ - # { - # command = "ALL"; - # options = [ "NOPASSWD" ]; - # } - # ]; - # } - # ]; - - # Supress systemd units that don't work because of LXC. - # https://blog.xirion.net/posts/nixos-proxmox-lxc/#configurationnix-tweak - systemd.suppressedSystemUnits = [ - "dev-mqueue.mount" - "sys-kernel-debug.mount" - "sys-fs-fuse-connections.mount" - ]; - - nix.settings.experimental-features = [ - "nix-command" - "flakes" - ]; - - system.stateVersion = "24.05"; -} diff --git a/lxc-nix/parameters.nix b/lxc-nix/parameters.nix deleted file mode 100644 index 5c44ef2..0000000 --- a/lxc-nix/parameters.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ ... }: -{ - containerName = "nixos-test"; # Name of the container, used for nginx virtualhost and for tailscale machine name - timeZone = "Europe/Rome"; # TimeZone - - downloadDir = "/data"; # Main download folder - - tailscaleAuthKey = "tskey-auth-kmgDY87CNTRL-urQA7eRn235t8Sjs6hW3259wJHE63Kvd"; - tailscaleExitNodeIP = "100.81.1.32"; # vps -} diff --git a/lxc-nix/services/networking.nix b/lxc-nix/services/networking.nix deleted file mode 100644 index 9e966ee..0000000 --- a/lxc-nix/services/networking.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ ... }: -{ - - networking = { - - useDHCP = true; - - # If you prefer DHCP - interfaces.eth0.useDHCP = true; - - # We don't use DHCP, so we configure it statically. - # interfaces.eth0.ipv4.addresses = [{ - # address = "10.42.135.101"; - # prefixLength = 24; - # }]; - - # # We can access the internet through this interface. - # defaultGateway = { - # address = "10.42.135.1"; - # interface = "eth0"; - # }; - - # Since we don't use DHCP, we need to set our own nameservers. - nameservers = [ - "1.1.1.1" - "1.0.0.1" - ]; - - }; - -} diff --git a/lxc-nix/services/rutorrent.nix b/lxc-nix/services/rutorrent.nix deleted file mode 100644 index 0983f3f..0000000 --- a/lxc-nix/services/rutorrent.nix +++ /dev/null @@ -1,68 +0,0 @@ -{ config, ... }: -let - parameters = import ../parameters.nix { }; -in -{ - services = { - - rtorrent = { - enable = true; - openFirewall = true; - downloadDir = parameters.downloadDir; - }; - - rutorrent = { - enable = true; - hostName = parameters.containerName; - plugins = [ - "_cloudflare" - "_getdir" - "_noty2" - "_task" - "autotools" - "check_port" - "chunks" - "cookies" - "cpuload" - # "сreate" - "data" - "datadir" - "diskspace" - "edit" - "erasedata" - "extratio" - "extsearch" - "feeds" - "filedrop" - "geoip" - "history" - "httprpc" - "ipad" - "loginmgr" - "lookat" - "mediainfo" - "ratio" - "retrackers" - "rss" - "rssurlrewrite" - "rutracker_check" - "scheduler" - "screenshots" - "seedingtime" - "show_peers_like_wtorrent" - "source" - "spectrogram" - "theme" - "throttle" - "tracklabels" - "trafic" - "unpack" - "uploadeta" - ]; - nginx = { - enable = true; - }; - }; - - }; -}