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, ... }:
let
inherit (self) outputs;
lib = nixpkgs.lib;
inherit (nixpkgs) lib;
systems = [ "x86_64-linux" "aarch64-linux" ];
forEachSystem = f: lib.genAttrs systems (sys: f pkgsFor.${sys});
pkgsFor = lib.genAttrs systems (system: import nixpkgs {

View file

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

View file

@ -11,7 +11,7 @@ with lib;
};
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"
"com.valvesoftware.Steam"
"org.firestormviewer.FirestormViewer"

View file

@ -32,7 +32,7 @@ with lib;
];
# 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" = {
"context.properties" = {
"default.clock.rate" = 48000;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -47,6 +47,6 @@ rec {
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 = {
enable = true;
role = cfg.role;
inherit (cfg) role;
extraFlags = toString [
# "--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.
systemd.extraConfig = ''

View file

@ -26,7 +26,7 @@ with lib;
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"
];
};

View file

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

View file

@ -24,7 +24,7 @@ with lib;
};
config = mkIf cfg.enable (mkMerge [
({
{
users.users.aires = {
isNormalUser = true;
description = "Aires";
@ -36,7 +36,7 @@ with lib;
};
# Install aires-specific Flatpaks
services.flatpak.packages = mkIf (config.services.flatpak.enable == true) [
services.flatpak.packages = mkIf config.services.flatpak.enable [
"com.discordapp.Discord"
"org.telegram.desktop"
];
@ -58,7 +58,7 @@ with lib;
home.homeDirectory = "/home/aires";
# 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
];
@ -109,10 +109,10 @@ with lib;
};
};
};
})
}
# Autologin aires
(mkIf (cfg.autologin == true) {
(mkIf cfg.autologin {
services.xserver.displayManager.autoLogin = {
enable = true;
user = "aires";
@ -124,10 +124,10 @@ with lib;
})
# Enable Syncthing
(mkIf (cfg.services.syncthing.enable == true) {
(mkIf cfg.services.syncthing.enable {
users.users.aires.packages = [
pkgs.syncthing
(mkIf (cfg.services.syncthing.enableTray == true) pkgs.syncthingtray)
(mkIf cfg.services.syncthing.enableTray pkgs.syncthingtray)
];
# Open port 8080
@ -147,7 +147,7 @@ with lib;
};
# 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 {};
};
};

View file

@ -1,6 +1,6 @@
{ lib, pkgs, osConfig, ... }: {
# 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" = {
edge-tiling = true;
workspaces-only-on-primary = false;

View file

@ -36,7 +36,7 @@ with lib;
};
# 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.slack.Slack"
];
@ -96,11 +96,11 @@ with lib;
})
# Enable Syncthing
(mkIf (cfg.services.syncthing.enable == true) {
(mkIf cfg.services.syncthing.enable {
users.users.gremlin = {
packages = [
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
systemd.user.services."syncthing" = mkIf (cfg.services.syncthing.autostart == false) {
systemd.user.services."syncthing" = mkIf (!cfg.services.syncthing.autostart) {
Install = lib.mkForce {};
};
};

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