From 262f069d7de9d3c562479efe481591c678786cd9 Mon Sep 17 00:00:00 2001 From: Callum Leslie Date: Wed, 22 Apr 2026 18:34:34 +0100 Subject: [PATCH] remove legacy modules folder --- flake.nix | 5 +-- modules/boot.nix | 21 ------------ modules/default.nix | 30 ---------------- modules/deploy.nix | 74 ---------------------------------------- modules/hm.nix | 4 --- modules/keys.nix | 5 --- modules/nix.nix | 27 --------------- modules/pinentry-fix.nix | 3 -- modules/secret.nix | 3 -- modules/tailscale.nix | 35 ------------------- 10 files changed, 1 insertion(+), 206 deletions(-) delete mode 100644 modules/boot.nix delete mode 100644 modules/default.nix delete mode 100644 modules/deploy.nix delete mode 100644 modules/hm.nix delete mode 100644 modules/keys.nix delete mode 100644 modules/nix.nix delete mode 100644 modules/pinentry-fix.nix delete mode 100644 modules/secret.nix delete mode 100644 modules/tailscale.nix diff --git a/flake.nix b/flake.nix index 1ba6a58..45858a6 100644 --- a/flake.nix +++ b/flake.nix @@ -7,7 +7,6 @@ flake-parts, ... } @ inputs: let - mods = import ./modules; cLib = import ./lib {inherit (nixpkgs) lib;}; mkLinuxSystem = mod: ovl: nixpkgs.lib.nixosSystem { @@ -30,8 +29,7 @@ self.nixosModules.tailscale self.nixosModules.deploy ] - ++ mod - ++ mods.sharedModules; + ++ mod; }; in flake-parts.lib.mkFlake {inherit self inputs;} { @@ -45,7 +43,6 @@ systems = import inputs.systems; flake = { - inherit (mods) homeManagerModules nixosModules; # TODO: use ./hosts/ nixosConfigurations = { artemis = mkLinuxSystem [./hosts/artemis] []; diff --git a/modules/boot.nix b/modules/boot.nix deleted file mode 100644 index a5b3d31..0000000 --- a/modules/boot.nix +++ /dev/null @@ -1,21 +0,0 @@ -{...}: { - boot = { - loader = { - efi.canTouchEfiVariables = true; - systemd-boot.enable = true; - }; - plymouth.enable = false; - # consoleLogLevel = 0; - # initrd.verbose = false; - # kernelParams = [ - # "quiet" - # "splash" - # "boot.shell_on_fail" - # "loglevel=3" - # "rd.systemd.show_status=false" - # "rd.udev.log_level=3" - # "udev.log_priority=3" - # ]; - }; - system.stateVersion = "24.05"; -} diff --git a/modules/default.nix b/modules/default.nix deleted file mode 100644 index 8e44dab..0000000 --- a/modules/default.nix +++ /dev/null @@ -1,30 +0,0 @@ -let - exportModules = args: - builtins.listToAttrs ( - map (arg: { - name = let - str = baseNameOf arg; - suffix = ".nix"; - sufLen = builtins.stringLength suffix; - sLen = builtins.stringLength str; - in - if sufLen <= sLen && suffix == builtins.substring (sLen - sufLen) sufLen str - then builtins.substring 0 (sLen - sufLen) str - else str; - - value = import arg; - }) - args - ); - - nixosModules = - exportModules [ - ]; - homeManagerModules = - exportModules [ - ]; - sharedModules = with nixosModules; [ - ]; -in { - inherit nixosModules homeManagerModules sharedModules; -} diff --git a/modules/deploy.nix b/modules/deploy.nix deleted file mode 100644 index 811ab27..0000000 --- a/modules/deploy.nix +++ /dev/null @@ -1,74 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -with lib; let - cfg = config.c.services.remote-deploy; -in { - options.c.services.remote-deploy = { - enable = mkEnableOption "Enable remote deployment with nixinate."; - host = mkOption { - type = types.str; - description = "Hostname to connect to."; - }; - user = mkOption { - type = types.str; - default = "deploy"; - description = "Username for deploy account."; - }; - group = mkOption { - type = types.str; - default = "deploy"; - description = "Group for deploy account."; - }; - keys = mkOption { - type = types.listOf types.str; - description = "Authorised SSH keys for deployment"; - }; - port = mkOption { - type = types.port; - default = 22; - description = "SSH port to use."; - }; - buildOn = mkOption { - type = types.enum ["local" "remote"]; - default = "local"; - description = "Where to build the config."; - }; - - substituteOnTarget = mkOption { - type = types.bool; - default = true; - description = "Substitute closures and paths from remote"; - }; - }; - config = mkIf cfg.enable { - _module.args = { - nixinate = { - inherit (cfg) host buildOn port substituteOnTarget; - sshUser = cfg.user; - }; - }; - users.groups."${cfg.group}" = {}; - users.users."${cfg.user}" = { - isSystemUser = true; - shell = pkgs.bash; - inherit (cfg) group; - openssh.authorizedKeys.keys = cfg.keys; - }; - nix.settings.trusted-users = [cfg.user]; - security.sudo.extraRules = [ - { - groups = [cfg.group]; - commands = [ - { - command = "ALL"; - options = ["NOPASSWD"]; - } - ]; - } - ]; - }; -} diff --git a/modules/hm.nix b/modules/hm.nix deleted file mode 100644 index 591a582..0000000 --- a/modules/hm.nix +++ /dev/null @@ -1,4 +0,0 @@ -{...}: { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; -} diff --git a/modules/keys.nix b/modules/keys.nix deleted file mode 100644 index 661f815..0000000 --- a/modules/keys.nix +++ /dev/null @@ -1,5 +0,0 @@ -{lib, ...}: { - options.keys = lib.mkOption { - default = import ../lib/keys.nix; - }; -} diff --git a/modules/nix.nix b/modules/nix.nix deleted file mode 100644 index 329b39a..0000000 --- a/modules/nix.nix +++ /dev/null @@ -1,27 +0,0 @@ -{inputs, ...}: { - nix = { - registry.nixpkgs.flake = inputs.nixpkgs; - registry.unstable.flake = inputs.unstable; - gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 7d"; - }; - extraOptions = "gc-keep-outputs = true"; - settings = { - experimental-features = ["nix-command" "flakes" "auto-allocate-uids"]; - auto-optimise-store = true; - auto-allocate-uids = true; - - substituters = [ - "https://nix-community.cachix.org" - "https://callumio-public.cachix.org" - ]; - - trusted-public-keys = [ - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "callumio-public.cachix.org-1:VucOSl7vh44GdqcILwMIeHlI0ufuAnHAl8cO1U/7yhg=" - ]; - }; - }; -} diff --git a/modules/pinentry-fix.nix b/modules/pinentry-fix.nix deleted file mode 100644 index 167a03f..0000000 --- a/modules/pinentry-fix.nix +++ /dev/null @@ -1,3 +0,0 @@ -{pkgs, ...}: { - services.dbus.packages = [pkgs.gcr]; -} diff --git a/modules/secret.nix b/modules/secret.nix deleted file mode 100644 index e2c9011..0000000 --- a/modules/secret.nix +++ /dev/null @@ -1,3 +0,0 @@ -{...}: { - imports = [../secrets/secrets-configuration.nix]; -} diff --git a/modules/tailscale.nix b/modules/tailscale.nix deleted file mode 100644 index c495029..0000000 --- a/modules/tailscale.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ - config, - lib, - ... -}: -with lib; let - cfg = config.c.services.mesh; -in { - options.c.services.mesh = { - enable = mkEnableOption "Enable tailscale daemon."; - exitNode = mkOption { - type = types.bool; - default = false; - description = "Enable advertising as an exit node."; - }; - keyFile = mkOption { - type = types.path; - description = "Path to key file."; - }; - }; - config = mkIf cfg.enable { - services.tailscale = { - enable = true; - openFirewall = true; - #authKeyFile = config.age.secrets.mesh-conf.path; - authKeyFile = cfg.keyFile; - extraUpFlags = ["--login-server" "https://mesh.cleslie.uk"]; - extraSetFlags = [(mkIf cfg.exitNode "--advertise-exit-node")]; - }; - networking.firewall = { - #checkReversePath = "loose"; - trustedInterfaces = [config.services.tailscale.interfaceName]; - }; - }; -}