1
0
Fork 0

Run statix linter

This commit is contained in:
Aires 2024-03-02 12:58:30 -05:00
parent fb708499a7
commit 0b936b1f6e
17 changed files with 31 additions and 30 deletions

View file

@ -26,7 +26,7 @@
outputs = inputs@{ self, nixpkgs, lanzaboote, nix-flatpak, home-manager, nixos-hardware, ... }: outputs = inputs@{ self, nixpkgs, lanzaboote, nix-flatpak, home-manager, nixos-hardware, ... }:
let let
inherit (self) outputs; inherit (self) outputs;
lib = nixpkgs.lib; inherit (nixpkgs) lib;
systems = [ "x86_64-linux" "aarch64-linux" ]; systems = [ "x86_64-linux" "aarch64-linux" ];
forEachSystem = f: lib.genAttrs systems (sys: f pkgsFor.${sys}); forEachSystem = f: lib.genAttrs systems (sys: f pkgsFor.${sys});
pkgsFor = lib.genAttrs systems (system: import nixpkgs { pkgsFor = lib.genAttrs systems (system: import nixpkgs {

View file

@ -5,7 +5,7 @@ let
nix-secrets = builtins.fetchGit { nix-secrets = builtins.fetchGit {
url = "/home/aires/Development/nix-configuration/nix-secrets"; url = "/home/aires/Development/nix-configuration/nix-secrets";
ref = "main"; ref = "main";
rev = "7e6dd41b5a89a1ff2ead22bf69e5b82b585c0fa2"; rev = "55fc814d477d956ab885e157f24c2d43f433dc7a";
}; };
in{ in{
imports = [ imports = [

View file

@ -11,7 +11,7 @@ with lib;
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
services.flatpak.packages = lib.mkIf (config.services.flatpak.enable == true) [ services.flatpak.packages = lib.mkIf config.services.flatpak.enable [
"gg.minion.Minion" "gg.minion.Minion"
"com.valvesoftware.Steam" "com.valvesoftware.Steam"
"org.firestormviewer.FirestormViewer" "org.firestormviewer.FirestormViewer"

View file

@ -32,7 +32,7 @@ with lib;
]; ];
# Reduce audio latency per https://nixos.wiki/wiki/PipeWire#Low-latency_setup # Reduce audio latency per https://nixos.wiki/wiki/PipeWire#Low-latency_setup
services.pipewire.extraConfig.pipewire = lib.mkIf (config.sound.enable == true) { services.pipewire.extraConfig.pipewire = lib.mkIf config.sound.enable {
"92-low-latency.conf" = { "92-low-latency.conf" = {
"context.properties" = { "context.properties" = {
"default.clock.rate" = 48000; "default.clock.rate" = 48000;

View file

@ -24,7 +24,7 @@ with lib;
}; };
config = mkIf cfg.enable (mkMerge[ config = mkIf cfg.enable (mkMerge[
(mkIf (cfg.secureboot.enable == true) { (mkIf cfg.secureboot.enable {
boot = { boot = {
# Enable Secure Boot # Enable Secure Boot
bootspec.enable = true; bootspec.enable = true;
@ -48,7 +48,7 @@ with lib;
}) })
# Plain boot # Plain boot
(mkIf (cfg.secureboot.enable == false) { (mkIf (!cfg.secureboot.enable) {
boot = { boot = {
loader.systemd-boot.enable = true; loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true; loader.efi.canTouchEfiVariables = true;

View file

@ -1,4 +1,4 @@
{ ... }: { _: {
networking = { networking = {
# Enable networking via NetworkManager # Enable networking via NetworkManager
networkmanager.enable = true; networkmanager.enable = true;

View file

@ -1,6 +1,6 @@
{ config, lib, modulesPath, pkgs, ... }: { config, lib, modulesPath, pkgs, ... }:
let let
role = config.host.role; inherit (config.host) role;
in in
with lib; with lib;
{ {

View file

@ -1,6 +1,6 @@
{ config, lib, modulesPath, pkgs, ... }: { config, lib, modulesPath, pkgs, ... }:
let let
role = config.host.role; inherit (config.host) role;
in in
with lib; with lib;
{ {
@ -16,6 +16,7 @@ in
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
direnv direnv
statix # Nix linting tool
]; ];
boot = { boot = {

View file

@ -11,7 +11,7 @@ with lib;
config = mkIf cfg.enable { config = mkIf cfg.enable {
services.apcupsd = { services.apcupsd = {
enable = true; enable = true;
configText = (builtins.readFile ./etc/apcupsd.conf); configText = builtins.readFile ./etc/apcupsd.conf;
}; };
}; };
} }

View file

@ -47,6 +47,6 @@ rec {
environment = { environment = {
HOME = cfg.environment; HOME = cfg.environment;
}; };
} // optionalAttrs (cfg.autostart == true) { wantedBy = ["multi-user.target"]; }; # Start at boot if autostart is enabled. } // optionalAttrs cfg.autostart { wantedBy = ["multi-user.target"]; }; # Start at boot if autostart is enabled.
}; };
} }

View file

@ -43,11 +43,11 @@ with lib;
services.k3s = { services.k3s = {
enable = true; enable = true;
role = cfg.role; inherit (cfg) role;
extraFlags = toString [ extraFlags = toString [
# "--kubelet-arg=v=4" # Optionally add additional args to k3s # "--kubelet-arg=v=4" # Optionally add additional args to k3s
]; ];
} // optionalAttrs (cfg.role == "agent") { serverAddr = cfg.serverAddr; }; } // optionalAttrs (cfg.role == "agent") { inherit (cfg) serverAddr; };
# Increase number of open file handlers so K3s doesn't exhaust them...again. # Increase number of open file handlers so K3s doesn't exhaust them...again.
systemd.extraConfig = '' systemd.extraConfig = ''

View file

@ -26,7 +26,7 @@ with lib;
jack.enable = true; jack.enable = true;
}; };
services.flatpak.packages = lib.mkIf (config.host.ui.flatpak.enable == true) [ services.flatpak.packages = lib.mkIf config.host.ui.flatpak.enable [
"com.github.wwmm.easyeffects" "com.github.wwmm.easyeffects"
]; ];
}; };

View file

@ -34,9 +34,9 @@ with lib;
}; };
# Remove default packages that came with the install # Remove default packages that came with the install
services.xserver.excludePackages = (with pkgs; [ services.xserver.excludePackages = with pkgs; [
xterm xterm
]); ];
environment.gnome.excludePackages = (with pkgs; [ environment.gnome.excludePackages = (with pkgs; [
gnome-photos gnome-photos
gnome-tour gnome-tour

View file

@ -24,7 +24,7 @@ with lib;
}; };
config = mkIf cfg.enable (mkMerge [ config = mkIf cfg.enable (mkMerge [
({ {
users.users.aires = { users.users.aires = {
isNormalUser = true; isNormalUser = true;
description = "Aires"; description = "Aires";
@ -36,7 +36,7 @@ with lib;
}; };
# Install aires-specific Flatpaks # Install aires-specific Flatpaks
services.flatpak.packages = mkIf (config.services.flatpak.enable == true) [ services.flatpak.packages = mkIf config.services.flatpak.enable [
"com.discordapp.Discord" "com.discordapp.Discord"
"org.telegram.desktop" "org.telegram.desktop"
]; ];
@ -58,7 +58,7 @@ with lib;
home.homeDirectory = "/home/aires"; home.homeDirectory = "/home/aires";
# Install extra packages, specifically gnome extensions # Install extra packages, specifically gnome extensions
home.packages = lib.mkIf (config.host.ui.gnome.enable) [ home.packages = lib.mkIf config.host.ui.gnome.enable [
pkgs.gnomeExtensions.wallpaper-slideshow pkgs.gnomeExtensions.wallpaper-slideshow
]; ];
@ -109,10 +109,10 @@ with lib;
}; };
}; };
}; };
}) }
# Autologin aires # Autologin aires
(mkIf (cfg.autologin == true) { (mkIf cfg.autologin {
services.xserver.displayManager.autoLogin = { services.xserver.displayManager.autoLogin = {
enable = true; enable = true;
user = "aires"; user = "aires";
@ -124,10 +124,10 @@ with lib;
}) })
# Enable Syncthing # Enable Syncthing
(mkIf (cfg.services.syncthing.enable == true) { (mkIf cfg.services.syncthing.enable {
users.users.aires.packages = [ users.users.aires.packages = [
pkgs.syncthing pkgs.syncthing
(mkIf (cfg.services.syncthing.enableTray == true) pkgs.syncthingtray) (mkIf cfg.services.syncthing.enableTray pkgs.syncthingtray)
]; ];
# Open port 8080 # Open port 8080
@ -147,7 +147,7 @@ with lib;
}; };
# Override the default Syncthing settings so it doesn't start on boot # Override the default Syncthing settings so it doesn't start on boot
systemd.user.services."syncthing" = mkIf (cfg.services.syncthing.autostart == false) { systemd.user.services."syncthing" = mkIf (!cfg.services.syncthing.autostart) {
Install = lib.mkForce {}; Install = lib.mkForce {};
}; };
}; };

View file

@ -1,6 +1,6 @@
{ lib, pkgs, osConfig, ... }: { { lib, pkgs, osConfig, ... }: {
# Additional Gnome configurations via home-manager. Imported by default by aires and gremlin. # Additional Gnome configurations via home-manager. Imported by default by aires and gremlin.
dconf.settings = lib.mkIf (osConfig.host.ui.gnome.enable) { dconf.settings = lib.mkIf osConfig.host.ui.gnome.enable {
"org/gnome/mutter" = { "org/gnome/mutter" = {
edge-tiling = true; edge-tiling = true;
workspaces-only-on-primary = false; workspaces-only-on-primary = false;

View file

@ -36,7 +36,7 @@ with lib;
}; };
# Install gremlin-specific flatpaks # Install gremlin-specific flatpaks
services.flatpak.packages = lib.mkIf (config.services.flatpak.enable == true) [ services.flatpak.packages = lib.mkIf config.services.flatpak.enable [
"com.google.Chrome" "com.google.Chrome"
"com.slack.Slack" "com.slack.Slack"
]; ];
@ -96,11 +96,11 @@ with lib;
}) })
# Enable Syncthing # Enable Syncthing
(mkIf (cfg.services.syncthing.enable == true) { (mkIf cfg.services.syncthing.enable {
users.users.gremlin = { users.users.gremlin = {
packages = [ packages = [
pkgs.syncthing pkgs.syncthing
(mkIf (cfg.services.syncthing.enableTray == true) pkgs.syncthingtray) (mkIf cfg.services.syncthing.enableTray pkgs.syncthingtray)
]; ];
}; };
@ -116,7 +116,7 @@ with lib;
}; };
# Override the default Syncthing settings so it doesn't start on boot # Override the default Syncthing settings so it doesn't start on boot
systemd.user.services."syncthing" = mkIf (cfg.services.syncthing.autostart == false) { systemd.user.services."syncthing" = mkIf (!cfg.services.syncthing.autostart) {
Install = lib.mkForce {}; Install = lib.mkForce {};
}; };
}; };

@ -1 +1 @@
Subproject commit 7e6dd41b5a89a1ff2ead22bf69e5b82b585c0fa2 Subproject commit 55fc814d477d956ab885e157f24c2d43f433dc7a