Compare commits

...

11 commits

12 changed files with 128 additions and 19 deletions

View file

@ -26,6 +26,7 @@ in {
};
services = {
docker = enabled;
# syncthing = enabled;
};
};

View file

@ -9,6 +9,9 @@ in {
options.marleyos.programs.phpstorm.enable = lib.mkEnableOption "phpstorm";
config = lib.mkIf cfg.enable {
# JetBrains products are unfree.
nixpkgs.config.allowUnfree = lib.mkForce true;
home.packages = with pkgs; [
jetbrains.phpstorm
];

View file

@ -1,3 +1,8 @@
{pkgs, ...}: {
boot.kernelPackages = pkgs.linuxPackages_xanmod;
{
pkgs,
lib,
config,
...
}: {
boot.kernelPackages = lib.mkIf (!config.marleyos.isServer) pkgs.linuxPackages_xanmod;
}

View file

@ -1,17 +1,24 @@
{pkgs, ...}: {
security.rtkit.enable = true; # Used for pulseaudio.
{
pkgs,
config,
lib,
...
}: {
config = lib.mkIf (!config.marleyos.isServer) {
security.rtkit.enable = true; # Used for pulseaudio.
services = {
pulseaudio.enable = false;
services = {
pulseaudio.enable = false;
pipewire = {
enable = true;
alsa.enable = true;
pulse.enable = true;
pipewire = {
enable = true;
alsa.enable = true;
pulse.enable = true;
};
printing.enable = true;
};
printing.enable = true;
environment.systemPackages = [pkgs.pwvucontrol];
};
environment.systemPackages = [pkgs.pwvucontrol];
}

View file

@ -1,5 +1,9 @@
_: {
time.timeZone = "America/Los_Angeles";
{config, ...}: {
time.timeZone =
if config.marleyos.isServer
then "UTC"
else "America/Los_Angeles";
i18n = {
defaultLocale = "en_US.UTF-8";

View file

@ -1,3 +1,9 @@
_: {
{
lib,
config,
...
}: {
networking.networkmanager.enable = true;
networking.wireless.enable = lib.mkIf config.marleyos.isServer false;
}

View file

@ -3,6 +3,8 @@
package = pkgs.lix;
settings = {
experimental-features = ["nix-command" "flakes"];
trusted-users = [
"root"
"@wheel"

View file

@ -1,10 +1,17 @@
_: let
{
lib,
config,
...
}: let
my = {
name = "marley";
username = "punkfairie";
fullName = "Marley Rae";
email = "marley@punkfairie.net";
};
desktopPass = "$y$j9T$ztWf9WeUCENC2T12qS4mi1$51ihV/5cQ8mdJJrNe7MMguk4hPB61S5xHawsfi.1hL3";
serverPass = "$y$j9T$8hA7OWZsdQMHqYIy8LkYQ1$hFeP2ak3QA4FtoIYIwqPg10//ZOSZrAw1PzJj0PuGSA";
in {
marleyos.my = {
inherit (my) name username fullName email;
@ -16,8 +23,14 @@ in {
users."${my.name}" = {
isNormalUser = true;
description = my.fullName;
extraGroups = ["networkmanager" "wheel"];
hashedPassword = "$y$j9T$ztWf9WeUCENC2T12qS4mi1$51ihV/5cQ8mdJJrNe7MMguk4hPB61S5xHawsfi.1hL3";
extraGroups =
["wheel"]
++ (lib.optional config.networking.networkmanager.enable "networkmanager")
++ (lib.optional config.virtualisation.docker.enable "docker");
hashedPassword =
if config.marleyos.isServer
then serverPass
else desktopPass;
};
};

View file

@ -0,0 +1,30 @@
{
lib,
config,
...
}: let
cfg = config.marleyos.bundles.server;
inherit (lib.marleyos) enabled;
in {
options.marleyos.bundles.server.enable = lib.mkEnableOption "server";
config = lib.mkIf cfg.enable {
marleyos = {
appearance = {
base = enabled;
console = enabled;
};
programs = {
cli = enabled;
tui = enabled;
};
services = {
docker = enabled;
openssh = enabled;
};
};
};
}

View file

@ -0,0 +1,7 @@
{lib, ...}: {
options.marleyos.isServer = lib.mkOption {
type = with lib.types; bool;
default = false;
description = "Whether this machine is a server.";
};
}

View file

@ -0,0 +1,13 @@
{
lib,
config,
...
}: let
cfg = config.marleyos.services.docker;
in {
options.marleyos.services.docker.enable = lib.mkEnableOption "docker";
config = lib.mkIf cfg.enable {
virtualisation.docker.enable = true;
};
}

View file

@ -0,0 +1,18 @@
{
lib,
config,
...
}: let
cfg = config.marleyos.services.openssh;
in {
options.marleyos.services.openssh.enable = lib.mkEnableOption "openssh";
config = lib.mkIf cfg.enable {
services.openssh = {
enable = true;
settings = {
PermitRootLogin = "no";
};
};
};
}