Nixfmt: Enable strict formatting.

This commit is contained in:
Dmitry Voronin 2024-10-14 04:51:19 +03:00
parent 5dab0401f2
commit 8047d13b59
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
42 changed files with 51 additions and 168 deletions

View file

@ -12,4 +12,5 @@
[formatter.nixfmt-rfc-style] [formatter.nixfmt-rfc-style]
command = "nixfmt" command = "nixfmt"
options = [ "-s" ]
includes = [ "*.nix" ] includes = [ "*.nix" ]

View file

@ -32,9 +32,7 @@ in
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
systemd.tmpfiles.rules = container.mkContainerDir cfg [ systemd.tmpfiles.rules = container.mkContainerDir cfg [ "data" ];
"data"
];
containers.change = container.mkContainer cfg { containers.change = container.mkContainer cfg {
bindMounts = { bindMounts = {

View file

@ -36,9 +36,7 @@ in
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
systemd.tmpfiles.rules = container.mkContainerDir cfg [ systemd.tmpfiles.rules = container.mkContainerDir cfg [ "data" ];
"data"
];
containers.cloud = container.mkContainer cfg { containers.cloud = container.mkContainer cfg {
bindMounts = { bindMounts = {

View file

@ -24,9 +24,7 @@ in
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
systemd.tmpfiles.rules = container.mkContainerDir cfg [ systemd.tmpfiles.rules = container.mkContainerDir cfg [ "data" ];
"data"
];
containers.ddns = container.mkContainer cfg { containers.ddns = container.mkContainer cfg {
bindMounts = { bindMounts = {

View file

@ -30,9 +30,7 @@ in
config = config =
{ ... }: { ... }:
container.mkContainerConfig cfg { container.mkContainerConfig cfg {
environment.systemPackages = [ environment.systemPackages = [ pkgs.cloudflared ];
pkgs.cloudflared
];
systemd.services.cloudflared = { systemd.services.cloudflared = {
description = "Cloudflare DoH server."; description = "Cloudflare DoH server.";
@ -96,9 +94,7 @@ in
"https://raw.githubusercontent.com/AssoEchap/stalkerware-indicators/master/generated/hosts" "https://raw.githubusercontent.com/AssoEchap/stalkerware-indicators/master/generated/hosts"
"https://urlhaus.abuse.ch/downloads/hostfile/" "https://urlhaus.abuse.ch/downloads/hostfile/"
]; ];
other = [ other = [ "https://zerodot1.gitlab.io/CoinBlockerLists/hosts_browser" ];
"https://zerodot1.gitlab.io/CoinBlockerLists/hosts_browser"
];
}; };
# whiteLists = { # whiteLists = {
# other = [ # other = [

View file

@ -36,9 +36,7 @@ in
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
systemd.tmpfiles.rules = container.mkContainerDir cfg [ systemd.tmpfiles.rules = container.mkContainerDir cfg [ "data" ];
"data"
];
containers.download = container.mkContainer cfg { containers.download = container.mkContainer cfg {
enableTun = true; enableTun = true;

View file

@ -40,9 +40,7 @@ in
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
systemd.tmpfiles.rules = container.mkContainerDir cfg [ systemd.tmpfiles.rules = container.mkContainerDir cfg [ "data" ];
"data"
];
containers.frkn = container.mkContainer cfg { containers.frkn = container.mkContainer cfg {
bindMounts = { bindMounts = {

View file

@ -37,9 +37,7 @@ in
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
systemd.tmpfiles.rules = container.mkContainerDir cfg [ systemd.tmpfiles.rules = container.mkContainerDir cfg [ "data" ];
"data"
];
containers.git = container.mkContainer cfg { containers.git = container.mkContainer cfg {
bindMounts = { bindMounts = {

View file

@ -34,9 +34,7 @@ in
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
systemd.tmpfiles.rules = container.mkContainerDir cfg [ systemd.tmpfiles.rules = container.mkContainerDir cfg [ "data" ];
"data"
];
containers.hdd = container.mkContainer cfg { containers.hdd = container.mkContainer cfg {
# bindMounts = let # bindMounts = let

View file

@ -33,9 +33,7 @@ in
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
systemd.tmpfiles.rules = container.mkContainerDir cfg [ systemd.tmpfiles.rules = container.mkContainerDir cfg [ "data" ];
"data"
];
containers.iot = container.mkContainer cfg { containers.iot = container.mkContainer cfg {
bindMounts = { bindMounts = {

View file

@ -31,9 +31,7 @@ in
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
systemd.tmpfiles.rules = container.mkContainerDir cfg [ systemd.tmpfiles.rules = container.mkContainerDir cfg [ "data" ];
"data"
];
containers.jobber = container.mkContainer cfg { containers.jobber = container.mkContainer cfg {
bindMounts = { bindMounts = {
@ -58,11 +56,7 @@ in
]); ]);
in in
container.mkContainerConfig cfg { container.mkContainerConfig cfg {
networking = lib.mkForce { networking = lib.mkForce { nameservers = [ "10.30.218.2" ]; };
nameservers = [
"10.30.218.2"
];
};
systemd.services.jobber = { systemd.services.jobber = {
description = "My job is pushing the button."; description = "My job is pushing the button.";

View file

@ -193,9 +193,7 @@ in
ru ru
]; ];
hostName = cfg.domain; hostName = cfg.domain;
plugins = [ plugins = [ "managesieve" ];
"managesieve"
];
extraConfig = '' extraConfig = ''
# starttls needed for authentication, so the fqdn required to match # starttls needed for authentication, so the fqdn required to match
# the certificate # the certificate

View file

@ -38,9 +38,7 @@ in
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
systemd.tmpfiles.rules = container.mkContainerDir cfg [ systemd.tmpfiles.rules = container.mkContainerDir cfg [ "data" ];
"data"
];
containers.office = container.mkContainer cfg { containers.office = container.mkContainer cfg {
bindMounts = { bindMounts = {

View file

@ -34,9 +34,7 @@ in
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
systemd.tmpfiles.rules = container.mkContainerDir cfg [ systemd.tmpfiles.rules = container.mkContainerDir cfg [ "data" ];
"data"
];
containers.paper = container.mkContainer cfg { containers.paper = container.mkContainer cfg {
bindMounts = { bindMounts = {

View file

@ -32,9 +32,7 @@ in
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
systemd.tmpfiles.rules = container.mkContainerDir cfg [ systemd.tmpfiles.rules = container.mkContainerDir cfg [ "data" ];
"data"
];
containers.pass = container.mkContainer cfg { containers.pass = container.mkContainer cfg {
bindMounts = { bindMounts = {

View file

@ -29,9 +29,7 @@ in
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
systemd.tmpfiles.rules = container.mkContainerDir cfg [ systemd.tmpfiles.rules = container.mkContainerDir cfg [ "data" ];
"data"
];
containers.postgres = container.mkContainer cfg { containers.postgres = container.mkContainer cfg {
bindMounts = { bindMounts = {

View file

@ -40,9 +40,7 @@ in
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
systemd.tmpfiles.rules = container.mkContainerDir cfg [ systemd.tmpfiles.rules = container.mkContainerDir cfg [ "data" ];
"data"
];
containers.print = container.mkContainer cfg { containers.print = container.mkContainer cfg {
bindMounts = { bindMounts = {

View file

@ -30,9 +30,7 @@ in
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
systemd.tmpfiles.rules = container.mkContainerDir cfg [ systemd.tmpfiles.rules = container.mkContainerDir cfg [ "data" ];
"data"
];
containers.rabbitmq = container.mkContainer cfg { containers.rabbitmq = container.mkContainer cfg {
bindMounts = { bindMounts = {

View file

@ -33,9 +33,7 @@ in
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
systemd.tmpfiles.rules = container.mkContainerDir cfg [ systemd.tmpfiles.rules = container.mkContainerDir cfg [ "data" ];
"data"
];
containers.read = container.mkContainer cfg { containers.read = container.mkContainer cfg {
bindMounts = { bindMounts = {

View file

@ -32,9 +32,7 @@ in
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
systemd.tmpfiles.rules = container.mkContainerDir cfg [ systemd.tmpfiles.rules = container.mkContainerDir cfg [ "data" ];
"data"
];
containers.status = container.mkContainer cfg { containers.status = container.mkContainer cfg {
bindMounts = { bindMounts = {
@ -48,9 +46,7 @@ in
{ lib, ... }: { lib, ... }:
container.mkContainerConfig cfg { container.mkContainerConfig cfg {
networking = { networking = {
nameservers = mkForce [ nameservers = mkForce [ config.container.module.dns.address ];
config.container.module.dns.address
];
}; };
services.uptime-kuma = { services.uptime-kuma = {

View file

@ -32,9 +32,7 @@ in
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
systemd.tmpfiles.rules = container.mkContainerDir cfg [ systemd.tmpfiles.rules = container.mkContainerDir cfg [ "data" ];
"data"
];
containers.stock = container.mkContainer cfg { containers.stock = container.mkContainer cfg {
bindMounts = { bindMounts = {

View file

@ -1,8 +1,4 @@
{ { config, container, ... }:
config,
container,
...
}:
let let
domain = "camera.${config.container.domain}"; domain = "camera.${config.container.domain}";
address = "192.168.2.249"; address = "192.168.2.249";

View file

@ -1,8 +1,4 @@
{ { container, config, ... }:
container,
config,
...
}:
let let
cfg = config.container.module.hdd; cfg = config.container.module.hdd;
name = "hdd"; name = "hdd";

View file

@ -1,8 +1,4 @@
{ { config, container, ... }:
config,
container,
...
}:
let let
cfg = config.container.module.home; cfg = config.container.module.home;
name = "home"; name = "home";

View file

@ -1,8 +1,4 @@
{ { container, config, ... }:
container,
config,
...
}:
let let
cfg = config.container.module.iot; cfg = config.container.module.iot;
name = "iot"; name = "iot";

View file

@ -1,8 +1,4 @@
{ { container, config, ... }:
container,
config,
...
}:
let let
cfg = config.container.module.search; cfg = config.container.module.search;
name = "search"; name = "search";

View file

@ -231,11 +231,7 @@
}; };
}; };
mkSystem = system: hostname: { mkSystem = system: hostname: { "${hostname}" = mkHost { inherit system hostname; }; };
"${hostname}" = mkHost {
inherit system hostname;
};
};
in in
nixpkgs.lib.foldl' (acc: h: acc // h) { } ( nixpkgs.lib.foldl' (acc: h: acc // h) { } (
map ( map (

View file

@ -50,9 +50,7 @@
{ {
devShells.${system} = { devShells.${system} = {
default = pkgs.mkShell rec { default = pkgs.mkShell rec {
nativeBuildInputs = with pkgs; [ nativeBuildInputs = with pkgs; [ tex ];
tex
];
buildInputs = with pkgs; [ ]; buildInputs = with pkgs; [ ];
SOURCE_DATE_EPOCH = "${toString self.lastModified}"; SOURCE_DATE_EPOCH = "${toString self.lastModified}";
}; };

View file

@ -24,9 +24,7 @@ in
"sway/scratchpad" "sway/scratchpad"
"mpris" "mpris"
]; ];
modules-center = [ modules-center = [ "sway/workspaces" ];
"sway/workspaces"
];
modules-right = [ modules-right = [
"sway/language" "sway/language"
"pulseaudio" "pulseaudio"

View file

@ -1,8 +1,4 @@
{ { lib, config, ... }:
lib,
config,
...
}:
with lib; with lib;
let let
cfg = config.user.dasha; cfg = config.user.dasha;

View file

@ -1,8 +1,6 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [ fprintd ];
fprintd
];
services.fprintd = { services.fprintd = {
enable = true; enable = true;

View file

@ -10,9 +10,7 @@
cfg: extra: cfg: extra:
lib.recursiveUpdate { lib.recursiveUpdate {
# Allow nested containers. # Allow nested containers.
additionalCapabilities = [ additionalCapabilities = [ ''all" --system-call-filter="add_key keyctl bpf" --capability="all'' ];
''all" --system-call-filter="add_key keyctl bpf" --capability="all''
];
enableTun = true; enableTun = true;
# Start containers with the system by default. # Start containers with the system by default.
@ -71,11 +69,7 @@
mkContainerDir = cfg: dirs: map (path: "d '${cfg.storage}/${path}' 1777 root root - -") dirs; mkContainerDir = cfg: dirs: map (path: "d '${cfg.storage}/${path}' 1777 root root - -") dirs;
# Common configuration for Nginx server. # Common configuration for Nginx server.
mkServer = mkServer = cfg: lib.recursiveUpdate { forceSSL = false; } cfg;
cfg:
lib.recursiveUpdate {
forceSSL = false;
} cfg;
# Attach the host media directory to container. # Attach the host media directory to container.
# They will be added to /type/{0..9} # They will be added to /type/{0..9}

View file

@ -15,11 +15,7 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
nixpkgs.config.rocmSupport = true; nixpkgs.config.rocmSupport = true;
systemd.tmpfiles.rules = [ systemd.tmpfiles.rules = [ "L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}" ];
"L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}" hardware.graphics.extraPackages = with pkgs; [ rocmPackages.clr.icd ];
];
hardware.graphics.extraPackages = with pkgs; [
rocmPackages.clr.icd
];
}; };
} }

View file

@ -8,7 +8,5 @@ in
module.desktop.brightness.enable = mkEnableOption "Brightness."; module.desktop.brightness.enable = mkEnableOption "Brightness.";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable { programs.light.enable = true; };
programs.light.enable = true;
};
} }

View file

@ -22,9 +22,7 @@ in
}; };
config = mkIf cfg.enable (mkMerge [ config = mkIf cfg.enable (mkMerge [
{ { boot.kernelModules = [ "kvm-intel" ]; }
boot.kernelModules = [ "kvm-intel" ];
}
(mkIf cfg.powersave { (mkIf cfg.powersave {
module.powersave = { module.powersave = {
enable = true; enable = true;

View file

@ -85,12 +85,8 @@ in
}; };
}) })
(mkIf cfg.hotspotTtlBypass { (mkIf cfg.hotspotTtlBypass { boot.kernel.sysctl."net.ipv4.ip_default_ttl" = 65; })
boot.kernel.sysctl."net.ipv4.ip_default_ttl" = 65;
})
(mkIf cfg.latest { (mkIf cfg.latest { boot.kernelPackages = pkgs.linuxPackages_latest; })
boot.kernelPackages = pkgs.linuxPackages_latest;
})
]); ]);
} }

View file

@ -60,9 +60,7 @@ in
}) })
# Desktop apps. # Desktop apps.
(mkIf cfg.desktop.enable { (mkIf cfg.desktop.enable { environment.systemPackages = package.desktop; })
environment.systemPackages = package.desktop;
})
# Gaming. # Gaming.
(mkIf cfg.gaming.enable { (mkIf cfg.gaming.enable {
@ -86,18 +84,12 @@ in
}) })
# Creative. # Creative.
(mkIf cfg.creative.enable { (mkIf cfg.creative.enable { environment.systemPackages = package.creative; })
environment.systemPackages = package.creative;
})
# Development. # Development.
(mkIf cfg.dev.enable { (mkIf cfg.dev.enable { environment.systemPackages = package.dev; })
environment.systemPackages = package.dev;
})
# Extras. # Extras.
(mkIf cfg.extra.enable { (mkIf cfg.extra.enable { environment.systemPackages = package.extra; })
environment.systemPackages = package.extra;
})
]; ];
} }

View file

@ -17,9 +17,7 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
security.polkit.enable = true; security.polkit.enable = true;
systemd = { systemd = {
packages = with pkgs; [ packages = with pkgs; [ polkit-kde-agent ];
polkit-kde-agent
];
user = { user = {
services.plasma-polkit-agent = { services.plasma-polkit-agent = {
serviceConfig = { serviceConfig = {

View file

@ -17,9 +17,7 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
xdg.portal = { xdg.portal = {
enable = true; enable = true;
extraPortals = with pkgs; [ extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
xdg-desktop-portal-gtk
];
config = { config = {
common = { common = {
default = [ default = [

View file

@ -41,9 +41,7 @@ in
base = true; base = true;
gtk = true; gtk = true;
}; };
extraPackages = with pkgs; [ extraPackages = with pkgs; [ swaykbdd ];
swaykbdd
];
}; };
}; };
} }

View file

@ -15,7 +15,5 @@ in
}; };
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable { environment.systemPackages = with pkgs; [ waybar ]; };
environment.systemPackages = with pkgs; [ waybar ];
};
} }

View file

@ -47,9 +47,7 @@ let
dark = colors; dark = colors;
}; };
links = [ links = [ (mkLink "Status" "fa-heartbeat" "https://${config.container.module.status.domain}") ];
(mkLink "Status" "fa-heartbeat" "https://${config.container.module.status.domain}")
];
services = [ services = [
(mkGroup "App" "fa-server" [ (mkGroup "App" "fa-server" [