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