add let/in with aliases
This commit is contained in:
@@ -7,8 +7,8 @@
|
||||
./nfs.nix
|
||||
];
|
||||
|
||||
modules.homelab.zfs.enable = lib.mkDefault true;
|
||||
modules.homelab.smb.enable = lib.mkDefault true;
|
||||
modules.homelab.nfs.enable = lib.mkDefault true;
|
||||
modules.homelab.zfs.enable = lib.mkDefault false;
|
||||
modules.homelab.smb.enable = lib.mkDefault false;
|
||||
modules.homelab.nfs.enable = lib.mkDefault false;
|
||||
|
||||
}
|
||||
|
||||
@@ -2,17 +2,18 @@
|
||||
|
||||
# define nfs exports
|
||||
let
|
||||
cfg = config.modules.homelab.nfs;
|
||||
nfs_exports = ''
|
||||
/holocron/vault *(rw,sync,no_subtree_check,no_root_squash)
|
||||
/holocron/media *(ro,sync,no_subtree_check)
|
||||
'';
|
||||
in
|
||||
{
|
||||
options = {
|
||||
modules.homelab.nfs.enable = lib.mkEnableOption "enables nfs";
|
||||
options.modules.homelab.nfs = {
|
||||
enable = lib.mkEnableOption "enables nfs";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.modules.homelab.nfs.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
# enable nfs with all exports
|
||||
services.nfs = {
|
||||
server = {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
# define smb shares
|
||||
let
|
||||
cfg = config.modules.homelab.smb;
|
||||
smb_shares = {
|
||||
vault = {
|
||||
path = "/holocron/vault";
|
||||
@@ -18,11 +19,11 @@ let
|
||||
};
|
||||
in
|
||||
{
|
||||
options = {
|
||||
modules.homelab.smb.enable = lib.mkEnableOption "enables smb";
|
||||
options.modules.homelab.smb = {
|
||||
enable = lib.mkEnableOption "enables smb";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.modules.homelab.smb.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
# enable smb with all shares
|
||||
services.samba = {
|
||||
enable = true;
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
{ pkgs, config, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.modules.homelab.zfs;
|
||||
in
|
||||
{
|
||||
|
||||
options = {
|
||||
modules.homelab.zfs.enable = lib.mkEnableOption "enables zfs";
|
||||
options.modules.homelab.zfs = {
|
||||
enable = lib.mkEnableOption "enables zfs";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.modules.homelab.zfs.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
# set network host id
|
||||
networking.hostId = "3e6e7055";
|
||||
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
|
||||
modules.system.ssh.enable = lib.mkDefault true;
|
||||
modules.system.sops.enable = lib.mkDefault true;
|
||||
modules.system.docker.enable = lib.mkDefault true;
|
||||
modules.system.docker.enable = lib.mkDefault false;
|
||||
modules.system.tailscale.enable = lib.mkDefault true;
|
||||
modules.system.syncthing.enable = lib.mkDefault true;
|
||||
modules.system.syncthing.enable = lib.mkDefault false;
|
||||
modules.system.nvidia.enable = lib.mkDefault false;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
{ pkgs, config, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.modules.system.docker;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
modules.system.docker.enable = lib.mkEnableOption "enables docker";
|
||||
options.modules.system.docker = {
|
||||
enable = lib.mkEnableOption "enables docker";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.modules.system.docker.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
virtualisation.docker = {
|
||||
enable = true;
|
||||
daemon.settings = {
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
{ pkgs, config, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.modules.system.nvidia;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
modules.system.nvidia.enable = lib.mkEnableOption "enables nvidia";
|
||||
options.modules.system.nvidia = {
|
||||
enable = lib.mkEnableOption "enables nvidia";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.modules.system.nvidia.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
# enable nvidia proprietary driver
|
||||
hardware.nvidia = {
|
||||
modesetting.enable = true; # required
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
{ pkgs, config, lib, inputs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.modules.system.sops;
|
||||
in
|
||||
{
|
||||
imports = [ inputs.sops-nix.nixosModules.sops ];
|
||||
|
||||
options = {
|
||||
modules.system.sops.enable = lib.mkEnableOption "enables ssh";
|
||||
options.modules.system.sops = {
|
||||
enable = lib.mkEnableOption "enables sops";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.modules.system.sops.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
# enable and configure sops for secrets
|
||||
sops.defaultSopsFile = ../../secrets/secrets.yaml;
|
||||
sops.defaultSopsFormat = "yaml";
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
{ pkgs, config, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.modules.system.ssh;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
modules.system.ssh.enable = lib.mkEnableOption "enables ssh";
|
||||
options.modules.system.ssh = {
|
||||
enable = lib.mkEnableOption "enables ssh";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.modules.system.ssh.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
# enable and configure openssh
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
{ pkgs, config, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.modules.system.syncthing;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
modules.system.syncthing.enable = lib.mkEnableOption "enables syncthing";
|
||||
options.modules.system.syncthing = {
|
||||
enable = lib.mkEnableOption "enables syncthing";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.modules.system.syncthing.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.syncthing = {
|
||||
enable = true;
|
||||
user = "blake";
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
{ pkgs, config, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.modules.system.tailscale;
|
||||
authkey_file = "/run/secrets/tailscale_authkey";
|
||||
in
|
||||
{
|
||||
options = {
|
||||
modules.system.tailscale.enable = lib.mkEnableOption "enables tailscale";
|
||||
options.modules.system.tailscale = {
|
||||
enable = lib.mkEnableOption "enables tailscale";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.modules.system.tailscale.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.tailscale = {
|
||||
enable = true;
|
||||
useRoutingFeatures = "both";
|
||||
authKeyFile = "/run/secrets/tailscale_authkey";
|
||||
authKeyFile = authkey_file;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ o.relativenumber = true
|
||||
vim.cmd('highlight LineNr ctermfg=054')
|
||||
|
||||
-- tabs
|
||||
o.tabstop = 4
|
||||
o.shiftwidth = 4
|
||||
o.tabstop = 2
|
||||
o.shiftwidth = 2
|
||||
o.softtabstop = -1 -- if negative uses shift width
|
||||
o.expandtab = true
|
||||
o.smarttab = true
|
||||
|
||||
Reference in New Issue
Block a user