Format the files through nixfmt

This commit is contained in:
Gabriel Arazas 2022-01-11 20:22:08 +08:00
parent d0a87597c5
commit 7db21c9fc5
6 changed files with 81 additions and 72 deletions

View File

@ -79,7 +79,10 @@
# Set several binary caches. # Set several binary caches.
nix = { nix = {
binaryCaches = [ "https://nix-community.cachix.org" "https://foo-dogsquared.cachix.org" ]; binaryCaches = [
"https://nix-community.cachix.org"
"https://foo-dogsquared.cachix.org"
];
binaryCachePublicKeys = [ binaryCachePublicKeys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"foo-dogsquared.cachix.org-1:/2fmqn/gLGvCs5EDeQmqwtus02TUmGy0ZlAEXqRE70E=" "foo-dogsquared.cachix.org-1:/2fmqn/gLGvCs5EDeQmqwtus02TUmGy0ZlAEXqRE70E="
@ -158,7 +161,9 @@
# The development environment for this flake. # The development environment for this flake.
devShell = forAllSystems (system: devShell = forAllSystems (system:
import ./shell.nix { pkgs = import nixpkgs { inherit system overlays; }; }); import ./shell.nix {
pkgs = import nixpkgs { inherit system overlays; };
});
# My several development shells for usual type of projects. This is much # My several development shells for usual type of projects. This is much
# more preferable than installing all of the packages at the system # more preferable than installing all of the packages at the system

View File

@ -1,7 +1,6 @@
{ config, options, lib, pkgs, ... }: { config, options, lib, pkgs, ... }:
let let cfg = config.services.archivebox;
cfg = config.services.archivebox;
in { in {
options.services.archivebox = { options.services.archivebox = {
enable = lib.mkEnableOption "Archivebox service"; enable = lib.mkEnableOption "Archivebox service";
@ -31,7 +30,9 @@ in {
Install.WantedBy = [ "graphical-session.target" ]; Install.WantedBy = [ "graphical-session.target" ];
Service = { Service = {
ExecStart = "${pkgs.archivebox}/bin/archivebox server localhost:${toString cfg.port}"; ExecStart = "${pkgs.archivebox}/bin/archivebox server localhost:${
toString cfg.port
}";
WorkingDirectory = cfg.archivePath; WorkingDirectory = cfg.archivePath;
Restart = "on-failure"; Restart = "on-failure";
}; };

View File

@ -35,8 +35,7 @@ in {
"google_toolbar.search_history" "google_toolbar.search_history"
"thumbnails.cache" "thumbnails.cache"
"zoom.logs" "zoom.logs"
] ] ++ lib.optionals cfg.withBrowserCleanup [
++ lib.optionals cfg.withBrowserCleanup [
"brave.cache" "brave.cache"
"brave.form_history" "brave.form_history"
"brave.history" "brave.history"
@ -68,7 +67,8 @@ in {
]; ];
}; };
withBrowserCleanup = lib.mkEnableOption "browser-related cleaners to be included in the list"; withBrowserCleanup =
lib.mkEnableOption "browser-related cleaners to be included in the list";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View File

@ -28,7 +28,8 @@ in {
extensionPackages = lib.mkOption { extensionPackages = lib.mkOption {
default = [ ]; default = [ ];
type = with lib.types; listOf package; type = with lib.types; listOf package;
example = lib.literalExpression "with pkgs; [ mopidy-spotify mopidy-mpd mopidy-mpris ]"; example = lib.literalExpression
"with pkgs; [ mopidy-spotify mopidy-mpd mopidy-mpris ]";
description = '' description = ''
Mopidy extensions that should be loaded by the service. Mopidy extensions that should be loaded by the service.
''; '';
@ -53,7 +54,8 @@ in {
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
assertions = [ assertions = [
(lib.hm.assertions.assertPlatform "services.mopidy" pkgs lib.platforms.linux) (lib.hm.assertions.assertPlatform "services.mopidy" pkgs
lib.platforms.linux)
]; ];
systemd.user.services.mopidy = { systemd.user.services.mopidy = {
@ -64,7 +66,9 @@ in {
}; };
Service = { Service = {
ExecStart = "${mopidyEnv}/bin/mopidy --config ${lib.concatStringsSep ":" ([mopidyConf] ++ cfg.extraConfigFiles)}"; ExecStart = "${mopidyEnv}/bin/mopidy --config ${
lib.concatStringsSep ":" ([ mopidyConf ] ++ cfg.extraConfigFiles)
}";
}; };
Install.WantedBy = [ "default.target" ]; Install.WantedBy = [ "default.target" ];
@ -78,7 +82,9 @@ in {
}; };
Service = { Service = {
ExecStart = "${mopidyEnv}/bin/mopidy --config ${lib.concatStringsSep ":" ([mopidyConf] ++ cfg.extraConfigFiles)} local scan"; ExecStart = "${mopidyEnv}/bin/mopidy --config ${
lib.concatStringsSep ":" ([ mopidyConf ] ++ cfg.extraConfigFiles)
} local scan";
Type = "oneshot"; Type = "oneshot";
}; };

View File

@ -135,8 +135,7 @@ in {
# I try to avoid using Wine on NixOS because most of them uses FHS or something and I just want it to work but here goes. # I try to avoid using Wine on NixOS because most of them uses FHS or something and I just want it to work but here goes.
(lib.mkIf cfg.wine.enable { (lib.mkIf cfg.wine.enable {
environment.systemPackages = with pkgs; environment.systemPackages = with pkgs; [
[
cfg.wine.package # The star of the show. cfg.wine.package # The star of the show.
winetricks # We do a little trickery with missing Windows runtimes. winetricks # We do a little trickery with missing Windows runtimes.
bottles # PlayOnLinux but better. :) bottles # PlayOnLinux but better. :)

View File

@ -30,7 +30,8 @@ in {
options.services.borgmatic = { options.services.borgmatic = {
jobs = lib.mkOption { jobs = lib.mkOption {
type = with lib.types; attrsOf (submodule jobOption); type = with lib.types; attrsOf (submodule jobOption);
description = "borgmatic jobs with each bearing a configuration file to be used."; description =
"borgmatic jobs with each bearing a configuration file to be used.";
default = { }; default = { };
example = { example = {
external-hard-drive = { external-hard-drive = {
@ -42,11 +43,8 @@ in {
}; };
config = { config = {
systemd.services = (lib.mapAttrs' systemd.services = (lib.mapAttrs' (name: settings:
(name: settings: lib.nameValuePair ("borgmatic-backup-" + name) ({
lib.nameValuePair
("borgmatic-backup-" + name)
({
unitConfig = { unitConfig = {
Description = "Backup with Borgmatic job '${name}'"; Description = "Backup with Borgmatic job '${name}'";
Wants = [ "network-online.target" ]; Wants = [ "network-online.target" ];