[fix] *.nix: reformat with alejandra

This commit is contained in:
Jalil David Salamé Messina 2024-05-04 20:57:33 +02:00
parent 876dc45719
commit 39c2fb096c
Signed by: jalil
GPG key ID: F016B9E770737A0B
26 changed files with 565 additions and 562 deletions

View file

@ -1,30 +1,29 @@
{ stylix }:
{
{stylix}: {
config,
pkgs,
lib,
...
}:
let
}: let
cfg = config.jconfig;
keysFromGithub = lib.attrsets.mapAttrs' (username: sha256: {
name = "pubkeys/${username}";
value = {
mode = "0755";
source = builtins.fetchurl {
inherit sha256;
url = "https://github.com/${username}.keys";
keysFromGithub =
lib.attrsets.mapAttrs' (username: sha256: {
name = "pubkeys/${username}";
value = {
mode = "0755";
source = builtins.fetchurl {
inherit sha256;
url = "https://github.com/${username}.keys";
};
};
};
}) cfg.importSSHKeysFromGithub;
in
{
})
cfg.importSSHKeysFromGithub;
in {
imports = [
./options.nix
./gui
stylix.nixosModules.stylix
# FIXME(https://github.com/danth/stylix/issues/216): Must configure stylix
{ stylix = import ./stylix-config.nix { inherit config pkgs; }; }
{stylix = import ./stylix-config.nix {inherit config pkgs;};}
];
config = lib.mkIf cfg.enable {
@ -85,8 +84,8 @@ in
users.defaultUserShell = pkgs.zsh;
# Open ports for spotifyd
networking.firewall.allowedUDPPorts = [ 5353 ];
networking.firewall.allowedTCPPorts = [ 2020 ];
networking.firewall.allowedUDPPorts = [5353];
networking.firewall.allowedTCPPorts = [2020];
# Nix Settings
nix.gc.automatic = true;

View file

@ -3,24 +3,24 @@
lib,
pkgs,
...
}:
let
}: let
cfg = config.jconfig.gui;
enable = config.jconfig.enable && cfg.enable;
in
{
in {
config = lib.mkMerge [
(lib.mkIf enable {
environment.systemPackages = [
pkgs.gnome.adwaita-icon-theme
pkgs.adwaita-qt
pkgs.nordzy-cursor-theme
pkgs.pinentry-qt
] ++ lib.optional cfg.ydotool.enable pkgs.ydotool;
environment.systemPackages =
[
pkgs.gnome.adwaita-icon-theme
pkgs.adwaita-qt
pkgs.nordzy-cursor-theme
pkgs.pinentry-qt
]
++ lib.optional cfg.ydotool.enable pkgs.ydotool;
systemd.user.services.ydotool = lib.mkIf cfg.ydotool.enable {
enable = cfg.ydotool.autoStart;
wantedBy = [ "default.target" ];
wantedBy = ["default.target"];
description = "Generic command-line automation tool";
documentation = [
"man:ydotool(1)"
@ -45,7 +45,7 @@ in
programs.dconf.enable = true;
programs.sway.enable = cfg.sway;
programs.sway.extraPackages = [ ]; # No extra packages (by default it adds foot, dmenu, and other stuff)
programs.sway.extraPackages = []; # No extra packages (by default it adds foot, dmenu, and other stuff)
programs.sway.wrapperFeatures.base = true;
programs.sway.wrapperFeatures.gtk = true;
@ -65,7 +65,7 @@ in
# XDG portals
xdg.portal.enable = true;
xdg.portal.wlr.enable = true;
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
xdg.portal.extraPortals = [pkgs.xdg-desktop-portal-gtk];
# Default to the gtk portal
xdg.portal.config.preferred.default = "gtk";
# Use wlr for screenshots and screen recording

View file

@ -1,24 +1,21 @@
{ lib, ... }:
let
{lib, ...}: let
inherit (lib) types;
# Like mkEnableOption but defaults to true
mkDisableOption =
option:
mkDisableOption = option:
(lib.mkEnableOption option)
// {
default = true;
example = false;
};
mkImageOption =
{
description,
url,
sha256 ? "",
}:
mkImageOption = {
description,
url,
sha256 ? "",
}:
lib.mkOption {
inherit description;
type = types.path;
default = builtins.fetchurl { inherit url sha256; };
default = builtins.fetchurl {inherit url sha256;};
defaultText = lib.literalMD "![${description}](${url})";
};
@ -31,7 +28,7 @@ let
steamHardwareSupport = mkDisableOption "steam hardware support";
ydotool = lib.mkOption {
description = "Jalil's default ydotool configuration.";
default = { };
default = {};
type = types.submodule {
options.enable = mkDisableOption "ydotool";
options.autoStart = mkDisableOption "autostarting ydotool at login";
@ -59,17 +56,17 @@ let
enable = lib.mkEnableOption "jalil's default configuration.";
dev = lib.mkOption {
description = "Options for setting up a dev environment";
default = { };
type = types.submodule { options.enable = lib.mkEnableOption "dev configuration"; };
default = {};
type = types.submodule {options.enable = lib.mkEnableOption "dev configuration";};
};
gui = lib.mkOption {
description = "Jalil's default configuration for a NixOS gui.";
default = { };
default = {};
type = types.submodule gui;
};
styling = lib.mkOption {
description = "Jalil's styling options";
default = { };
default = {};
type = types.submodule styling;
};
importSSHKeysFromGithub = lib.mkOption {
@ -86,18 +83,17 @@ let
`users.users.<name>.openssh.authorizedKeys.keyFiles` on the users you
want to allow ssh logins.
'';
default = { };
default = {};
example = {
"jalil-salame" = "sha256:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
};
type = types.attrsOf types.str;
};
};
in
{
in {
options.jconfig = lib.mkOption {
description = "Jalil's default NixOS configuration.";
default = { };
default = {};
type = types.submodule config;
};
}

View file

@ -1,13 +1,14 @@
{ config, pkgs }:
let
{
config,
pkgs,
}: let
cfg = config.jconfig.styling;
nerdFontSymbols = pkgs.nerdfonts.override { fonts = [ "NerdFontsSymbolsOnly" ]; };
nerdFontSymbols = pkgs.nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];};
fallbackSymbols = {
name = "Symbols Nerd Font";
package = nerdFontSymbols;
};
in
{
in {
autoEnable = cfg.enable;
image = cfg.wallpaper;
base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-hard.yaml";