[fix] fmt: change formatter to nixfmt-rfc-style

Alejandra has ads and splits files into too many new lines.
This commit is contained in:
Jalil David Salamé Messina 2024-07-03 23:58:26 +02:00
parent 711c1aa81d
commit 91284a73ca
Signed by: jalil
GPG key ID: F016B9E770737A0B
28 changed files with 800 additions and 742 deletions

View file

@ -1,13 +1,12 @@
{
pkgs,
lib,
}: let
{ pkgs, lib }:
let
# can be removed once https://github.com/rust-lang/mdBook/pull/2262 lands
highlight = pkgs.fetchurl {
url = "https://raw.githubusercontent.com/rust-lang/mdBook/7b9bd5049ce15ae5f301d5a40c50ce8359d9e9a8/src/theme/highlight.js";
hash = "sha256-pLP73zlmGkbC/zV6bwnB6ijRf9gVkj5/VYMGLhiQ1/Q=";
};
filterVisible = toplevelOption: option:
filterVisible =
toplevelOption: option:
option // { visible = option.visible && builtins.elemAt option.loc 0 == toplevelOption; };
home-eval = lib.evalModules {
modules = [ ../home/options.nix ];
@ -21,21 +20,19 @@
(pkgs.nixosOptionsDoc {
inherit (home-eval) options;
transformOptions = filterVisible "jhome";
})
.optionsCommonMark;
}).optionsCommonMark;
nvim-markdown =
(pkgs.nixosOptionsDoc {
inherit (nvim-eval) options;
transformOptions = filterVisible "jhome";
})
.optionsCommonMark;
}).optionsCommonMark;
nixos-markdown =
(pkgs.nixosOptionsDoc {
inherit (nixos-eval) options;
transformOptions = filterVisible "jconfig";
})
.optionsCommonMark;
in {
}).optionsCommonMark;
in
{
inherit nixos-markdown nvim-markdown home-markdown;
docs = pkgs.stdenvNoCC.mkDerivation {
name = "nixos-configuration-book";

View file

@ -63,7 +63,8 @@
};
# Flake outputs that other flakes can use
outputs = {
outputs =
{
self,
nixpkgs,
unstable,
@ -75,14 +76,16 @@
nixvim,
lix-module,
...
}: let
}:
let
inherit (nixpkgs) lib;
# Helpers for producing system-specific outputs
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
];
forEachSupportedSystem = f:
forEachSupportedSystem =
f:
nixpkgs.lib.genAttrs supportedSystems (
system:
f {
@ -91,23 +94,24 @@
}
);
overlays = builtins.attrValues self.overlays;
in {
checks = forEachSupportedSystem (
in
{
pkgs,
system,
}: let
checks = forEachSupportedSystem (
{ pkgs, system }:
let
src = builtins.path {
path = ./.;
name = "configuration.nix";
};
runCmdInSrc = name: cmd:
runCmdInSrc =
name: cmd:
pkgs.runCommandNoCC name { } ''
cd ${src}
${cmd}
mkdir $out
'';
in {
in
{
nvim = nixvim.lib.${system}.check.mkTestDerivationFromNixvimModule {
pkgs = import nixpkgs { inherit system overlays; };
module = ./nvim/standalone.nix;
@ -119,12 +123,9 @@
);
packages = forEachSupportedSystem (
{ pkgs, system }:
{
pkgs,
system,
}: {
inherit
(import ./docs {inherit pkgs lib;})
inherit (import ./docs { inherit pkgs lib; })
docs
nixos-markdown
nvim-markdown
@ -143,16 +144,18 @@
nixvim = nixvim.overlays.default;
jpassmenu = jpassmenu.overlays.default;
audiomenu = audiomenu.overlays.default;
unstable = final: prev: let
unstable =
final: prev:
let
unstablePkgs = unstable.legacyPackages.${prev.system};
in {
in
{
# Get unstable packages
unstable = unstablePkgs;
# Update vim plugins with the versions from unstable
vimPlugins = prev.vimPlugins // unstablePkgs.vimPlugins;
# Get specific packages from unstable
inherit
(unstablePkgs)
inherit (unstablePkgs)
gitoxide
jujutsu
wezterm
@ -162,10 +165,11 @@
};
# Nix files formatter (run `nix fmt`)
formatter = forEachSupportedSystem ({pkgs, ...}: pkgs.alejandra);
formatter = forEachSupportedSystem ({ pkgs, ... }: pkgs.nixfmt-rfc-style);
# Example vm configuration
nixosConfigurations.vm = let
nixosConfigurations.vm =
let
system = "x86_64-linux";
config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "steam-original" ];
pkgs = import nixpkgs { inherit system overlays config; };
@ -206,7 +210,8 @@
];
};
nixosModules = let
nixosModules =
let
nvim-config.imports = [
nixvim.homeManagerModules.nixvim
./nvim
@ -214,12 +219,10 @@
homeManagerModuleSandalone = import ./home { inherit nvim-config stylix; };
homeManagerModuleNixOS = import ./home { inherit nvim-config; };
nixosModule = {
imports =
[
imports = [
(import ./system { inherit stylix; })
home-manager.nixosModules.home-manager
]
++ nixpkgs.lib.optional (lix-module != null) lix-module.nixosModules.default;
] ++ nixpkgs.lib.optional (lix-module != null) lix-module.nixosModules.default;
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
@ -251,10 +254,8 @@
// machineModules;
devShells = forEachSupportedSystem (
{ pkgs, system }:
{
pkgs,
system,
}: {
default = pkgs.mkShell {
buildInputs = [
pkgs.just

View file

@ -1,15 +1,18 @@
{
nvim-config,
stylix ? null,
}: {
}:
{
config,
pkgs,
lib,
...
}: let
}:
let
cfg = config.jhome;
devcfg = cfg.dev;
in {
in
{
imports =
[
nvim-config
@ -81,10 +84,7 @@ in {
gpg-agent = {
enable = true;
maxCacheTtl = 86400;
pinentryPackage =
if config.jhome.gui.enable
then pkgs.pinentry-qt
else pkgs.pinentry-curses;
pinentryPackage = if config.jhome.gui.enable then pkgs.pinentry-qt else pkgs.pinentry-curses;
extraConfig = "allow-preset-passphrase";
};
# Spotifyd

View file

@ -4,17 +4,12 @@
pkgs,
osConfig ? null,
...
}: let
}:
let
inherit (config) jhome;
flatpakEnabled =
if osConfig != null
then osConfig.services.flatpak.enable
else false;
flatpakEnabled = if osConfig != null then osConfig.services.flatpak.enable else false;
osSway = osConfig == null && !osConfig.programs.sway.enable;
swayPkg =
if osSway
then pkgs.sway
else null;
swayPkg = if osSway then pkgs.sway else null;
cfg = jhome.gui;
cursor = {
package = pkgs.nordzy-cursor-theme;
@ -24,9 +19,11 @@
name = "Papirus-Dark";
package = pkgs.papirus-icon-theme;
};
in {
in
{
config = lib.mkIf (jhome.enable && cfg.enable) {
home.packages = with pkgs;
home.packages =
with pkgs;
[
webcord
ferdium
@ -43,9 +40,18 @@ in {
enable = true;
defaultFonts = lib.mkIf config.jhome.styling.enable {
emoji = [ "Noto Color Emoji" ];
monospace = ["JetBrains Mono" "Symbols Nerd Font"];
serif = ["Noto Serif" "Symbols Nerd Font"];
sansSerif = ["Noto Sans" "Symbols Nerd Font"];
monospace = [
"JetBrains Mono"
"Symbols Nerd Font"
];
serif = [
"Noto Serif"
"Symbols Nerd Font"
];
sansSerif = [
"Noto Sans"
"Symbols Nerd Font"
];
};
};
# Browser
@ -69,7 +75,9 @@ in {
waybar = {
enable = true;
systemd.enable = true;
settings = lib.mkIf config.jhome.styling.enable (import ./waybar-settings.nix {inherit config lib;});
settings = lib.mkIf config.jhome.styling.enable (
import ./waybar-settings.nix { inherit config lib; }
);
style = lib.optionalString config.jhome.styling.enable ''
.modules-left #workspaces button {
border-bottom: 3px solid @base01;
@ -135,10 +143,12 @@ in {
# Set cursor style
stylix = lib.mkIf config.jhome.styling.enable { inherit cursor; };
home.pointerCursor = lib.mkIf config.jhome.styling.enable (lib.mkDefault {
home.pointerCursor = lib.mkIf config.jhome.styling.enable (
lib.mkDefault {
gtk.enable = true;
inherit (cursor) name package;
});
}
);
# Set Gtk theme
gtk = lib.mkIf config.jhome.styling.enable {
enable = true;

View file

@ -1,7 +1,5 @@
{
pkgs,
config,
}: let
{ pkgs, config }:
let
cfg = config.jhome.gui.sway;
passmenu = "${pkgs.jpassmenu}/bin/jpassmenu";
selectAudio = "${pkgs.audiomenu}/bin/audiomenu --menu 'fuzzel --dmenu'";
@ -54,9 +52,12 @@
dir2resize.left = "resize shrink width";
# Bind a key combo to an action
genKeybind = prefix: action: key: { "${prefix key}" = "${action key}"; };
genKey = prefix: action: genKeybind ({key, ...}: prefix key) ({direction, ...}: action direction);
genArrow = prefix: action: genKeybind ({arrow, ...}: prefix arrow) ({direction, ...}: action direction);
genArrowAndKey = prefix: action: key:
genKey =
prefix: action: genKeybind ({ key, ... }: prefix key) ({ direction, ... }: action direction);
genArrow =
prefix: action: genKeybind ({ arrow, ... }: prefix arrow) ({ direction, ... }: action direction);
genArrowAndKey =
prefix: action: key:
(genKey prefix action key) // (genArrow prefix action key);
# Move window
moveWindowKeybinds = map (genArrowAndKey modShiftKeybind (dir: "move ${dir}")) dirs;
@ -65,23 +66,17 @@
# Resize window
resizeWindowKeybinds = map (genArrowAndKey modCtrlKeybind (dir: dir2resize.${dir})) dirs;
# Move container to workspace
moveWorkspaceKeybindings =
map (genKeybind modShiftKeybind (
moveWorkspaceKeybindings = map (genKeybind modShiftKeybind (
number: "move container to workspace number ${number}"
))
workspaces;
)) workspaces;
# Focus workspace
focusWorkspaceKeybindings =
map (genKeybind modKeybind (
focusWorkspaceKeybindings = map (genKeybind modKeybind (
number: "workspace number ${number}"
))
workspaces;
)) workspaces;
# Move container to Workspace and focus on it
moveFocusWorkspaceKeybindings =
map (genKeybind modCtrlShiftKeybind (
moveFocusWorkspaceKeybindings = map (genKeybind modCtrlShiftKeybind (
number: "move container to workspace number ${number}; workspace number ${number}"
))
workspaces;
)) workspaces;
in
builtins.foldl' (l: r: l // r)
{

View file

@ -1,16 +1,15 @@
{
config,
pkgs,
}: let
{ config, pkgs }:
let
cfg = config.jhome.gui.sway;
modifier = "Mod4";
inherit (config.jhome.gui) terminal;
termCmd =
if terminal == "wezterm"
then "wezterm start"
else if terminal == "alacritty"
then "alacritty -e"
else builtins.abort "no command configured for ${terminal}";
if terminal == "wezterm" then
"wezterm start"
else if terminal == "alacritty" then
"alacritty -e"
else
builtins.abort "no command configured for ${terminal}";
menu = "${pkgs.fuzzel}/bin/fuzzel --terminal '${termCmd}'";
# currently, there is some friction between sway and gtk:
# https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland
@ -18,7 +17,8 @@
# for gsettings to work, we need to tell it where the schemas are
# using the XDG_DATA_DIR environment variable
# run at the end of sway config
configure-gtk = let
configure-gtk =
let
schema = pkgs.gsettings-desktop-schemas;
datadir = "${schema}/share/gsettings-schemas/${schema.name}";
in
@ -43,7 +43,8 @@
inherit command;
always = true;
};
in {
in
{
inherit modifier terminal menu;
keybindings = import ./keybindings.nix { inherit config pkgs; };
# Appearance
@ -72,12 +73,9 @@ in {
}
];
# Startup scripts
startup =
[
startup = [
(cmdAlways "${configure-gtk}/bin/configure-gtk")
]
++ (builtins.map cmdAlways cfg.exec.always)
++ (builtins.map cmdOnce cfg.exec.once);
] ++ (builtins.map cmdAlways cfg.exec.always) ++ (builtins.map cmdOnce cfg.exec.once);
# Keyboard configuration
input."type:keyboard" = {
repeat_delay = "300";

View file

@ -1,9 +1,8 @@
{
config,
lib,
}: let
{ config, lib }:
let
cfg = config.jhome.gui;
in {
in
{
mainBar = {
layer = "top";
position = "top";
@ -11,16 +10,13 @@ in {
# Choose the order of the modules
modules-left = [ "sway/workspaces" ];
modules-center = [ "clock" ];
modules-right =
[
modules-right = [
"pulseaudio"
"backlight"
"battery"
"sway/language"
"memory"
]
++ lib.optional (cfg.tempInfo != null) "temperature"
++ ["tray"];
] ++ lib.optional (cfg.tempInfo != null) "temperature" ++ [ "tray" ];
"sway/workspaces" = {
disable-scroll = true;
persistent-workspaces = {
@ -64,7 +60,11 @@ in {
phone = "󰘂";
portable = "";
car = "";
default = ["󰕿" "󰖀" "󰕾"];
default = [
"󰕿"
"󰖀"
"󰕾"
];
};
on-click = "pavucontrol";
min-length = 13;
@ -73,13 +73,27 @@ in {
inherit (cfg.tempInfo) hwmon-path;
critical-threshold = 80;
format = "{temperatureC}°C {icon}";
format-icons = ["" "" "" "" ""];
format-icons = [
""
""
""
""
""
];
tooltip = false;
};
backlight = {
device = "intel_backlight";
format = "{percent}% {icon}";
format-icons = ["󰃚" "󰃛" "󰃜" "󰃝" "󰃞" "󰃟" "󰃠"];
format-icons = [
"󰃚"
"󰃛"
"󰃜"
"󰃝"
"󰃞"
"󰃟"
"󰃠"
];
min-length = 7;
};
battery = {
@ -89,7 +103,18 @@ in {
format-charging = "{capacity}% 󰂄";
format-plugged = "{capacity}% 󰚥";
format-alt = "{time} {icon}";
format-icons = ["󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹"];
format-icons = [
"󰁺"
"󰁻"
"󰁼"
"󰁽"
"󰁾"
"󰁿"
"󰂀"
"󰂁"
"󰂂"
"󰁹"
];
};
tray = {
icon-size = 16;

View file

@ -1,28 +1,22 @@
{
lib,
pkgs,
...
} @ attrs: let
{ lib, pkgs, ... }@attrs:
let
osConfig = attrs.osConfig or null;
inherit (lib) types;
fromOs = let
get = path: set:
if path == []
then set
else get (builtins.tail path) (builtins.getAttr (builtins.head path) set);
fromOs =
let
get =
path: set:
if path == [ ] then set else get (builtins.tail path) (builtins.getAttr (builtins.head path) set);
in
path: default:
if osConfig == null
then default
else get path osConfig;
path: default: if osConfig == null then default else get path osConfig;
fromConfig = path: default: fromOs ([ "jconfig" ] ++ path) default;
mkExtraPackagesOption = name: defaultPkgsPath: let
text =
lib.strings.concatMapStringsSep " " (
mkExtraPackagesOption =
name: defaultPkgsPath:
let
text = lib.strings.concatMapStringsSep " " (
pkgPath: "pkgs." + (lib.strings.concatStringsSep "." pkgPath)
)
defaultPkgsPath;
) defaultPkgsPath;
defaultText = lib.literalExpression "[ ${text} ]";
default = builtins.map (pkgPath: lib.attrsets.getAttrFromPath pkgPath pkgs) defaultPkgsPath;
in
@ -85,14 +79,27 @@
};
sway.options = {
enable = lib.mkEnableOption "sway" // {default = fromConfig ["gui" "sway"] true;};
enable = lib.mkEnableOption "sway" // {
default = fromConfig [
"gui"
"sway"
] true;
};
background = lib.mkOption {
description = "The wallpaper to use.";
type = types.path;
default = fromConfig ["styling" "wallpaper"] (builtins.fetchurl {
default =
fromConfig
[
"styling"
"wallpaper"
]
(
builtins.fetchurl {
url = "https://raw.githubusercontent.com/lunik1/nixos-logo-gruvbox-wallpaper/d4937c424fad79c1136a904599ba689fcf8d0fad/png/gruvbox-dark-rainbow.png";
sha256 = "036gqhbf6s5ddgvfbgn6iqbzgizssyf7820m5815b2gd748jw8zc";
});
}
);
};
autostart = lib.mkOption {
description = ''
@ -130,7 +137,12 @@
};
gui.options = {
enable = lib.mkEnableOption "GUI applications" // {default = fromConfig ["gui" "enable"] false;};
enable = lib.mkEnableOption "GUI applications" // {
default = fromConfig [
"gui"
"enable"
] false;
};
tempInfo = lib.mkOption {
description = "Temperature info to display in the statusbar.";
default = null;
@ -151,7 +163,8 @@
];
};
};
in {
in
{
options.jhome = lib.mkOption {
description = "Jalil's default home-manager configuration.";
default = { };
@ -161,7 +174,10 @@ in {
hostName = lib.mkOption {
description = "The hostname of this system.";
type = types.str;
default = fromOs ["networking" "hostName"] "nixos";
default = fromOs [
"networking"
"hostName"
] "nixos";
example = "my pc";
};
dev = lib.mkOption {
@ -169,7 +185,12 @@ in {
default = { };
type = types.submodule {
options = {
enable = lib.mkEnableOption "development settings" // {default = fromConfig ["dev" "enable"] false;};
enable = lib.mkEnableOption "development settings" // {
default = fromConfig [
"dev"
"enable"
] false;
};
neovimAsManPager = lib.mkEnableOption "neovim as the man pager";
extraPackages = mkExtraPackagesOption "dev" [
[ "jq" ] # json parser
@ -214,7 +235,12 @@ in {
default = { };
type = types.submodule {
options = {
enable = lib.mkEnableOption "styling" // {default = fromConfig ["styling" "enable"] true;};
enable = lib.mkEnableOption "styling" // {
default = fromConfig [
"styling"
"enable"
] true;
};
};
};
};

View file

@ -1,8 +1,5 @@
{
config,
lib,
...
}: let
{ config, lib, ... }:
let
inherit (config) jhome;
inherit (cfg.defaultIdentity) signingKey;
@ -11,7 +8,8 @@
hasKey = signingKey != null;
gpgHome = config.programs.gpg.homedir;
unlockKey = hasConfig && cfg.gpg.unlockKeys != [ ];
in {
in
{
config = lib.mkMerge [
(lib.mkIf hasConfig {
programs.git = {

View file

@ -1,4 +1,5 @@
{nixos-hardware}: {
{ nixos-hardware }:
{
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix

View file

@ -6,7 +6,8 @@
lib,
modulesPath,
...
}: {
}:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot = {
initrd = {

View file

@ -1,7 +1,9 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{nixos-hardware}: {pkgs, ...}: {
{ nixos-hardware }:
{ pkgs, ... }:
{
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix

View file

@ -6,7 +6,8 @@
lib,
modulesPath,
...
}: {
}:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot = {
initrd = {

View file

@ -1,7 +1,9 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{nixos-hardware}: {pkgs, ...}: {
{ nixos-hardware }:
{ pkgs, ... }:
{
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix

View file

@ -7,7 +7,8 @@
pkgs,
modulesPath,
...
}: {
}:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot = {
initrd = {

View file

@ -1,6 +1,8 @@
{helpers, ...}: let
{ helpers, ... }:
let
inherit (helpers) mkRaw;
in {
in
{
config = {
autoGroups = {
"highlightOnYank" = { };
@ -14,9 +16,7 @@ in {
pattern = "*";
callback =
mkRaw
/*
lua
*/
# lua
''
function()
vim.highlight.on_yank {
@ -34,9 +34,7 @@ in {
pattern = "*";
callback =
mkRaw
/*
lua
*/
# lua
''
function()
if vim.fn.line '\'"' > 0 and vim.fn.line '\'"' <= vim.fn.line '$' then
@ -49,13 +47,12 @@ in {
group = "lspConfig";
event = "LspAttach";
pattern = "*";
callback = let
callback =
let
opts = "noremap = true, buffer = bufnr";
in
mkRaw
/*
lua
*/
# lua
''
function(opts)
local bufnr = opts.buf

View file

@ -1,10 +1,8 @@
{
lib,
config,
...
}: let
{ lib, config, ... }:
let
cfg = config.jhome.nvim;
in {
in
{
imports = [ ./options.nix ];
config.programs.nixvim = lib.mkMerge [

View file

@ -1,4 +1,5 @@
{pkgs}: {
{ pkgs }:
{
vim-jjdescription = pkgs.callPackage ./vim-jjdescription.nix { };
nvim-silicon = pkgs.callPackage ./nvim-silicon.nix { };
}

View file

@ -1,7 +1,4 @@
{
vimUtils,
fetchFromGitHub,
}:
{ vimUtils, fetchFromGitHub }:
vimUtils.buildVimPlugin {
name = "nvim-silicon";
src = fetchFromGitHub {

View file

@ -1,7 +1,4 @@
{
vimUtils,
fetchFromGitHub,
}:
{ vimUtils, fetchFromGitHub }:
vimUtils.buildVimPlugin {
name = "jjdescription";
src = fetchFromGitHub {

View file

@ -1,6 +1,8 @@
{helpers, ...}: let
{ helpers, ... }:
let
inherit (helpers) mkRaw;
in {
in
{
config.keymaps = [
# Quickfix
{

View file

@ -1,7 +1,6 @@
{lib, ...}: {
options.jhome.nvim.enable =
lib.mkEnableOption "jalil's neovim configuration"
// {
{ lib, ... }:
{
options.jhome.nvim.enable = lib.mkEnableOption "jalil's neovim configuration" // {
default = true;
example = false;
};

View file

@ -3,9 +3,11 @@
pkgs,
helpers,
...
}: let
}:
let
inherit (helpers) mkRaw;
in {
in
{
config.plugins = {
bacon = {
enable = true;
@ -17,9 +19,7 @@ in {
"/" = {
mapping =
mkRaw
/*
lua
*/
# lua
''
cmp.mapping.preset.cmdline()
'';
@ -31,9 +31,7 @@ in {
":" = {
mapping =
mkRaw
/*
lua
*/
# lua
''
cmp.mapping.preset.cmdline()
'';
@ -46,9 +44,7 @@ in {
settings = {
# Snippets
snippet.expand =
/*
lua
*/
# lua
''
function(args) require('luasnip').lsp_expand(args.body) end
'';
@ -105,9 +101,7 @@ in {
];
mapping =
mkRaw
/*
lua
*/
# lua
''
cmp.mapping.preset.insert({
["<C-n>"] = function(fallback)
@ -167,7 +161,10 @@ in {
enable = true;
lintersByFt = {
rust = [ "typos" ];
latex = ["chktex" "typos"];
latex = [
"chktex"
"typos"
];
markdown = [ "typos" ];
nix = [ "statix" ];
sh = [ "dash" ];

View file

@ -1,5 +1,11 @@
{pkgs, ...}: {
imports = [./options.nix ./plugins.nix ./mappings.nix ./augroups.nix];
{ pkgs, ... }:
{
imports = [
./options.nix
./plugins.nix
./mappings.nix
./augroups.nix
];
config = {
globals.mapleader = " ";
@ -34,10 +40,12 @@
# Enable local configuration :h 'exrc'
exrc = true; # safe since nvim 0.9
};
extraPlugins = let
extraPlugins =
let
plugins = pkgs.unstable.vimPlugins;
extraPlugins = import ./extraPlugins { pkgs = pkgs.unstable; };
in [
in
[
plugins.nui-nvim
plugins.nvim-web-devicons
extraPlugins.vim-jjdescription

View file

@ -1,12 +1,13 @@
{stylix}: {
{ stylix }:
{
config,
pkgs,
lib,
...
}: let
}:
let
cfg = config.jconfig;
keysFromGithub =
lib.attrsets.mapAttrs' (username: sha256: {
keysFromGithub = lib.attrsets.mapAttrs' (username: sha256: {
name = "pubkeys/${username}";
value = {
mode = "0755";
@ -15,9 +16,9 @@
url = "https://github.com/${username}.keys";
};
};
})
cfg.importSSHKeysFromGithub;
in {
}) cfg.importSSHKeysFromGithub;
in
{
imports = [
./options.nix
./gui

View file

@ -3,20 +3,20 @@
lib,
pkgs,
...
}: let
}:
let
cfg = config.jconfig.gui;
enable = config.jconfig.enable && cfg.enable;
in {
in
{
config = lib.mkMerge [
(lib.mkIf enable {
environment.systemPackages =
[
environment.systemPackages = [
pkgs.gnome.adwaita-icon-theme
pkgs.adwaita-qt
pkgs.nordzy-cursor-theme
pkgs.pinentry-qt
]
++ lib.optional cfg.ydotool.enable pkgs.ydotool;
] ++ lib.optional cfg.ydotool.enable pkgs.ydotool;
systemd = {
user.services.ydotool = lib.mkIf cfg.ydotool.enable {
enable = cfg.ydotool.autoStart;

View file

@ -1,13 +1,16 @@
{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 = {
mkImageOption =
{
description,
url,
sha256 ? "",
@ -90,7 +93,8 @@
type = types.attrsOf types.str;
};
};
in {
in
{
options.jconfig = lib.mkOption {
description = "Jalil's default NixOS configuration.";
default = { };

View file

@ -1,9 +1,8 @@
{
config,
pkgs,
}: let
{ config, pkgs }:
let
cfg = config.jconfig.styling;
in {
in
{
inherit (cfg) enable;
image = cfg.wallpaper;
base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-hard.yaml";