style: nix format

This commit is contained in:
Poby 2026-03-14 01:25:38 +09:00
parent 7ceb157457
commit 26b1412b82
No known key found for this signature in database
19 changed files with 108 additions and 92 deletions

View file

@ -1,6 +1,6 @@
# just is a command runner, Justfile is very similar to Makefile, but simpler. # just is a command runner, Justfile is very similar to Makefile, but simpler.
# TODO update hostname here! # FIXME update hostname here!
hostname := "fenrir" hostname := "fenrir"
# List all the just commands # List all the just commands

View file

@ -42,14 +42,15 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
# agenix for secrets # TODO: agenix for secrets
agenix = { agenix = {
url = "github:ryantm/agenix"; url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs-darwin"; inputs.nixpkgs.follows = "nixpkgs-darwin";
}; };
}; };
outputs = inputs @ { outputs =
inputs@{
self, self,
nixpkgs, nixpkgs,
darwin, darwin,
@ -60,18 +61,18 @@
homebrew-core, homebrew-core,
homebrew-cask, homebrew-cask,
... ...
}: let }:
let
system = "aarch64-darwin"; system = "aarch64-darwin";
username = "poby"; username = "poby";
useremail = "smg981024@gmail.com"; useremail = "smg981024@gmail.com";
hostname = "fenrir"; # TODO break down to multiple hosts hostname = "fenrir"; # TODO break down to multiple hosts
specialArgs = specialArgs = inputs // {
inputs
// {
inherit username useremail hostname; inherit username useremail hostname;
}; };
in { in
{
darwinConfigurations."${hostname}" = darwin.lib.darwinSystem { darwinConfigurations."${hostname}" = darwin.lib.darwinSystem {
inherit system specialArgs; inherit system specialArgs;
modules = [ modules = [
@ -92,9 +93,12 @@
mutableTaps = false; mutableTaps = false;
}; };
} }
({config, ...}: { (
{ config, ... }:
{
homebrew.taps = builtins.attrNames config.nix-homebrew.taps; homebrew.taps = builtins.attrNames config.nix-homebrew.taps;
}) }
)
agenix.darwinModules.default agenix.darwinModules.default
home-manager.darwinModules.home-manager home-manager.darwinModules.home-manager
{ {

View file

@ -21,11 +21,15 @@
./terminal.nix ./terminal.nix
./bat.nix ./bat.nix
./aerospace.nix ./aerospace.nix
# TODO ./browser.nix
# TODO ./pass.nix # TODO ./pass.nix
# TODO ./claude-code.nix
# TODO ./codex.nix
# TODO ./gemini-cli.nix
]; ];
home = { home = {
username = username; inherit username;
homeDirectory = "/Users/${username}"; homeDirectory = "/Users/${username}";
stateVersion = "25.11"; stateVersion = "25.11";

View file

@ -1,8 +1,9 @@
{lib, ...}: [ { lib, ... }:
[
# autocmds # autocmds
{ {
enable = true; enable = true;
event = ["BufReadPost"]; event = [ "BufReadPost" ];
desc = "Return to last cursor position"; desc = "Return to last cursor position";
group = "LastCursorGroup"; group = "LastCursorGroup";
callback = lib.generators.mkLuaInline '' callback = lib.generators.mkLuaInline ''
@ -17,10 +18,10 @@
} }
{ {
enable = true; enable = true;
event = ["TextYankPost"]; event = [ "TextYankPost" ];
desc = "Highlight yanks on copy"; desc = "Highlight yanks on copy";
group = "HighlightYank"; group = "HighlightYank";
pattern = ["*"]; pattern = [ "*" ];
callback = lib.generators.mkLuaInline '' callback = lib.generators.mkLuaInline ''
function() function()
vim.hl.on_yank({ vim.hl.on_yank({

View file

@ -1,6 +1,7 @@
{lib, ...}: let { lib, ... }:
let
options = import ./core/options.nix; options = import ./core/options.nix;
autocmds = import ./core/autocmds.nix {inherit lib;}; autocmds = import ./core/autocmds.nix { inherit lib; };
augroups = import ./core/augroups.nix; augroups = import ./core/augroups.nix;
keymaps = import ./core/keymaps.nix; keymaps = import ./core/keymaps.nix;
fzf-lua = import ./plugins/fzf-lua.nix; fzf-lua = import ./plugins/fzf-lua.nix;
@ -13,7 +14,8 @@
treesitter = import ./lsp/treesitter.nix; treesitter = import ./lsp/treesitter.nix;
autocomplete = import ./lsp/autocomplete.nix; autocomplete = import ./lsp/autocomplete.nix;
languages = import ./lsp/languages; languages = import ./lsp/languages;
in { in
{
programs.nvf = { programs.nvf = {
enable = true; enable = true;

View file

@ -3,15 +3,15 @@
enable = true; enable = true;
extraDiagnostics = { extraDiagnostics = {
enable = true; enable = true;
types = ["shellcheck"]; types = [ "shellcheck" ];
}; };
format = { format = {
enable = true; enable = true;
type = ["shfmt"]; type = [ "shfmt" ];
}; };
lsp = { lsp = {
enable = true; enable = true;
servers = ["bash-ls"]; servers = [ "bash-ls" ];
}; };
treesitter.enable = true; treesitter.enable = true;
} }

View file

@ -6,7 +6,8 @@ let
markdown = import ./markdown.nix; markdown = import ./markdown.nix;
html = import ./html.nix; html = import ./html.nix;
yaml = import ./yaml.nix; yaml = import ./yaml.nix;
in { in
{
inherit inherit
nix nix
python python

View file

@ -3,7 +3,7 @@
enable = true; enable = true;
extraDiagnostics = { extraDiagnostics = {
enable = true; enable = true;
types = ["htmlhint"]; types = [ "htmlhint" ];
}; };
format = { format = {
enable = true; enable = true;
@ -14,7 +14,7 @@
}; };
lsp = { lsp = {
enable = true; enable = true;
servers = ["superhtml"]; servers = [ "superhtml" ];
}; };
treesitter = { treesitter = {
enable = true; enable = true;

View file

@ -3,15 +3,15 @@
enable = true; enable = true;
extraDiagnostics = { extraDiagnostics = {
enable = true; enable = true;
types = ["luacheck"]; types = [ "luacheck" ];
}; };
format = { format = {
enable = true; enable = true;
type = ["stylua"]; type = [ "stylua" ];
}; };
lsp = { lsp = {
enable = true; enable = true;
servers = ["lua-language-server"]; servers = [ "lua-language-server" ];
}; };
treesitter.enable = true; treesitter.enable = true;
} }

View file

@ -13,7 +13,7 @@
}; };
extraDiagnostics = { extraDiagnostics = {
enable = true; enable = true;
types = ["markdownlint-cli2"]; types = [ "markdownlint-cli2" ];
}; };
format = { format = {
enable = true; enable = true;
@ -24,7 +24,7 @@
}; };
lsp = { lsp = {
enable = true; enable = true;
servers = ["marksman"]; servers = [ "marksman" ];
}; };
treesitter.enable = true; treesitter.enable = true;
} }

View file

@ -17,7 +17,7 @@
}; };
lsp = { lsp = {
enable = true; enable = true;
servers = ["nil"]; servers = [ "nil" ];
}; };
treesitter.enable = true; treesitter.enable = true;
} }

View file

@ -3,11 +3,11 @@
enable = true; enable = true;
format = { format = {
enable = true; enable = true;
type = ["ruff"]; type = [ "ruff" ];
}; };
lsp = { lsp = {
enable = true; enable = true;
servers = ["pyright"]; servers = [ "pyright" ];
}; };
treesitter.enable = true; treesitter.enable = true;
} }

View file

@ -3,7 +3,7 @@
enable = true; enable = true;
lsp = { lsp = {
enable = true; enable = true;
servers = ["yaml-language-server"]; servers = [ "yaml-language-server" ];
}; };
treesitter.enable = true; treesitter.enable = true;
} }

View file

@ -2,5 +2,5 @@
# fzf-lua # fzf-lua
enable = true; enable = true;
profile = "default"; profile = "default";
setupOpts = {}; setupOpts = { };
} }

View file

@ -3,5 +3,6 @@
enable = true; enable = true;
enableZshIntegration = true; enableZshIntegration = true;
enableBashIntegration = true; enableBashIntegration = true;
# TODO wezterm config
}; };
} }

View file

@ -3,6 +3,6 @@
enable = true; enable = true;
enableZshIntegration = true; enableZshIntegration = true;
enableBashIntegration = true; enableBashIntegration = true;
options = ["--cmd j"]; options = [ "--cmd j" ];
}; };
} }

View file

@ -34,9 +34,7 @@
casks = [ casks = [
"batfi" "batfi"
"hammerspoon" "hammerspoon"
# TODO use nixpkgs when possible "shottr" # stable version dmg link not found
# "google-chrome"
"shottr"
]; ];
}; };
} }

View file

@ -2,7 +2,8 @@
username, username,
hostname, hostname,
... ...
}: { }:
{
networking = { networking = {
hostName = hostname; hostName = hostname;
computerName = hostname; computerName = hostname;
@ -14,5 +15,5 @@
description = username; description = username;
}; };
nix.settings.trusted-users = [username]; nix.settings.trusted-users = [ username ];
} }

View file

@ -2,14 +2,18 @@
pkgs, pkgs,
lib, lib,
... ...
}: { }:
{
nix = { nix = {
enable = true; enable = true;
package = pkgs.nix; package = pkgs.nix;
settings = { settings = {
experimental-features = ["nix-command" "flakes"]; experimental-features = [
substituters = ["https://nix-community.cachix.org"]; "nix-command"
"flakes"
];
substituters = [ "https://nix-community.cachix.org" ];
trusted-public-keys = [ trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
]; ];