mirror of
https://github.com/callumio/nixfiles.git
synced 2026-08-06 20:49:17 +01:00
remove legacy modules folder
This commit is contained in:
parent
9b48220a2a
commit
262f069d7d
10 changed files with 1 additions and 206 deletions
|
|
@ -7,7 +7,6 @@
|
||||||
flake-parts,
|
flake-parts,
|
||||||
...
|
...
|
||||||
} @ inputs: let
|
} @ inputs: let
|
||||||
mods = import ./modules;
|
|
||||||
cLib = import ./lib {inherit (nixpkgs) lib;};
|
cLib = import ./lib {inherit (nixpkgs) lib;};
|
||||||
mkLinuxSystem = mod: ovl:
|
mkLinuxSystem = mod: ovl:
|
||||||
nixpkgs.lib.nixosSystem {
|
nixpkgs.lib.nixosSystem {
|
||||||
|
|
@ -30,8 +29,7 @@
|
||||||
self.nixosModules.tailscale
|
self.nixosModules.tailscale
|
||||||
self.nixosModules.deploy
|
self.nixosModules.deploy
|
||||||
]
|
]
|
||||||
++ mod
|
++ mod;
|
||||||
++ mods.sharedModules;
|
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
flake-parts.lib.mkFlake {inherit self inputs;} {
|
flake-parts.lib.mkFlake {inherit self inputs;} {
|
||||||
|
|
@ -45,7 +43,6 @@
|
||||||
systems = import inputs.systems;
|
systems = import inputs.systems;
|
||||||
|
|
||||||
flake = {
|
flake = {
|
||||||
inherit (mods) homeManagerModules nixosModules;
|
|
||||||
# TODO: use ./hosts/
|
# TODO: use ./hosts/
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
artemis = mkLinuxSystem [./hosts/artemis] [];
|
artemis = mkLinuxSystem [./hosts/artemis] [];
|
||||||
|
|
|
||||||
|
|
@ -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";
|
|
||||||
}
|
|
||||||
|
|
@ -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;
|
|
||||||
}
|
|
||||||
|
|
@ -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"];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
{...}: {
|
|
||||||
home-manager.useGlobalPkgs = true;
|
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
}
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
{lib, ...}: {
|
|
||||||
options.keys = lib.mkOption {
|
|
||||||
default = import ../lib/keys.nix;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -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="
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
{pkgs, ...}: {
|
|
||||||
services.dbus.packages = [pkgs.gcr];
|
|
||||||
}
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
{...}: {
|
|
||||||
imports = [../secrets/secrets-configuration.nix];
|
|
||||||
}
|
|
||||||
|
|
@ -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];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue