More messing around; added a module template
This commit is contained in:
parent
832aa56828
commit
7ab2df21a6
|
@ -42,7 +42,10 @@ in
|
|||
};
|
||||
};
|
||||
};
|
||||
apcupsd.enable = true;
|
||||
apcupsd = {
|
||||
enable = true;
|
||||
configText = builtins.readFile ./etc/apcupsd.conf;
|
||||
};
|
||||
airsonic = {
|
||||
enable = true;
|
||||
domain = config.secrets.networking.primaryDomain;
|
||||
|
@ -79,16 +82,13 @@ in
|
|||
ports = [ config.secrets.hosts.haven.ssh.port ];
|
||||
};
|
||||
};
|
||||
users = {
|
||||
aires = {
|
||||
users.aires = {
|
||||
enable = true;
|
||||
services.syncthing = {
|
||||
enable = true;
|
||||
autostart = false;
|
||||
};
|
||||
};
|
||||
media.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
# TODO: VPN (Check out Wireguard)
|
||||
|
|
|
@ -19,8 +19,7 @@
|
|||
flatpak.enable = true;
|
||||
gnome.enable = true;
|
||||
};
|
||||
users = {
|
||||
aires = {
|
||||
users.aires = {
|
||||
enable = true;
|
||||
autologin = true;
|
||||
services = {
|
||||
|
@ -32,7 +31,6 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Build remotely
|
||||
nix.distributedBuilds = true;
|
||||
|
|
|
@ -13,6 +13,10 @@
|
|||
role = "server";
|
||||
users.aires.enable = true;
|
||||
boot.enable = false;
|
||||
services.ssh = {
|
||||
enable = true;
|
||||
ports = [ nix-secrets.hosts.haven.ssh.port ];
|
||||
};
|
||||
};
|
||||
|
||||
networking.hostName = "Pihole";
|
||||
|
@ -34,16 +38,4 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Enable SSH
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
ports = [ 33105 ];
|
||||
|
||||
settings = {
|
||||
PasswordAuthentication = true;
|
||||
AllowUsers = [ "aires" ];
|
||||
PermitRootLogin = "no";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ let
|
|||
files =
|
||||
dir: collect isString (mapAttrsRecursive (path: type: concatStringsSep "/" path) (getDir dir));
|
||||
|
||||
# Search all files and folders within and below the current directory.
|
||||
# Filters out directories that belong to home-manager, and don't end with .nix or are this file.
|
||||
# Also, make the strings absolute
|
||||
validFiles =
|
||||
|
|
41
modules/module.nix.template
Normal file
41
modules/module.nix.template
Normal file
|
@ -0,0 +1,41 @@
|
|||
# This is an example of a blank module.
|
||||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.host.services.myModule;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
host.services.myModule = {
|
||||
enable = lib.mkEnableOption (lib.mdDoc "Enables this example module.");
|
||||
attributes = lib.mkOption {
|
||||
default = { };
|
||||
type = lib.types.attrs;
|
||||
description = "An example of an attributes option.";
|
||||
};
|
||||
string = lib.mkOption {
|
||||
default = "";
|
||||
type = lib.types.str;
|
||||
description = "An example of a string option.";
|
||||
};
|
||||
list = lib.mkOption {
|
||||
default = [ ];
|
||||
type = lib.types.listOf lib.types.int;
|
||||
description = "An example of a list (of integers) option.";
|
||||
};
|
||||
enum = mkOption {
|
||||
default = "one";
|
||||
type = types.enum [
|
||||
"one"
|
||||
"two"
|
||||
];
|
||||
description = "An example of an enum option.";
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Add changes applied by this module here.
|
||||
};
|
||||
}
|
|
@ -14,6 +14,7 @@ in
|
|||
autostart = lib.mkEnableOption (lib.mdDoc "Automatically starts Airsonic at boot.");
|
||||
enable = lib.mkEnableOption (lib.mdDoc "Enables Airsonic Advanced media streaming service.");
|
||||
home = lib.mkOption {
|
||||
default = "";
|
||||
type = lib.types.str;
|
||||
description = "Where to store Airsonic's files";
|
||||
};
|
||||
|
|
|
@ -10,13 +10,19 @@ in
|
|||
with lib;
|
||||
{
|
||||
options = {
|
||||
host.services.apcupsd.enable = mkEnableOption (mdDoc "Enables apcupsd");
|
||||
host.services.apcupsd = {
|
||||
enable = mkEnableOption (mdDoc "Enables apcupsd");
|
||||
configText = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "The configuration to pass to apcupsd.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.apcupsd = {
|
||||
enable = true;
|
||||
configText = builtins.readFile ./etc/apcupsd.conf;
|
||||
configText = cfg.configText;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ in
|
|||
autostart = lib.mkEnableOption (lib.mdDoc "Automatically starts Forgejo at boot.");
|
||||
enable = lib.mkEnableOption (lib.mdDoc "Enables Forgejo Git hosting service.");
|
||||
home = lib.mkOption {
|
||||
default = "";
|
||||
type = lib.types.str;
|
||||
description = "Where to store Forgejo's files";
|
||||
};
|
||||
|
|
|
@ -38,13 +38,12 @@ with lib;
|
|||
}
|
||||
];
|
||||
|
||||
# Install Flatpaks. For details, see https://github.com/gmodena/nix-flatpak
|
||||
# Install base Flatpaks. For details, see https://github.com/gmodena/nix-flatpak
|
||||
packages = [
|
||||
"com.github.tchx84.Flatseal"
|
||||
"md.obsidian.Obsidian"
|
||||
"net.waterfox.waterfox"
|
||||
"org.keepassxc.KeePassXC"
|
||||
"org.mozilla.firefox"
|
||||
];
|
||||
};
|
||||
|
||||
|
|
|
@ -36,12 +36,10 @@ with lib;
|
|||
|
||||
# Enable Gnome
|
||||
desktopManager.gnome.enable = true;
|
||||
displayManager = {
|
||||
gdm.enable = true;
|
||||
};
|
||||
displayManager.gdm.enable = true;
|
||||
|
||||
# Remove default packages that came with the install
|
||||
excludePackages = with pkgs; [ xterm ];
|
||||
excludePackages = [ pkgs.xterm ];
|
||||
};
|
||||
|
||||
# Install Flatpaks
|
||||
|
@ -66,8 +64,7 @@ with lib;
|
|||
"org.gtk.Gtk3theme.Adwaita-dark"
|
||||
];
|
||||
|
||||
# Disable CUPS - not needed
|
||||
printing.enable = false;
|
||||
printing.enable = true;
|
||||
};
|
||||
|
||||
environment = {
|
||||
|
|
|
@ -99,8 +99,6 @@ with lib;
|
|||
shellAliases = {
|
||||
update = "upgrade";
|
||||
upgrade = "nh os boot --update --ask";
|
||||
protontricks = "flatpak run com.github.Matoking.protontricks";
|
||||
please = "sudo";
|
||||
};
|
||||
loginExtra = "fastfetch";
|
||||
};
|
||||
|
|
|
@ -108,9 +108,6 @@ with lib;
|
|||
file = "p10k.zsh";
|
||||
}
|
||||
];
|
||||
shellAliases = {
|
||||
please = "sudo";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue