nix flake

This commit is contained in:
2026-05-28 02:23:20 +09:00
parent 1abb99aa07
commit 39935210d2
9 changed files with 1512 additions and 0 deletions
+2
View File
@@ -0,0 +1,2 @@
# shellcheck shell=bash
use flake .#dotnix
+14
View File
@@ -1 +1,15 @@
/*
!.gitignore
!README.md
!LICENSE
!AGENTS.md
!.envrc
!/flake.nix
!/flake.lock
!shells/
!/flake/
+19
View File
@@ -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
View File
File diff suppressed because it is too large Load Diff
+89
View File
@@ -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
];
};
}
+35
View File
@@ -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"
];
};
};
};
}
+43
View File
@@ -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;
};
};
};
}
+5
View File
@@ -0,0 +1,5 @@
{
imports = [
./dotnix.nix
];
}
+20
View File
@@ -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;
};
};
}