1
0
Fork 0

More messing around; added a module template

This commit is contained in:
Aires 2024-05-21 09:22:03 -04:00
parent 832aa56828
commit 7ab2df21a6
13 changed files with 76 additions and 45 deletions

View file

@ -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,15 +82,12 @@ in
ports = [ config.secrets.hosts.haven.ssh.port ];
};
};
users = {
aires = {
users.aires = {
enable = true;
services.syncthing = {
enable = true;
services.syncthing = {
enable = true;
autostart = false;
};
autostart = false;
};
media.enable = true;
};
};

View file

@ -19,16 +19,14 @@
flatpak.enable = true;
gnome.enable = true;
};
users = {
aires = {
enable = true;
autologin = true;
services = {
syncthing = {
enable = true;
autostart = true;
enableTray = false;
};
users.aires = {
enable = true;
autologin = true;
services = {
syncthing = {
enable = true;
autostart = true;
enableTray = false;
};
};
};

View file

@ -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";
};
};
}

View file

@ -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 =

View 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.
};
}

View file

@ -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";
};

View file

@ -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;
};
};
}

View file

@ -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";
};

View file

@ -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"
];
};

View file

@ -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 = {

View file

@ -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";
};

View file

@ -108,9 +108,6 @@ with lib;
file = "p10k.zsh";
}
];
shellAliases = {
please = "sudo";
};
};
};
};