init: firstCommit

This commit is contained in:
Kariya 2026-03-01 01:39:57 +09:00
commit 36c0a5a114
47 changed files with 1553 additions and 0 deletions

7
README.md Normal file
View File

@ -0,0 +1,7 @@
# 🌽❄
```
sudo nixos-rebuild switch --flake .#<host>
nix run .#home-manager -- switch --flake .#<host>
```

154
flake.lock Normal file
View File

@ -0,0 +1,154 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1772218752,
"narHash": "sha256-G8nArvOTZXU8DRvrzAdz3Elcj6kA/vMtvY9mrGLATtA=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "f3a30376bb9eb2f6f61816be7d6ed954b6d2a3b9",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nix-index-database": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1771734689,
"narHash": "sha256-/phvMgr1yutyAMjKnZlxkVplzxHiz60i4rc+gKzpwhg=",
"owner": "Mic92",
"repo": "nix-index-database",
"rev": "8f590b832326ab9699444f3a48240595954a4b10",
"type": "github"
},
"original": {
"owner": "Mic92",
"repo": "nix-index-database",
"type": "github"
}
},
"nixos-hardware": {
"locked": {
"lastModified": 1771969195,
"narHash": "sha256-qwcDBtrRvJbrrnv1lf/pREQi8t2hWZxVAyeMo7/E9sw=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "41c6b421bdc301b2624486e11905c9af7b8ec68e",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixos-hardware",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1771848320,
"narHash": "sha256-0MAd+0mun3K/Ns8JATeHT1sX28faLII5hVLq0L3BdZU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "2fc6539b481e1d2569f25f8799236694180c0993",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1727348695,
"narHash": "sha256-J+PeFKSDV+pHL7ukkfpVzCOO7mBSrrpJ3svwBFABbhI=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "1925c603f17fc89f4c8f6bf6f631a802ad85d784",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"home-manager": "home-manager",
"nix-index-database": "nix-index-database",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs",
"zen-browser": "zen-browser"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"zen-browser": {
"inputs": {
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1761859251,
"narHash": "sha256-+Kxwwlis5m8b69DBQ42wxM0f7sKCa7RRy5ADCMEI1Ss=",
"owner": "xaragon",
"repo": "zen-browser-flake",
"rev": "20dbd219c8238f297d53603b5f0001167a35ce51",
"type": "github"
},
"original": {
"owner": "xaragon",
"repo": "zen-browser-flake",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

40
flake.nix Normal file
View File

@ -0,0 +1,40 @@
{
description = "my config flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
nixos-hardware.url = "github:NixOS/nixos-hardware";
zen-browser.url = "github:xaragon/zen-browser-flake";
nix-index-database.url = "github:Mic92/nix-index-database";
nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
inputs@{
self,
...
}:
{
nixosConfigurations = (import ./hosts inputs).nixos;
homeConfigurations = (import ./hosts inputs).home-manager;
}
// (inputs.flake-utils.lib.eachDefaultSystem (
system:
let
hm = inputs.home-manager.packages.${system}.home-manager;
in
{
packages.home-manager = hm;
apps.home-manager = {
type = "app";
program = "${hm}/bin/home-manager";
};
}
));
}

7
home-manager/blender.nix Normal file
View File

@ -0,0 +1,7 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
blender
];
}

View File

@ -0,0 +1,6 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
code-cursor
];
}

8
home-manager/direnv.nix Normal file
View File

@ -0,0 +1,8 @@
{
programs = {
direnv = {
enable = true;
nix-direnv.enable = true;
};
};
}

5
home-manager/firefox.nix Normal file
View File

@ -0,0 +1,5 @@
{
programs.firefox = {
enable = true;
};
}

View File

@ -0,0 +1,12 @@
{ ... }:
{
programs.fish = {
enable = true;
interactiveShellInit = ''
set -g fish_greeting ""
set -gx SSH_AUTH_SOCK "$XDG_RUNTIME_DIR/ssh-agent"
'';
};
xdg.configFile."fish/functions/fish_prompt.fish".source = ./functions/fish_prompt.fish;
}

View File

@ -0,0 +1,41 @@
function preexec --on-event fish_preexec
set -g _play_command_begin_time (date +%s%3N)
end
function postexec --on-event fish_postexec
set -l _status $status
if test -z $_play_command_begin_time
return
end
set -l code
if test $_status -eq 0
set_color green
set code "✔success:$_status"
else
set_color red
set code "✘error:$_status"
end
set -l took_time
set -l millis (echo (date +%s%3N)"-$_play_command_begin_time" | bc)
if test $millis -ge 10000
set took_time (echo "$millis/1000" | bc)s
else if test $millis -ge 1000
set took_time (echo "scale=2; $millis/1000" | bc)s
else
set took_time "$millis""ms"
end
echo -s -n $code\ (set_color magenta)\ 󱦟$took_time\n
end
function fish_prompt
set now_date (set_color cyan)(date +%H:%M:%S)
set who_n_where (set_color yellow)$USER::(prompt_hostname)
set pwd (prompt_pwd)
set enter_mark (set_color red)''(set_color yellow)''(set_color green)''
echo -e -s -n -- $now_date\ $who_n_where\ (set_color white)\|(set_color yellow)\ $pwd\n$enter_mark\
set_color normal
end

81
home-manager/fnott.nix Normal file
View File

@ -0,0 +1,81 @@
{
config,
lib,
pkgs,
...
}:
{
services.fnott = {
enable = true;
# Home Manager module の仕様)
# https://mipmip.github.io/home-manager-option-search/?query=services.fnott.settings
settings = {
main = {
# --- 配置 / レイヤ ---
anchor = "top-right";
layer = "overlay"; # フルスクリーンでも出したい場合
stacking-order = "bottom-up";
# --- 余白 ---
edge-margin-vertical = 18;
edge-margin-horizontal = 18;
notification-margin = 10;
# --- サイズ ---
# アイコンを大きめにして視認性を上げる(テキストは控えめに)
min-width = 360;
max-width = 520;
max-height = 0; # 制限したいなら 600 など
# --- 見た目(モノトーン / シック)---
# 背景は黒寄り・透明気味、枠線は薄いグレー、文字は白〜グレー
background = "101012dd"; # RGBA 8桁 (rrggbbaa)
border-color = "2a2a2fff";
border-size = 1;
border-radius = 12;
# パディング(カード感)
padding-vertical = 16;
padding-horizontal = 18;
# --- フォント(モダン寄りに)---
title-font = "Inter SemiBold 11";
summary-font = "Inter Medium 10";
body-font = "Inter 10";
title-color = "f2f2f2ff";
summary-color = "d6d6d6ff";
body-color = "b8b8b8ff";
# --- アイコン優位 ---
icon-theme = "Papirus-Dark"; # 未導入なら "hicolor" でもOK
max-icon-size = 64; # デフォルト32 -> 強調
icon = "dialog-information"; # フォールバック(任意)
dpi-aware = false;
};
low = {
default-timeout = 4;
border-color = "232327ff";
};
normal = {
default-timeout = 7;
border-color = "2a2a2fff";
};
critical = {
default-timeout = 0;
border-color = "6a6a6fff";
border-size = 2;
background = "101012f2";
};
};
};
home.packages = with pkgs; [
papirus-icon-theme
];
}

View File

@ -0,0 +1,261 @@
{
pkgs,
lib,
config,
...
}:
let
inherit (lib)
mkOption
recursiveUpdate
types
optionals
;
rosePineHyprcursor = pkgs.callPackage ./rose-pine-hyprcursor.nix { };
defaultInput = {
kb_layout = "us";
kb_variant = "";
kb_model = "";
kb_options = "";
kb_rules = "";
follow_mouse = true;
touchpad = {
natural_scroll = false;
};
natural_scroll = false;
sensitivity = 0.0;
};
wallpaperCommand = config.hare.hyprland.wallpaperCommand;
baseSettings = {
exec-once = [
# "/usr/lib/polkit-kde-authentication-agent-1"
# "dunst"
"swww-daemon"
# "copyq --start-server"
# "wl-paste --type text --watch cliphist store"
# "wl-paste --type image --watch cliphist store"
"eww daemon"
"eww open bar"
"eww open roundedEdge"
];
exec =
optionals (wallpaperCommand != null) [
wallpaperCommand
]
++ [
"dconf write /org/gnome/desktop/interface/gtk-theme 'Adwaita Dark'"
"dconf write /org/gnome/desktop/interface/icon-theme 'Adwaita Dark'"
"dconf write /org/gnome/desktop/interface/document-font-name 'Noto Sans Medium 11'"
"dconf write /org/gnome/desktop/interface/font-name 'Noto Sans Medium 11'"
"dconf write /org/gnome/desktop/interface/monospace-font-name 'Noto Sans Mono Medium 11'"
];
env = [
"XDG_CURRENT_DESKTOP,Hyprland"
"XDG_SESSION_TYPE,wayland"
"XDG_SESSION_DESKTOP,Hyprland"
];
ecosystem.no_update_news = true;
input = defaultInput;
general = {
layout = "dwindle";
allow_tearing = true;
};
dwindle = {
pseudotile = true;
preserve_split = true;
};
misc = {
force_default_wallpaper = false;
disable_hyprland_logo = true;
disable_splash_rendering = true;
};
windowrule = [
"animation windowsIn 0, match:title ^(.*wofi.*)$"
"float on, match:title ^(.*feh.*)$"
"center on, match:title ^(.*feh.*)$"
"float on, match:title ^(Picture.*)$"
"pin on, match:title ^(Picture.*)$"
"immediate on, match:class ^(Terraria)$"
];
workspace = [
"1, monitor:DP-2, default:true"
"r[2-9], monitor:DP-2"
"name:sub, monitor:DP-1, default:true"
];
"$menu" = "uwsm app -- $(tofi-drun)";
"$terminal" = "wezterm";
"$lock" = "hyprlock";
bindm = [
# Window Movement & Resizing
"SUPER, mouse:272, movewindow"
"SUPER, mouse:273, resizewindow"
];
bind = [
# basic
"SUPER, return, exec, $menu"
"SUPER, E, exec, $terminal"
"SUPER, Q, killactive,"
"SUPER, L, exec, $lock"
"SUPER_SHIFT, M, exec, loginctl terminate-user $USER"
# prsc
", Print, exec, hyprshot -m window -m active --clipboard-only"
# Clipboard
"SUPER, C, exec, copyq show"
"SUPER, V, exec, clipman pick -t dmenu"
# Window navigation
"SUPER, F, fullscreen,"
"SUPER, Y, pin"
"SUPER, I, togglefloating,"
"SUPER, O, togglesplit," # dwindle
"SUPER, P, pseudo," # dwindle
# Window focus
"SUPER, mouse_down, cyclenext, next"
"SUPER, mouse_up, cyclenext, prev"
"SUPER, left, movefocus, l"
"SUPER, right, movefocus, r"
"SUPER, up, movefocus, u"
"SUPER, down, movefocus, d"
"SUPER_SHIFT, left, movewindow, l"
"SUPER_SHIFT, right, movewindow, r"
"SUPER_SHIFT, up, movewindow, u"
"SUPER_SHIFT, down, movewindow, d"
# workspaces
"SUPER, 1, workspace, 1"
"SUPER, 2, workspace, 2"
"SUPER, 3, workspace, 3"
"SUPER_CTRL, left, workspace, m-1"
"SUPER_CTRL, right, workspace, m+1"
"SUPER_CTRL_SHIFT, left, workspace, r-1"
"SUPER_CTRL_SHIFT, right, workspace, r+1"
]
++ (
# workspaces
# binds $mod + [shift +] {1..9} to [move to] workspace {1..9}
builtins.concatLists (
builtins.genList (
i:
let
ws = i + 1;
in
[
"SUPER, code:1${toString i}, workspace, ${toString ws}"
"SUPER SHIFT, code:1${toString i}, movetoworkspace, ${toString ws}"
]
) 9
)
);
};
defaultStyle = {
general = {
gaps_in = 4;
gaps_out = 7;
border_size = 3;
"col.active_border" = "rgba(6e848cee) rgba(eeeeffee) 90deg";
"col.inactive_border" = "rgba(595959aa)";
};
decoration = {
rounding = 10;
blur = {
enabled = true;
size = 6;
passes = 2;
noise = 0.01;
contrast = 0.8;
brightness = 0.5;
vibrancy = 0.25;
vibrancy_darkness = 0.1;
};
shadow = {
enabled = false;
range = 4;
render_power = 3;
color = "rgba(1a1a1aee)";
};
dim_inactive = false;
};
animations = {
enabled = true;
animation = [
"windowsIn, 1, 1, default, popin 90%"
"windowsOut, 1, 100, default, popin 80%"
"windowsMove, 1, 3, default"
"border, 1, 10, default"
"borderangle, 1, 8, default"
"fade, 1, 7, default"
"workspaces, 1, 5, default, slidefade 10%"
];
};
};
styleSettings = recursiveUpdate defaultStyle config.hare.hyprland.style;
inputSettings = recursiveUpdate defaultInput config.hare.hyprland.input;
in
{
options.hare.hyprland.style = mkOption {
type = types.attrs;
default = { };
description = "Overlay of Hyprland style tweaks that will be merged on top of the base settings.";
};
options.hare.hyprland.input = mkOption {
type = types.attrs;
default = { };
description = "Overrides for the Hyprland input block (e.g., sensitivity, accel profiles).";
};
options.hare.hyprland.wallpaperCommand = mkOption {
type = types.nullOr types.str;
default = null;
description = "Command to set the wallpaper (e.g., \"swww img <path>\"); appended to Hyprland's exec list when provided.";
};
config = {
wayland.windowManager.hyprland = {
enable = true;
systemd.enable = false;
settings = recursiveUpdate (recursiveUpdate baseSettings styleSettings) {
input = inputSettings;
};
plugins = [
];
};
home.packages = [
rosePineHyprcursor
]
++ (with pkgs; [
swww
eww
hyprshot
]);
home.sessionVariables = {
HYPRCURSOR_THEME = "rose-pine-hyprcursor";
HYPRCURSOR_SIZE = "24";
XCURSOR_SIZE = "24";
GTK_BACKEND = "wayland";
QT_QPA_PLATFORM = "wayland;xcb";
QT_QPA_PLATFORMTHEME = "qt5ct";
};
};
}

View File

@ -0,0 +1,33 @@
{
stdenvNoCC,
lib,
fetchzip,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "rose-pine-hyprcursor";
version = "0.3.2";
src = fetchzip {
url = "https://github.com/ndom91/rose-pine-hyprcursor/archive/refs/tags/v${finalAttrs.version}.tar.gz";
hash = "sha256-ArUX5qlqAXUqcRqHz4QxXy3KgkfasTPA/Qwf6D2kV0U=";
};
dontBuild = true;
installPhase = ''
runHook preInstall
target=$out/share/icons/${finalAttrs.pname}
mkdir -p "$target"
cp -r hyprcursors hyprcursors_uncompressed manifest.hl "$target"
# include docs for reference
cp README.md LICENSE "$target"/
runHook postInstall
'';
meta = with lib; {
description = "Rose Pine themed Hyprcursor set";
homepage = "https://github.com/ndom91/rose-pine-hyprcursor";
license = licenses.mit;
platforms = platforms.linux;
};
})

View File

@ -0,0 +1,43 @@
{ lib }:
{
general = lib.mkForce {
gaps_in = 0;
gaps_out = 0;
border_size = 2;
"col.active_border" = "rgba(6e848cee) rgba(eeeeffee) 90deg";
"col.inactive_border" = "rgba(595959aa)";
layout = "dwindle";
allow_tearing = true;
};
decoration = lib.mkForce {
rounding = 0;
blur = {
enabled = true;
size = 6;
passes = 2;
noise = 0.01;
contrast = 0.8;
brightness = 0.5;
vibrancy = 0.25;
vibrancy_darkness = 0.1;
};
shadow = {
enabled = false;
};
dim_inactive = false;
};
animations = lib.mkForce {
enabled = true;
animation = [
"windowsIn, 1, 1, default, popin 90%"
"windowsOut, 1, 100, default, popin 80%"
"windowsMove, 1, 3, default"
"border, 1, 10, default"
"borderangle, 1, 8, default"
"fade, 1, 7, default"
"workspaces, 1, 5, default, slidefade 10%"
];
};
}

View File

@ -0,0 +1,12 @@
{ config, pkgs, ... }:
{
programs.obs-studio = {
enable = true;
plugins = with pkgs.obs-studio-plugins; [
wlrobs
obs-backgroundremoval
obs-pipewire-audio-capture
obs-shaderfilter
];
};
}

35
home-manager/tofi.nix Normal file
View File

@ -0,0 +1,35 @@
{
programs.tofi.enable = true;
programs.tofi.settings = {
history = true;
text-cursor = true;
text-cursor-style = "underscore";
text-cursor-corner-radius = 0;
auto-accept-single = true;
font = "monospace";
text-color = "#C8C093";
prompt-text = "˙˙ <";
prompt-padding = 20;
prompt-color = "#C8C093";
placeholder-text = "Hello, World!";
placeholder-color = "#49443C";
selection-color = "#76946A";
selection-match-color = "#98BB6C";
num-results = 0;
width = 1280;
height = 720;
result-spacing = 8;
background-color = "#1F1F28";
outline-width = 0;
outline-color = "#000000";
border-width = 6;
border-color = "#727169";
corner-radius = 50;
padding-top = 20;
padding-bottom = 20;
padding-left = 100;
padding-right = 100;
};
}

View File

@ -0,0 +1,8 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
voicevox-core
voicevox-engine
voicevox
];
}

11
home-manager/vscode.nix Normal file
View File

@ -0,0 +1,11 @@
{ pkgs, ... }:
{
programs.vscode = {
enable = true;
package = pkgs.vscode.fhs;
profiles.default = {
extensions = with pkgs.vscode-extensions; [
];
};
};
}

View File

@ -0,0 +1,6 @@
{ ... }:
{
programs.wezterm.enable = true;
xdg.configFile."wezterm/wezterm.lua".source = ./wezterm.lua;
}

View File

@ -0,0 +1,88 @@
local wezterm = require 'wezterm'
local config = {
enable_wayland = true,
force_reverse_video_cursor = true,
font_size = 12,
colors = {
foreground = '#dcd7ba',
background = 'rgba(31,31,31,0.2)',
cursor_bg = '#c8c093',
cursor_fg = '#c8c093',
cursor_border = '#c8c093',
selection_fg = '#c8c093',
selection_bg = '#2d4f67',
scrollbar_thumb = '#16161d',
split = '#16161d',
ansi = { '#090618', '#c34043', '#76946a', '#c0a36e', '#7e9cd8', '#957fb8', '#6a9589', '#c8c093' },
brights = { '#727169', '#e82424', '#98bb6c', '#e6c384', '#7fb4ca', '#938aa9', '#7aa89f', '#dcd7ba' },
indexed = { [16] = '#ffa066', [17] = '#ff5d62' },
tab_bar = {
background = 'rgba(31, 31, 40, 0.5)',
new_tab = {
bg_color = 'rgba(31, 31, 40, 0.5)',
fg_color = '#c8c093',
},
new_tab_hover = {
bg_color = 'rgba(31, 31, 40, 0.5)',
fg_color = '#c8c093',
intensity = 'Bold'
},
}
},
use_fancy_tab_bar = false,
show_tab_index_in_tab_bar = false,
keys = {
{ key = 'V', mods = 'CTRL', action = wezterm.action.PasteFrom 'Clipboard' },
}
}
local SOLID_LEFT_ARROW = wezterm.nerdfonts.pl_right_hard_divider
local SOLID_RIGHT_ARROW = wezterm.nerdfonts.pl_left_hard_divider
function tab_title(tab_info)
local title = tab_info.tab_title
-- if the tab title is explicitly set, take that
if title and #title > 0 then
return title
end
-- Otherwise, use the title from the active pane
-- in that tab
return tab_info.active_pane.title
end
wezterm.on(
'format-tab-title',
function(tab, tabs, panes, config, hover, max_width)
local bg_color = 'rgba(31, 31, 40, 0.5)'
local fg_color = '#c8c093'
local text_color = '#1f1f28'
if tab.is_active then
fg_color = '#2d4f67'
text_color = '#c8c093'
end
local title = wezterm.truncate_right(tab_title(tab), max_width - 4)
return {
{ Background = { Color = bg_color } },
{ Foreground = { Color = fg_color } },
{ Text = SOLID_LEFT_ARROW },
{ Background = { Color = fg_color } },
{ Foreground = { Color = text_color } },
{ Text = ' ' .. title .. ' ' },
{ Background = { Color = bg_color } },
{ Foreground = { Color = fg_color } },
{ Text = SOLID_RIGHT_ARROW },
}
end
)
return config

27
home-manager/zeditor.nix Normal file
View File

@ -0,0 +1,27 @@
{ pkgs, ... }:
{
programs.zed-editor = {
enable = true;
extensions = [
"nix"
"toml"
"rust"
];
userSettings = {
theme = {
mode = "system";
dark = "Kanagawa Dragon";
light = "Kanagawa Lotus";
};
hour_format = "hour24";
vim_mode = false;
buffer_font_size = 12.0;
buffer_font_family = "PlemolJP Console NF";
};
};
fonts.fontconfig.enable = true;
home.file.".local/share/fonts/plemoljp".source =
"${pkgs.plemoljp-nf}/share/fonts/truetype/plemoljp-nf-console";
}

BIN
hosts/.default.nix.swp Normal file

Binary file not shown.

16
hosts/aqua/default.nix Normal file
View File

@ -0,0 +1,16 @@
inputs:
let
mkHost = import ../mkHost.nix inputs;
in
mkHost {
system = "x86_64-linux";
hostname = "AQUA";
users = [
{
username = "umi";
homeModule = [ ./umi/home-manager.nix ];
userNixos = ./umi/nixos.nix;
}
];
systemModules = [ ./nixos.nix ];
}

View File

@ -0,0 +1,54 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"usb_storage"
"usbhid"
"sd_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/e8956bf9-0123-4caf-8a5d-abe77a33e83a";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/6949-1506";
fsType = "vfat";
options = [
"fmask=0077"
"dmask=0077"
];
};
swapDevices = [ ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = {
modesetting.enable = true;
open = true;
nvidiaSettings = true;
};
}

93
hosts/aqua/nixos.nix Normal file
View File

@ -0,0 +1,93 @@
{
pkgs,
username,
...
}:
let
config.boot.kernelPackages = pkgs.linuxPackages_latest;
in
{
system.stateVersion = "25.11";
imports = [
./hardware-configuration.nix
../../system/core
../../programs/ssh.nix
../../programs/utility.nix
../../programs/shell.nix
../../programs/docker.nix
../../programs/v4l2.nix
../../programs/desktop/hyprland.nix
../../programs/fcitx.nix
../../programs/steam.nix
];
environment.systemPackages = with pkgs; [
cargo
rustc
rustfmt
openssl
vulkan-tools
android-tools
android-file-transfer
bluez
bluez-tools
bluetuith
obexftp
fzf
ghq
];
environment.sessionVariables.NIXOS_OZONE_WL = "1";
programs.nix-ld.enable = true;
services.openssh.enable = true;
services.udisks2.enable = true;
networking.firewall.allowedTCPPorts = [
22
19132
25565
];
networking.firewall.allowedUDPPorts = [ ];
services.udev.extraRules = "";
hardware.bluetooth = {
enable = true;
package = pkgs.bluez;
powerOnBoot = true;
settings = {
General = {
ControllerMode = "dual";
Experimental = true;
KernelExperimental = true;
FastConnectable = true;
# セキュリティレベルを調整
Class = "0x000100";
# ペアリングタイムアウトを延長
PairableTimeout = 0;
};
Policy = {
AutoEnable = true;
};
};
};
boot.kernelPackages = config.boot.kernelPackages;
boot.extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ];
boot.kernelModules = [
"v4l2loopback"
];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
cornflake.greeter.monitors = [
"DP-1, disable"
"DP-2, disable"
"DP-3, 1920x1080@240, 0x0"
];
}

View File

@ -0,0 +1,88 @@
{
pkgs,
inputs,
lib,
...
}:
{
home.stateVersion = "25.05";
imports = [
inputs.nix-index-database.homeModules.nix-index
../../../home-manager/tofi.nix
../../../home-manager/hyprland
../../../home-manager/fnott.nix
../../../home-manager/wezterm
../../../home-manager/fish
../../../home-manager/vscode.nix
../../../home-manager/direnv.nix
../../../home-manager/firefox.nix
../../../home-manager/obs-studio.nix
../../../home-manager/zeditor.nix
../../../home-manager/voicevox.nix
];
hare.hyprland = {
input.sensitivity = 0.0;
wallpaperCommand = "swww img /usr/share/wallpaper/arknights-02.jpg";
};
programs.nix-index-database.comma.enable = true;
home.packages = with pkgs; [
google-chrome
discord
helvum
plemoljp
plemoljp-nf
prismlauncher
scrcpy
tetrio-desktop
gimp
inkscape
obsidian
kdePackages.filelight
(deno.overrideAttrs (oldAttrs: {
doCheck = false;
}))
bun
nodejs_24
nixd
rust-analyzer
];
services.easyeffects = {
enable = true;
};
programs.git = {
enable = true;
settings.user.name = "Kariya";
settings.user.email = "kariya2298@gmail.com";
};
fonts = {
fontconfig = {
defaultFonts = {
serif = [ "Noto Serif" ];
sansSerif = [ "Noto Sans" ];
monospace = [ "PlemolJP NF Console" ];
};
};
};
xdg.mimeApps = {
enable = true;
defaultApplications = {
"text/html" = "google-chrome.desktop";
"x-scheme-handler/http" = "google-chrome.desktop";
"x-scheme-handler/https" = "google-chrome.desktop";
"x-scheme-handler/about" = "google-chrome.desktop";
"x-scheme-handler/unknown" = "google-chrome.desktop";
};
};
wayland.windowManager.hyprland.settings.monitor = [
"DP-1, 1920x1080@60, -1920x0, 1"
"DP-2, 1600x900@60, -3520x90, 1"
"DP-3, 1920x1080@240, 0x0, 1"
];
}

9
hosts/aqua/umi/nixos.nix Normal file
View File

@ -0,0 +1,9 @@
{ pkgs, ... }:
{
extraGroups = [
"docker"
];
shell = pkgs.fish;
# openssh.authroizedKeys.keys = [
# ];
}

8
hosts/default.nix Normal file
View File

@ -0,0 +1,8 @@
inputs:
rec {
hosts = {
aqua = import ./aqua inputs;
};
nixos = builtins.mapAttrs (_: host: host.nixos) hosts;
home-manager = builtins.foldl' (a: b: a // b) { } (map (h: h.home-manager) (builtins.attrValues hosts));
}

62
hosts/mkHost.nix Normal file
View File

@ -0,0 +1,62 @@
inputs:
{
system,
hostname,
users,
systemModules,
}:
let
pkgs = import inputs.nixpkgs {
inherit system;
config.allowUnfree = true;
};
in
{
nixos = inputs.nixpkgs.lib.nixosSystem {
modules =
systemModules
++ (map (u: { pkgs, ... }: {
users.users.${u.username} = import u.userNixos { inherit pkgs; };
}) (builtins.filter (u: u ? userNixos) users))
++ [
{
users.users = builtins.listToAttrs (map (u: {
name = u.username;
value = {
isNormalUser = true;
description = "";
extraGroups = [
"networkmanager"
"wheel"
];
};
}) users);
}
];
inherit system;
specialArgs = {
inherit inputs hostname;
users = map (u: u.username) users;
};
};
home-manager = builtins.listToAttrs (map (u: {
name = "${u.username}@${hostname}";
value = inputs.home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = {
inherit inputs hostname;
username = u.username;
};
modules = [
{
home = {
username = u.username;
homeDirectory = "/home/${u.username}";
};
programs.home-manager.enable = true;
}
(import ../system/home-manager)
] ++ u.homeModule;
};
}) users);
}

View File

@ -0,0 +1,17 @@
{ pkgs, ... }:
{
programs = {
hyprland = {
enable = true;
xwayland.enable = true;
withUWSM = true;
};
hyprlock.enable = true;
};
services.hypridle.enable = true;
environment.systemPackages = with pkgs; [
swww
eww
];
}

3
programs/docker.nix Normal file
View File

@ -0,0 +1,3 @@
{
virtualisation.docker.enable = true;
}

13
programs/fcitx.nix Normal file
View File

@ -0,0 +1,13 @@
{ pkgs, ... }:
{
i18n.inputMethod = {
type = "fcitx5";
enable = true;
fcitx5.addons = with pkgs; [
fcitx5-mozc
fcitx5-gtk
fcitx5-rose-pine
];
fcitx5.waylandFrontend = true;
};
}

26
programs/shell.nix Normal file
View File

@ -0,0 +1,26 @@
{ pkgs, ... }:
{
programs = {
fish.enable = true;
git.enable = true;
neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
};
};
environment.systemPackages = with pkgs; [
fishPlugins.z
bc
jq
tree
socat
acpi
btrfs-progs
duf
lsof
pciutils
];
}

26
programs/ssh.nix Normal file
View File

@ -0,0 +1,26 @@
{
programs.ssh.startAgent = true;
services.openssh = {
enable = true;
ports = [ 22 ];
settings = {
PasswordAuthentication = false;
AllowUsers = [ "hare" ];
UseDns = true;
X11Forwarding = false;
PermitRootLogin = "prohibit-password";
};
hostKeys = [
{
bits = 4096;
path = "/etc/ssh/ssh_host_rsa_key";
type = "rsa";
}
{
path = "/etc/ssh/ssh_host_ed25519_key";
type = "ed25519";
}
];
};
}

8
programs/steam.nix Normal file
View File

@ -0,0 +1,8 @@
{
programs.steam = {
enable = true;
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers
};
}

15
programs/utility.nix Normal file
View File

@ -0,0 +1,15 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
tmux
zip
unzip
rar
ripgrep
btop-rocm
bat
wezterm
libsixel
nixfmt-rfc-style
];
}

11
programs/v4l2.nix Normal file
View File

@ -0,0 +1,11 @@
{ config, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
config.boot.kernelPackages.v4l2loopback
v4l-utils
ffmpeg
];
boot.extraModprobeConfig = ''
options v4l2loopback devices=2 video_nr=0,1 card_label="OBS Virtual Camera,Scrcpy Source" exclusive_caps=1
'';
}

6
system/core/boot.nix Normal file
View File

@ -0,0 +1,6 @@
{ pkgs, ... }:
{
boot = {
supportedFilesystems = [ "ext4" "btrfs" "xfs" "vfat" "ntfs" ];
};
}

13
system/core/default.nix Normal file
View File

@ -0,0 +1,13 @@
{
imports = [
./nix.nix
./boot.nix
./locale.nix
./network.nix
./fonts.nix
./sound.nix
./uwsm.nix
./greeter.nix
];
}

18
system/core/fonts.nix Normal file
View File

@ -0,0 +1,18 @@
{ pkgs, ... }:
{
fonts = {
packages = with pkgs; [
noto-fonts
noto-fonts-cjk-sans
noto-fonts-color-emoji
ibm-plex
];
fontconfig = {
defaultFonts = {
serif = [ "Noto Serif" ];
sansSerif = [ "Noto Sans" ];
monospace = [ "IBM Plex Mono" ];
};
};
};
}

77
system/core/greeter.nix Normal file
View File

@ -0,0 +1,77 @@
{ config, lib, pkgs, ... }:
let
rosePineHyprcursor = pkgs.callPackage ../../home-manager/hyprland/rose-pine-hyprcursor.nix { };
monitorConf = lib.concatMapStrings (m: "monitor = ${m}\n") config.cornflake.greeter.monitors;
hyprGreetConf = pkgs.writeText "hyprland-greetd.conf" ''
${monitorConf}
env = HYPRCURSOR_THEME,rose-pine-hyprcursor
env = HYPRCURSOR_SIZE,24
env = XCURSOR_SIZE,24
env = XDG_CURRENT_DESKTOP,Hyprland
env = XDG_SESSION_TYPE,wayland
env = XDG_SESSION_DESKTOP,Hyprland
general {
border_size = 0
}
animations {
enabled = false
}
misc {
force_default_wallpaper = false
disable_hyprland_logo = true
disable_splash_rendering = true
}
exec-once = ${config.programs.regreet.package or pkgs.regreet}/bin/regreet; hyprctl dispatch exit
'';
in
{
options.cornflake.greeter.monitors = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
description = "greetd Hyprland monitor ";
};
config = {
services.greetd.enable = true;
services.greetd.settings.default_session = {
command = "${pkgs.hyprland}/bin/start-hyprland -- -c ${hyprGreetConf}";
user = "greeter";
};
environment.systemPackages = [
rosePineHyprcursor
];
programs.regreet = {
# greetd を Hyprland で動かす
enable = true;
theme.name = "Adwaita-dark";
iconTheme.name = "Papirus-Dark";
cursorTheme.name = "Bibata-Modern-Ice";
settings = {
appearance = {
greeting_msg = "Welcome back!";
};
widget = {
clock = {
format = "%H:%M";
resolution = "100ms";
timezone = "Asia/Tokyo";
label_width = 150;
};
};
GTK = {
application_prefer_dark_theme = true;
};
background = {
path = "/usr/share/wallpaper/arknights-image-01.png";
};
};
};
};
}

5
system/core/locale.nix Normal file
View File

@ -0,0 +1,5 @@
{
time.timeZone = "Asia/Tokyo";
i18n.defaultLocale = "en_US.UTF-8";
time.hardwareClockInLocalTime = true;
}

13
system/core/network.nix Normal file
View File

@ -0,0 +1,13 @@
{ config, hostname, ... }:
{
networking = {
hostName = hostname;
networkmanager.enable = true;
firewall = {
enable = true;
};
};
# nixpkgs issue#180175
systemd.services.NetworkManager-wait-online.enable = false;
}

17
system/core/nix.nix Normal file
View File

@ -0,0 +1,17 @@
{
nix = {
settings = {
experimental-features = [
"nix-command"
"flakes"
];
};
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
};
nixpkgs.config.allowUnfree = true;
}

17
system/core/sound.nix Normal file
View File

@ -0,0 +1,17 @@
{
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
extraConfig.pipewire."92-low-latency" = {
context.properties = {
default.clock.rate = 48000;
default.clock.quantum = 128;
default.clock.min-quantum = 32;
default.clock.max-quantum = 1024;
};
};
};
}

13
system/core/uwsm.nix Normal file
View File

@ -0,0 +1,13 @@
{ pkgs, lib, ... }:
{
programs.uwsm = {
enable = true;
waylandCompositors = {
hyprland = {
prettyName = "Hyprland";
comment = "Hyprland compositor managed by UWSM";
binPath = "${pkgs.hyprland}/bin/start-hyprland";
};
};
};
}

View File

@ -0,0 +1,11 @@
{
imports = [
./theme-switcher.nix
];
home.activation = {
makedir = ''
mkdir -p ~/.config/cornflake
'';
};
}

View File

@ -0,0 +1,29 @@
{ pkgs, ... }:
let
apply-theme-script = pkgs.writeScript "apply-theme" ''
curr=$(cat ~/.config/cornflake/current-theme)
if [ "$curr" = "prefer-light" ]; then
dconf write /org/gnome/desktop/interface/color-scheme "'prefer-light'"
else
dconf write /org/gnome/desktop/interface/color-scheme "'prefer-dark'"
fi
'';
desktopEntry = {
name = "Toggle theme";
exec = ''${pkgs.writeScript "theme" ''
curr=$(cat ~/.config/cornflake/current-theme)
if [ "$curr" = "prefer-light" ]; then
echo 'prefer-dark' > ~/.config/cornflake/current-theme
else
echo 'prefer-light' > ~/.config/cornflake/current-theme
fi
${apply-theme-script}
''}'';
};
in
{
xdg.desktopEntries = {
theme-switcher = desktopEntry;
};
}