mirror of
https://github.com/moons-14/dotfiles.git
synced 2026-10-06 03:08:11 +09:00
nix flake
This commit is contained in:
+14
@@ -1 +1,15 @@
|
||||
/*
|
||||
|
||||
!.gitignore
|
||||
!README.md
|
||||
!LICENSE
|
||||
!AGENTS.md
|
||||
|
||||
!.envrc
|
||||
|
||||
!/flake.nix
|
||||
!/flake.lock
|
||||
|
||||
!shells/
|
||||
|
||||
!/flake/
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
# AGENTS.md
|
||||
|
||||
NixOS + Home Manager flake。v2 リセット中 — flake-parts 導入済み、outputs はまだスケルトンのみ。
|
||||
|
||||
## Commands
|
||||
|
||||
```sh
|
||||
# flake の更新
|
||||
nix flake update
|
||||
|
||||
# フォーマット
|
||||
nix fmt
|
||||
```
|
||||
|
||||
## Conventions
|
||||
|
||||
- User: `moons`, locale: `ja_JP.UTF-8`, timezone: `Asia/Tokyo`
|
||||
- Commits: conventional commits (`feat:`, `chore:`, `fix:`, etc.)
|
||||
- リモート: `[email protected]:moons-14/dotfiles.git`
|
||||
Generated
+1285
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,89 @@
|
||||
{
|
||||
description = "moons NixOS configurations";
|
||||
|
||||
inputs = {
|
||||
# NixOS
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
|
||||
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
# Hardware / Platform
|
||||
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
|
||||
nixos-wsl.url = "github:nix-community/NixOS-WSL";
|
||||
|
||||
# Desktop
|
||||
niri-flake.url = "github:sodiboo/niri-flake";
|
||||
|
||||
stylix = {
|
||||
url = "github:nix-community/stylix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
# Terminal
|
||||
ghostty.url = "github:ghostty-org/ghostty";
|
||||
|
||||
# Shell / Launcher
|
||||
vicinae.url = "github:vicinaehq/vicinae";
|
||||
|
||||
vicinae-extensions = {
|
||||
url = "github:vicinaehq/extensions";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
quickshell = {
|
||||
url = "github:outfoxxed/quickshell";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
noctalia = {
|
||||
url = "github:noctalia-dev/noctalia-shell";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.quickshell.follows = "quickshell";
|
||||
};
|
||||
|
||||
# Editor
|
||||
nixvim = {
|
||||
url = "github:nix-community/nixvim";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
# Boot
|
||||
lanzaboote = {
|
||||
url = "github:nix-community/lanzaboote";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
# Flake framework
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
|
||||
# Code formatting and git hooks
|
||||
treefmt-nix.url = "github:numtide/treefmt-nix";
|
||||
git-hooks-nix.url = "github:cachix/git-hooks.nix";
|
||||
|
||||
# Dev services
|
||||
services-flake.url = "github:juspay/services-flake";
|
||||
|
||||
# Systems
|
||||
systems.url = "github:nix-systems/default-linux";
|
||||
};
|
||||
|
||||
outputs =
|
||||
inputs@{
|
||||
flake-parts,
|
||||
systems,
|
||||
...
|
||||
}:
|
||||
flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
systems = import systems;
|
||||
|
||||
imports = [
|
||||
./flake/formatter.nix
|
||||
./flake/git-hooks.nix
|
||||
./shells
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
{ inputs, ... }:
|
||||
{
|
||||
imports = [
|
||||
inputs.treefmt-nix.flakeModule
|
||||
];
|
||||
|
||||
perSystem = _: {
|
||||
treefmt = {
|
||||
projectRootFile = "flake.nix";
|
||||
|
||||
programs = {
|
||||
nixfmt.enable = true;
|
||||
deadnix.enable = true;
|
||||
statix.enable = true;
|
||||
|
||||
shfmt.enable = true;
|
||||
shellcheck.enable = true;
|
||||
|
||||
prettier.enable = true;
|
||||
yamlfmt.enable = true;
|
||||
taplo.enable = true;
|
||||
oxfmt.enable = true;
|
||||
};
|
||||
|
||||
settings = {
|
||||
excludes = [
|
||||
".git/**"
|
||||
"*.lock"
|
||||
".direnv/**"
|
||||
"*.age"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
{ inputs, ... }:
|
||||
{
|
||||
imports = [
|
||||
inputs.git-hooks-nix.flakeModule
|
||||
];
|
||||
|
||||
perSystem =
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
pre-commit.settings = {
|
||||
hooks = {
|
||||
treefmt = {
|
||||
enable = true;
|
||||
|
||||
package = config.treefmt.build.wrapper;
|
||||
};
|
||||
|
||||
gitleaks = {
|
||||
enable = true;
|
||||
name = "gitleaks";
|
||||
description = "Detect hardcoded secrets";
|
||||
|
||||
entry = "${pkgs.gitleaks}/bin/gitleaks dir --no-banner --redact --verbose .";
|
||||
|
||||
pass_filenames = false;
|
||||
|
||||
stages = [
|
||||
"pre-commit"
|
||||
"pre-push"
|
||||
];
|
||||
};
|
||||
|
||||
deadnix.enable = true;
|
||||
statix.enable = true;
|
||||
shellcheck.enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
imports = [
|
||||
./dotnix.nix
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
_: {
|
||||
perSystem =
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
devShells.dotnix = pkgs.mkShell {
|
||||
packages = [
|
||||
config.treefmt.build.wrapper
|
||||
pkgs.gitleaks
|
||||
pkgs.git
|
||||
pkgs.pre-commit
|
||||
];
|
||||
|
||||
shellHook = config.pre-commit.settings.shellHook;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user