nix: format with alejandra

This commit is contained in:
Primrose 2025-02-08 12:05:12 +01:00
parent d5cad148da
commit 95eb4b71e0
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA
118 changed files with 1291 additions and 1703 deletions

View file

@ -1,6 +1,4 @@
{ lib, ... }:
{
{lib, ...}: {
nix.gc = lib.mkDefault {
automatic = true;
dates = "semi-annually";

View file

@ -1 +1 @@
{ programs.command-not-found.enable = false; }
{programs.command-not-found.enable = false;}

View file

@ -1,14 +1,13 @@
{
services.xserver.xkb = {
extraLayouts = {
"myDvorak" = {
languages = [ "us" ];
languages = ["us"];
symbolsFile = ./dvorak.xkb;
description = "Leana's dvorak";
};
"myDvorakFrench" = {
languages = [ "fr" ];
languages = ["fr"];
symbolsFile = ./dvorak-french.xkb;
description = "Leana's dvorak but baguette";
};
@ -16,5 +15,4 @@
};
console.useXkbConfig = true;
}

View file

@ -1,9 +1,5 @@
{ lib, ... }:
{
{lib, ...}: {
config = lib.mkDefault {
time.timeZone = "Europe/Paris";
i18n = {
defaultLocale = "en_US.UTF-8";
@ -13,7 +9,5 @@
"zh_TW.UTF-8/UTF-8"
];
};
};
}

View file

@ -1,6 +1,8 @@
{ lib, hostname, ... }:
{
lib,
hostname,
...
}: {
networking.hostName = hostname;
services.openssh = {
@ -9,7 +11,7 @@
PermitRootLogin = "prohibit-password";
PasswordAuthentication = false;
};
ports = lib.mkDefault [ 22 ];
ports = lib.mkDefault [22];
};
users.users.root.openssh.authorizedKeys.keys = [

View file

@ -3,42 +3,32 @@
lib,
config,
...
}:
let
}: let
cfg = config.services.parrot;
t = lib.types;
in
{
in {
options = {
services.parrot = {
enable = lib.mkEnableOption "parrot";
environmentFile = lib.mkOption {
description = "Path to an environment file, you can set the token there";
type = t.path;
};
};
};
config = lib.mkIf cfg.enable {
users.users."parrot" = {
group = "parrot";
isSystemUser = true;
};
users.groups."parrot" = { };
users.groups."parrot" = {};
systemd.services."parrot" = {
description = " A hassle-free, highly performant, self-hosted Discord music bot with YouTube and Spotify support. Powered by yt-dlp.";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
after = ["network.target"];
wantedBy = ["multi-user.target"];
serviceConfig = {
User = "parrot";
@ -48,9 +38,6 @@ in
ExecStart = "${lib.getExe pkgs.parrot}";
};
};
};
}

View file

@ -1,6 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
security.sudo.extraConfig = ''
Defaults lecture = always
Defaults lecture_file = ${pkgs.writeText "sudo_lecture_file" ''

View file

@ -1,7 +1,8 @@
{ lib, pkgs, ... }:
{
lib,
pkgs,
...
}: {
nix = {
package = lib.mkDefault pkgs.nix;
@ -28,7 +29,5 @@
sandbox = true;
};
};
}

View file

@ -3,19 +3,12 @@
config,
lib,
...
}:
let
}: let
cfg = config.services.typst-bot;
t = lib.types;
in
{
in {
options = {
services.typst-bot = {
enable = lib.mkEnableOption "typst-bot";
dataDir = lib.mkOption {
@ -28,18 +21,15 @@ in
description = "Path to an environment file, you can set the token there";
type = t.path;
};
};
};
config = lib.mkIf cfg.enable {
users.users."typst-bot" = {
group = "typst-bot";
isSystemUser = true;
};
users.groups."typst-bot" = { };
users.groups."typst-bot" = {};
systemd.tmpfiles.rules = [
"d ${cfg.dataDir}/cache 700 typst-bot typst-bot - -"
@ -48,15 +38,15 @@ in
systemd.services."typst-bot" = {
description = "A discord bot to render Typst code";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
after = ["network.target"];
wantedBy = ["multi-user.target"];
preStart = ''
touch ${cfg.dataDir}/sqlite/db.sqlite
'';
# Don't pollute the global path
path = [ pkgs.myPkgs.typst-bot ];
path = [pkgs.myPkgs.typst-bot];
script = "typst-bot";
serviceConfig = {
@ -71,9 +61,6 @@ in
cfg.environmentFile
];
};
};
};
}

View file

@ -1,20 +1,18 @@
{ lib, ... }:
{
{lib, ...}: {
nixpkgs.config.allowUnfreePredicate = lib.mkDefault (
pkg:
builtins.elem (lib.getName pkg) [
"discord"
builtins.elem (lib.getName pkg) [
"discord"
"brscan5"
"brscan5-etc-files"
"brscan5"
"brscan5-etc-files"
"steam"
"steam-original"
"steam-run"
"steam"
"steam-original"
"steam-run"
"vscode"
"code"
]
"vscode"
"code"
]
);
}

View file

@ -1,5 +1,3 @@
{ lib, ... }:
{
{lib, ...}: {
zramSwap.enable = lib.mkDefault true;
}