Formatting

This commit is contained in:
batteredbunny 2024-05-23 20:08:11 +03:00
parent 9f86e0d942
commit 848f8e1589
4 changed files with 64 additions and 57 deletions

View file

@ -3,18 +3,21 @@
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
};
outputs = {nixpkgs, ...}: let
outputs = { nixpkgs, ... }:
let
lib = nixpkgs.lib;
# Stolen from https://github.com/divnix/digga/blob/main/src/importers.nix
rakeLeaves = dirPath: let
rakeLeaves = dirPath:
let
seive = file: type:
# Only rake `.nix` files or directories
(type == "regular" && lib.hasSuffix ".nix" file) || (type == "directory");
collect = file: type: {
name = lib.removeSuffix ".nix" file;
value = let
value =
let
path = dirPath + "/${file}";
in
if
@ -28,7 +31,8 @@
files = lib.filterAttrs seive (builtins.readDir dirPath);
in
lib.filterAttrs (n: v: v != { }) (lib.mapAttrs' collect files);
in {
in
{
nixosModules = rakeLeaves ./modules;
};
}

View file

@ -1,9 +1,9 @@
{
config,
lib,
pkgs,
...
}: let
{ config
, lib
, pkgs
, ...
}:
let
cfg = config.system.autoUpgrade;
updateScript = pkgs.writeShellApplication {
@ -19,7 +19,8 @@
git push
'';
};
in {
in
{
options.system.autoUpgrade = {
# TODO: make sure system.autoUpgrade.flake is a local folder
updateFlake = lib.mkOption {

View file

@ -1,11 +1,12 @@
{
config,
pkgs,
lib,
...
}: let
{ config
, pkgs
, lib
, ...
}:
let
cfg = config.services.qbittorrent-nox;
in {
in
{
options.services.qbittorrent-nox = {
enable = lib.mkEnableOption "qbittorrent, BitTorrent client.";

View file

@ -1,11 +1,12 @@
{
config,
lib,
pkgs,
...
}: let
{ config
, lib
, pkgs
, ...
}:
let
cfg = config.services.unpackerr;
in {
in
{
options.services.unpackerr = {
enable = lib.mkEnableOption "unpackerr";
package = lib.mkPackageOption pkgs "unpackerr" { };