From d725ad06a7ad2ab6cf7afeb0c81c0119765709a0 Mon Sep 17 00:00:00 2001 From: Hare Date: Thu, 30 Jan 2025 21:55:28 +0900 Subject: [PATCH 01/28] Init --- README.md | 9 ++ flake.nix | 17 +++ home-manager/direnv.nix | 9 ++ home-manager/hyprland.nix | 196 ++++++++++++++++++++++++++++++++++ home-manager/tofi.nix | 35 ++++++ hosts/default.nix | 75 +++++++++++++ programs/desktop/hyprland.nix | 19 ++++ programs/docker.nix | 3 + programs/fcitx.nix | 11 ++ programs/shell.nix | 24 +++++ programs/ssh.nix | 24 +++++ programs/utility.nix | 14 +++ programs/v4l2.nix | 7 ++ programs/vscode-server.nix | 16 +++ system/core/boot.nix | 6 ++ system/core/default.nix | 11 ++ system/core/fonts.nix | 18 ++++ system/core/locale.nix | 5 + system/core/network.nix | 13 +++ system/core/nix.nix | 17 +++ system/core/sound.nix | 9 ++ system/core/uwsm.nix | 12 +++ 22 files changed, 550 insertions(+) create mode 100644 README.md create mode 100644 flake.nix create mode 100644 home-manager/direnv.nix create mode 100644 home-manager/hyprland.nix create mode 100644 home-manager/tofi.nix create mode 100644 hosts/default.nix create mode 100644 programs/desktop/hyprland.nix create mode 100644 programs/docker.nix create mode 100644 programs/fcitx.nix create mode 100644 programs/shell.nix create mode 100644 programs/ssh.nix create mode 100644 programs/utility.nix create mode 100644 programs/v4l2.nix create mode 100644 programs/vscode-server.nix create mode 100644 system/core/boot.nix create mode 100644 system/core/default.nix create mode 100644 system/core/fonts.nix create mode 100644 system/core/locale.nix create mode 100644 system/core/network.nix create mode 100644 system/core/nix.nix create mode 100644 system/core/sound.nix create mode 100644 system/core/uwsm.nix diff --git a/README.md b/README.md new file mode 100644 index 0000000..751e1fc --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# Play.nix + +my nixos configuration + +## TODO + +- [ ] More adjustments about uwsm and hyprland +- [ ] Setting up for uniform configuration for common applications +- [ ] Make it selectable for NixOS/Nix-darwin/Standalone \ No newline at end of file diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..c59ff00 --- /dev/null +++ b/flake.nix @@ -0,0 +1,17 @@ +{ + description = "my config flake"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + + home-manager.url = "github:nix-community/home-manager"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + + nixos-hardware.url = "github:NixOS/nixos-hardware"; + }; + + outputs = inputs: { + nixosConfigurations = (import ./hosts inputs).nixos; + homeConfigurations = (import ./hosts inputs).home-manager; + }; +} \ No newline at end of file diff --git a/home-manager/direnv.nix b/home-manager/direnv.nix new file mode 100644 index 0000000..ad23ea9 --- /dev/null +++ b/home-manager/direnv.nix @@ -0,0 +1,9 @@ +{ + programs = { + direnv = { + enable = true; + enableFishIntegration = true; # see note on other shells below + nix-direnv.enable = true; + }; + }; +} diff --git a/home-manager/hyprland.nix b/home-manager/hyprland.nix new file mode 100644 index 0000000..bad1a77 --- /dev/null +++ b/home-manager/hyprland.nix @@ -0,0 +1,196 @@ +{ + programs.kitty.enable = true; + wayland.windowManager.hyprland = { + enable = true; + systemd.enable = false; + settings = { + exec-once = [ + # "/usr/lib/polkit-kde-authentication-agent-1" + # "dunst" + "swww-daemon" + "swww img ./backgrounds/arknights-02.jpg" + # "hypridle" + # "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" + "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'" + ]; + + input = { + kb_layout = "us"; + kb_variant = ""; + kb_model = ""; + kb_options = ""; + kb_rules = ""; + + follow_mouse = true; + + touchpad = { + natural_scroll = true; + }; + + natural_scroll = true; + sensitivity = -1.0; + }; + + general = { + gaps_in = 8; + gaps_out = 10; + border_size = 4; + "col.active_border" = "rgba(6e848cee) rgba(ffffffee) 45deg"; + "col.inactive_border" = "rgba(595959aa)"; + layout = "dwindle"; + allow_tearing = true; + }; + + 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%" + ]; + }; + + dwindle = { + pseudotile = true; + preserve_split = true; + }; + + misc = { + force_default_wallpaper = false; + disable_hyprland_logo = false; + }; + + windowrulev2 = [ + "animation windowsIn 0,title:^(.*wofi.*)$" + "float,title:^(.*feh.*)$" + "center,title:^(.*feh.*)$" + "float,title:^(Picture.*)$" + "pin,title:^(Picture.*)$" + "immediate, 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" = "kitty"; + "$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, uwsm stop" + + # 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 + ) + ); + }; + }; + home.sessionVariables = { + # HYPRCURSOR_THEME = "rose-pine-cursor-hyprcursor"; + # HYPRCURSOR_SIZE = "24"; + # XCURSOR_SIZE = "24"; + # GTK_BACKEND = "wayland"; + # QT_QPA_PLATFORM = "wayland;xcb"; + # QT_QPA_PLATFORMTHEME = "qt5ct"; + # XDG_SESSION_TYPE = "wayland"; + # XDG_CURRENT_DESKTOP = "Hyprland"; + # XDG_SESSION_DESKTOP = "Hyprland"; + }; +} diff --git a/home-manager/tofi.nix b/home-manager/tofi.nix new file mode 100644 index 0000000..2876f5f --- /dev/null +++ b/home-manager/tofi.nix @@ -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; + }; +} diff --git a/hosts/default.nix b/hosts/default.nix new file mode 100644 index 0000000..66064b0 --- /dev/null +++ b/hosts/default.nix @@ -0,0 +1,75 @@ +inputs: +let + mkHost = + { + system, + hostname, + username, + systemModules, + homeModule, + }: + { + nixos = inputs.nixpkgs.lib.nixosSystem { + modules = + with inputs; + systemModules + ++ [ + { + users.users.${username} = { + isNormalUser = true; + description = ""; + extraGroups = [ + "networkmanager" + "wheel" + ]; + }; + programs.git.enable = true; + } + ]; + inherit system; + specialArgs = { + inherit inputs hostname username; + }; + }; + home-manager = inputs.home-manager.lib.homeManagerConfiguration { + pkgs = import inputs.nixpkgs { + inherit system; + config.allowUnfree = true; + }; + extraSpecialArgs = { + inherit inputs hostname username; + }; + modules = homeModule ++ [ + { + home = { + inherit username; + homeDirectory = "/home/${username}"; + stateVersion = "24.11"; + }; + programs.home-manager.enable = true; + } + ]; + }; + }; +in +rec { + hosts = { + myNixOS = mkHost { + system = "x86_64-linux"; + hostname = "myNixOS"; + username = "hare"; + systemModules = [ + ./myNixOS/nixos.nix + ]; + homeModule = [ + ./myNixOS/home-manager.nix + ]; + }; + }; + nixos = { + myNixOS = hosts.myNixOS.nixos; + }; + home-manager = { + myNixOS = hosts.myNixOS.home-manager; + }; +} diff --git a/programs/desktop/hyprland.nix b/programs/desktop/hyprland.nix new file mode 100644 index 0000000..0e8eb57 --- /dev/null +++ b/programs/desktop/hyprland.nix @@ -0,0 +1,19 @@ +{ pkgs, ... }: +{ + programs = { + hyprland = { + enable = true; + xwayland.enable = true; + withUWSM = true; + }; + hyprlock.enable = true; + + regreet.enable = true; + }; + services.hypridle.enable = true; + + environment.systemPackages = with pkgs; [ + swww + eww + ]; +} diff --git a/programs/docker.nix b/programs/docker.nix new file mode 100644 index 0000000..a878015 --- /dev/null +++ b/programs/docker.nix @@ -0,0 +1,3 @@ +{ + virtualisation.docker.enable = true; +} diff --git a/programs/fcitx.nix b/programs/fcitx.nix new file mode 100644 index 0000000..948081e --- /dev/null +++ b/programs/fcitx.nix @@ -0,0 +1,11 @@ +{ pkgs, ... }: +{ + i18n.inputMethod = { + type = "fcitx5"; + enable = true; + fcitx5.addons = with pkgs; [ + fcitx5-mozc + fcitx5-gtk + ]; + }; +} diff --git a/programs/shell.nix b/programs/shell.nix new file mode 100644 index 0000000..699a587 --- /dev/null +++ b/programs/shell.nix @@ -0,0 +1,24 @@ +{ pkgs, ... }: +{ + programs = { + fish.enable = true; + git.enable = true; + neovim = { + enable = true; + defaultEditor = true; + viAlias = true; + vimAlias = true; + }; + }; + + environment.systemPackages = with pkgs; [ + bc + jq + socat + acpi + btrfs-progs + duf + lsof + pciutils + ]; +} \ No newline at end of file diff --git a/programs/ssh.nix b/programs/ssh.nix new file mode 100644 index 0000000..d7b07d3 --- /dev/null +++ b/programs/ssh.nix @@ -0,0 +1,24 @@ +{ + 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"; + } + ]; + }; +} diff --git a/programs/utility.nix b/programs/utility.nix new file mode 100644 index 0000000..785e53f --- /dev/null +++ b/programs/utility.nix @@ -0,0 +1,14 @@ +{ pkgs, ... }: +{ + environment.systemPackages = with pkgs; [ + zip + unzip + ripgrep + btop + bat + + neovim + wezterm + kitty + nixfmt-rfc-style + ];} \ No newline at end of file diff --git a/programs/v4l2.nix b/programs/v4l2.nix new file mode 100644 index 0000000..735d139 --- /dev/null +++ b/programs/v4l2.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: +{ + environment.systemPackages = with pkgs; [ + v4l-utils + ffmpeg + ]; +} diff --git a/programs/vscode-server.nix b/programs/vscode-server.nix new file mode 100644 index 0000000..7b05691 --- /dev/null +++ b/programs/vscode-server.nix @@ -0,0 +1,16 @@ +{ pkgs, ... }: +{ + imports = [ + (fetchTarball { + url = "https://github.com/msteen/nixos-vscode-server/tarball/master"; + sha256 = "09j4kvsxw1d5dvnhbsgih0icbrxqv90nzf0b589rb5z6gnzwjnqf"; + }) + ]; + environment.systemPackages = with pkgs; [ + code-server + ]; + + services.vscode-server.enable = true; + services.vscode-server.enableFHS = true; + services.vscode-server.nodejsPackage = pkgs.nodejs_22; +} diff --git a/system/core/boot.nix b/system/core/boot.nix new file mode 100644 index 0000000..0682ce5 --- /dev/null +++ b/system/core/boot.nix @@ -0,0 +1,6 @@ +{ pkgs, ... }: +{ + boot = { + supportedFilesystems = [ "ext4" "btrfs" "xfs" "vfat" "ntfs" ]; + }; +} diff --git a/system/core/default.nix b/system/core/default.nix new file mode 100644 index 0000000..e7a517a --- /dev/null +++ b/system/core/default.nix @@ -0,0 +1,11 @@ +{ + imports = [ + ./nix.nix + ./boot.nix + ./uwsm.nix + ./locale.nix + ./network.nix + ./fonts.nix + ./sound.nix + ]; +} \ No newline at end of file diff --git a/system/core/fonts.nix b/system/core/fonts.nix new file mode 100644 index 0000000..5fc22be --- /dev/null +++ b/system/core/fonts.nix @@ -0,0 +1,18 @@ +{ pkgs, ... }: +{ + fonts = { + packages = with pkgs; [ + noto-fonts + noto-fonts-cjk-sans + noto-fonts-emoji + ibm-plex + ]; + fontconfig = { + defaultFonts = { + serif = [ "Noto Serif" ]; + sansSerif = [ "Noto Sans" ]; + monospace = [ "IBM Plex Mono" ]; + }; + }; + }; +} diff --git a/system/core/locale.nix b/system/core/locale.nix new file mode 100644 index 0000000..cf41040 --- /dev/null +++ b/system/core/locale.nix @@ -0,0 +1,5 @@ +{ + time.timeZone = "Asia/Tokyo"; + i18n.defaultLocale = "en_US.UTF-8"; + time.hardwareClockInLocalTime = true; +} diff --git a/system/core/network.nix b/system/core/network.nix new file mode 100644 index 0000000..6e44501 --- /dev/null +++ b/system/core/network.nix @@ -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; +} diff --git a/system/core/nix.nix b/system/core/nix.nix new file mode 100644 index 0000000..f2c4730 --- /dev/null +++ b/system/core/nix.nix @@ -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; +} diff --git a/system/core/sound.nix b/system/core/sound.nix new file mode 100644 index 0000000..e372d47 --- /dev/null +++ b/system/core/sound.nix @@ -0,0 +1,9 @@ +{ + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; +} diff --git a/system/core/uwsm.nix b/system/core/uwsm.nix new file mode 100644 index 0000000..3bf9939 --- /dev/null +++ b/system/core/uwsm.nix @@ -0,0 +1,12 @@ +{ + programs.uwsm = { + enable = true; + waylandCompositors = { + hyprland = { + prettyName = "Hyprland"; + comment = "Hyprland compositor managed by UWSM"; + binPath = "/run/current-system/sw/bin/Hyprland"; + }; + }; + }; +} From 6015a2a09eabdd0b1495b2f6251f2aec8a0a8369 Mon Sep 17 00:00:00 2001 From: Hare Date: Thu, 30 Jan 2025 21:59:22 +0900 Subject: [PATCH 02/28] update: README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 751e1fc..5dcb39d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Play.nix +# 🌽❄ my nixos configuration From 9d9e5e758a370b4ebd3b531ff1e3d375c28faab1 Mon Sep 17 00:00:00 2001 From: Hare Date: Thu, 30 Jan 2025 22:06:21 +0900 Subject: [PATCH 03/28] add new host: arcadia --- hosts/arcadia/hardware-configuration.nix | 45 ++++++++++++++++ hosts/arcadia/home-manager.nix | 41 +++++++++++++++ hosts/arcadia/nixos.nix | 67 ++++++++++++++++++++++++ 3 files changed, 153 insertions(+) create mode 100644 hosts/arcadia/hardware-configuration.nix create mode 100644 hosts/arcadia/home-manager.nix create mode 100644 hosts/arcadia/nixos.nix diff --git a/hosts/arcadia/hardware-configuration.nix b/hosts/arcadia/hardware-configuration.nix new file mode 100644 index 0000000..8bf8788 --- /dev/null +++ b/hosts/arcadia/hardware-configuration.nix @@ -0,0 +1,45 @@ +{ + config, + lib, + pkgs, + modulesPath, + ... +}: +{ + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "ahci" + "usb_storage" + "usbhid" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/f3934858-078f-463a-9dd3-d6ba220ced6d"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/FFAC-0945"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" + ]; + }; + + swapDevices = [ ]; + + networking.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/arcadia/home-manager.nix b/hosts/arcadia/home-manager.nix new file mode 100644 index 0000000..ef87ea6 --- /dev/null +++ b/hosts/arcadia/home-manager.nix @@ -0,0 +1,41 @@ +{ conifg, pkgs, ... }: +{ + imports = [ + ../../home-manager/hyprland.nix + ../../home-manager/tofi.nix + ../../home-manager/direnv.nix + ../../home-manager/waybar.nix + ]; + home = rec { + username = "hare"; + homeDirectory = "/home/${username}"; + stateVersion = "24.11"; + }; + home.packages = with pkgs; [ + vscode + vivaldi + discord + discord-canary + helvum + obs-studio + superfile + plemoljp + plemoljp-nf + prismlauncher + ]; + programs.git = { + enable = true; + userName = "Hare"; + userEmail = "kei.hiracchi.0928@gmail.com"; + }; + + fonts = { + fontconfig = { + defaultFonts = { + serif = [ "Noto Serif" ]; + sansSerif = [ "Noto Sans" ]; + monospace = [ "PlemolJP NF Console" ]; + }; + }; + }; +} diff --git a/hosts/arcadia/nixos.nix b/hosts/arcadia/nixos.nix new file mode 100644 index 0000000..91bc4b5 --- /dev/null +++ b/hosts/arcadia/nixos.nix @@ -0,0 +1,67 @@ +{ + config, + pkgs, + username, + ... +}: +{ + system.stateVersion = "24.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 + ]; + environment.systemPackages = with pkgs; [ + deno + nodejs + pnpm + scrcpy + tetrio-desktop + # kicad + # blender-hip + gimp + inkscape + ]; + + nixpkgs.config.allowUnfree = true; + + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + boot.initrd.kernelModules = [ "amdgpu" ]; + + boot.kernelModules = [ "v4l2loopback" ]; + boot.extraModulePackages = [ pkgs.linuxPackages.v4l2loopback ]; + + users.users.${username} = { + extraGroups = [ + "adbusers" + "docker" + ]; + shell = pkgs.fish; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIW2Yrqwi4YjIrdI8mygX5pTHDPmrUgbmpZ4WxoTqORi keihi@Vostro-LapTop" + ]; + }; + programs.adb.enable = true; + programs.nix-ld.enable = true; + + services.openssh.enable = true; + + networking.firewall.allowedTCPPorts = [ + 8080 + 22 + 5173 + 8000 + 9001 + ]; + networking.firewall.allowedUDPPorts = [ ]; +} From 784e002847047fdf8991e21492b354c02db1e1cf Mon Sep 17 00:00:00 2001 From: Hare Date: Thu, 30 Jan 2025 22:48:39 +0900 Subject: [PATCH 04/28] fix: remove unused overriding --- hosts/arcadia/home-manager.nix | 6 ------ hosts/default.nix | 13 ++++++------- programs/utility.nix | 1 - programs/vscode-server.nix | 16 ---------------- 4 files changed, 6 insertions(+), 30 deletions(-) delete mode 100644 programs/vscode-server.nix diff --git a/hosts/arcadia/home-manager.nix b/hosts/arcadia/home-manager.nix index ef87ea6..0a0a650 100644 --- a/hosts/arcadia/home-manager.nix +++ b/hosts/arcadia/home-manager.nix @@ -4,13 +4,7 @@ ../../home-manager/hyprland.nix ../../home-manager/tofi.nix ../../home-manager/direnv.nix - ../../home-manager/waybar.nix ]; - home = rec { - username = "hare"; - homeDirectory = "/home/${username}"; - stateVersion = "24.11"; - }; home.packages = with pkgs; [ vscode vivaldi diff --git a/hosts/default.nix b/hosts/default.nix index 66064b0..e22ab58 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -23,7 +23,6 @@ let "wheel" ]; }; - programs.git.enable = true; } ]; inherit system; @@ -54,22 +53,22 @@ let in rec { hosts = { - myNixOS = mkHost { + arcadia = mkHost { system = "x86_64-linux"; - hostname = "myNixOS"; + hostname = "Arcadia"; username = "hare"; systemModules = [ - ./myNixOS/nixos.nix + ./arcadia/nixos.nix ]; homeModule = [ - ./myNixOS/home-manager.nix + ./arcadia/home-manager.nix ]; }; }; nixos = { - myNixOS = hosts.myNixOS.nixos; + arcadia = hosts.arcadia.nixos; }; home-manager = { - myNixOS = hosts.myNixOS.home-manager; + arcadia = hosts.arcadia.home-manager; }; } diff --git a/programs/utility.nix b/programs/utility.nix index 785e53f..c8de501 100644 --- a/programs/utility.nix +++ b/programs/utility.nix @@ -7,7 +7,6 @@ btop bat - neovim wezterm kitty nixfmt-rfc-style diff --git a/programs/vscode-server.nix b/programs/vscode-server.nix deleted file mode 100644 index 7b05691..0000000 --- a/programs/vscode-server.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ pkgs, ... }: -{ - imports = [ - (fetchTarball { - url = "https://github.com/msteen/nixos-vscode-server/tarball/master"; - sha256 = "09j4kvsxw1d5dvnhbsgih0icbrxqv90nzf0b589rb5z6gnzwjnqf"; - }) - ]; - environment.systemPackages = with pkgs; [ - code-server - ]; - - services.vscode-server.enable = true; - services.vscode-server.enableFHS = true; - services.vscode-server.nodejsPackage = pkgs.nodejs_22; -} From 0336d754d1e134ca93fe9a4ba90959f877d43b82 Mon Sep 17 00:00:00 2001 From: Hare Date: Fri, 31 Jan 2025 16:54:46 +0900 Subject: [PATCH 05/28] update: change terminal from kitty to wezterm and clean up hyprland configuration --- home-manager/hyprland.nix | 26 ++++++++++++++------------ hosts/arcadia/nixos.nix | 2 -- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/home-manager/hyprland.nix b/home-manager/hyprland.nix index bad1a77..30028f9 100644 --- a/home-manager/hyprland.nix +++ b/home-manager/hyprland.nix @@ -1,5 +1,4 @@ -{ - programs.kitty.enable = true; +{ pkgs, ... }: { wayland.windowManager.hyprland = { enable = true; systemd.enable = false; @@ -110,7 +109,7 @@ ]; "$menu" = "uwsm app -- $(tofi-drun)"; - "$terminal" = "kitty"; + "$terminal" = "wezterm"; "$lock" = "hyprlock"; bindm = [ # Window Movement & Resizing @@ -181,16 +180,19 @@ ) ); }; + plugins = [ + # pkgs.hyprlandPlugins. + ]; }; home.sessionVariables = { - # HYPRCURSOR_THEME = "rose-pine-cursor-hyprcursor"; - # HYPRCURSOR_SIZE = "24"; - # XCURSOR_SIZE = "24"; - # GTK_BACKEND = "wayland"; - # QT_QPA_PLATFORM = "wayland;xcb"; - # QT_QPA_PLATFORMTHEME = "qt5ct"; - # XDG_SESSION_TYPE = "wayland"; - # XDG_CURRENT_DESKTOP = "Hyprland"; - # XDG_SESSION_DESKTOP = "Hyprland"; + HYPRCURSOR_THEME = "rose-pine-cursor-hyprcursor"; + HYPRCURSOR_SIZE = "24"; + XCURSOR_SIZE = "24"; + GTK_BACKEND = "wayland"; + QT_QPA_PLATFORM = "wayland;xcb"; + QT_QPA_PLATFORMTHEME = "qt5ct"; + XDG_SESSION_TYPE = "wayland"; + XDG_CURRENT_DESKTOP = "Hyprland"; + XDG_SESSION_DESKTOP = "Hyprland"; }; } diff --git a/hosts/arcadia/nixos.nix b/hosts/arcadia/nixos.nix index 91bc4b5..15217f3 100644 --- a/hosts/arcadia/nixos.nix +++ b/hosts/arcadia/nixos.nix @@ -31,8 +31,6 @@ inkscape ]; - nixpkgs.config.allowUnfree = true; - boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; From d40fbe7eed7d86654f09d64c752ee90427a55e35 Mon Sep 17 00:00:00 2001 From: Hare Date: Sun, 2 Feb 2025 16:40:00 +0900 Subject: [PATCH 06/28] enable Steam --- hosts/arcadia/nixos.nix | 1 + programs/steam.nix | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 programs/steam.nix diff --git a/hosts/arcadia/nixos.nix b/hosts/arcadia/nixos.nix index 15217f3..82f02b1 100644 --- a/hosts/arcadia/nixos.nix +++ b/hosts/arcadia/nixos.nix @@ -18,6 +18,7 @@ ../../programs/v4l2.nix ../../programs/desktop/hyprland.nix ../../programs/fcitx.nix + ../../programs/steam.nix ]; environment.systemPackages = with pkgs; [ deno diff --git a/programs/steam.nix b/programs/steam.nix new file mode 100644 index 0000000..65035f8 --- /dev/null +++ b/programs/steam.nix @@ -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 + }; +} From a4ff711bc32b312ade779721e62dc1d264a8f847 Mon Sep 17 00:00:00 2001 From: Hare Date: Sun, 16 Feb 2025 14:41:48 +0900 Subject: [PATCH 07/28] add: theme-switcher --- flake.lock | 64 ++++++++++++++++++++++++++ home-manager/hyprland.nix | 1 - hosts/arcadia/home-manager.nix | 10 +++- hosts/arcadia/nixos.nix | 13 +++--- hosts/default.nix | 5 +- programs/utility.nix | 2 +- system/home-manager/default.nix | 11 +++++ system/home-manager/theme-switcher.nix | 29 ++++++++++++ 8 files changed, 124 insertions(+), 11 deletions(-) create mode 100644 flake.lock create mode 100644 system/home-manager/default.nix create mode 100644 system/home-manager/theme-switcher.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..8ce4779 --- /dev/null +++ b/flake.lock @@ -0,0 +1,64 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1738448366, + "narHash": "sha256-4ATtQqBlgsGqkHTemta0ydY6f7JBRXz4Hf574NHQpkg=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "18fa9f323d8adbb0b7b8b98a8488db308210ed93", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "nixos-hardware": { + "locked": { + "lastModified": 1738471961, + "narHash": "sha256-cgXDFrplNGs7bCVzXhRofjD8oJYqqXGcmUzXjHmip6Y=", + "owner": "NixOS", + "repo": "nixos-hardware", + "rev": "537286c3c59b40311e5418a180b38034661d2536", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixos-hardware", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1738410390, + "narHash": "sha256-xvTo0Aw0+veek7hvEVLzErmJyQkEcRk6PSR4zsRQFEc=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "3a228057f5b619feb3186e986dbe76278d707b6e", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixos-hardware": "nixos-hardware", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/home-manager/hyprland.nix b/home-manager/hyprland.nix index 30028f9..1afee27 100644 --- a/home-manager/hyprland.nix +++ b/home-manager/hyprland.nix @@ -181,7 +181,6 @@ ); }; plugins = [ - # pkgs.hyprlandPlugins. ]; }; home.sessionVariables = { diff --git a/hosts/arcadia/home-manager.nix b/hosts/arcadia/home-manager.nix index 0a0a650..2f414d2 100644 --- a/hosts/arcadia/home-manager.nix +++ b/hosts/arcadia/home-manager.nix @@ -9,13 +9,21 @@ vscode vivaldi discord - discord-canary helvum obs-studio superfile plemoljp plemoljp-nf prismlauncher + scrcpy + tetrio-desktop + kicad + blender-hip + gimp + inkscape + obsidian + zed-editor + easyeffects ]; programs.git = { enable = true; diff --git a/hosts/arcadia/nixos.nix b/hosts/arcadia/nixos.nix index 82f02b1..29d4280 100644 --- a/hosts/arcadia/nixos.nix +++ b/hosts/arcadia/nixos.nix @@ -24,12 +24,13 @@ deno nodejs pnpm - scrcpy - tetrio-desktop - # kicad - # blender-hip - gimp - inkscape + + qemu + (pkgs.writeShellScriptBin "qemu-system-x86_64-uefi" '' + qemu-system-x86_64 \ + -bios ${pkgs.OVMF.fd}/FV/OVMF.fd \ + "$@" + '') ]; boot.loader.systemd-boot.enable = true; diff --git a/hosts/default.nix b/hosts/default.nix index e22ab58..37586ae 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -38,7 +38,7 @@ let extraSpecialArgs = { inherit inputs hostname username; }; - modules = homeModule ++ [ + modules = [ { home = { inherit username; @@ -47,7 +47,8 @@ let }; programs.home-manager.enable = true; } - ]; + (import ../system/home-manager) + ] ++ homeModule; }; }; in diff --git a/programs/utility.nix b/programs/utility.nix index c8de501..3f2467e 100644 --- a/programs/utility.nix +++ b/programs/utility.nix @@ -4,7 +4,7 @@ zip unzip ripgrep - btop + btop-rocm bat wezterm diff --git a/system/home-manager/default.nix b/system/home-manager/default.nix new file mode 100644 index 0000000..24e8df8 --- /dev/null +++ b/system/home-manager/default.nix @@ -0,0 +1,11 @@ +{ + imports = [ + ./theme-switcher.nix + ]; + + home.activation = { + makedir = '' + mkdir -p ~/.config/cornflake + ''; + }; +} diff --git a/system/home-manager/theme-switcher.nix b/system/home-manager/theme-switcher.nix new file mode 100644 index 0000000..d6027bb --- /dev/null +++ b/system/home-manager/theme-switcher.nix @@ -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; + }; +} From fd6281b9a01bc765eaca682e92d681474cff7a80 Mon Sep 17 00:00:00 2001 From: Hare Date: Fri, 21 Feb 2025 19:44:52 +0900 Subject: [PATCH 08/28] add: obs and firefox, fix: desktop and greeter QoL --- home-manager/firefox.nix | 5 +++++ home-manager/hyprland.nix | 11 ++++++----- home-manager/obs-studio.nix | 11 +++++++++++ hosts/arcadia/display.nix | 10 ++++++++++ hosts/arcadia/hardware-configuration.nix | 4 ++++ hosts/arcadia/home-manager.nix | 17 ++++++++++++++++- programs/desktop/hyprland.nix | 4 +--- programs/shell.nix | 3 ++- programs/utility.nix | 3 +-- programs/v4l2.nix | 3 +++ system/core/default.nix | 6 ++++-- system/core/regreet.nix | 24 ++++++++++++++++++++++++ 12 files changed, 87 insertions(+), 14 deletions(-) create mode 100644 home-manager/firefox.nix create mode 100644 home-manager/obs-studio.nix create mode 100644 hosts/arcadia/display.nix create mode 100644 system/core/regreet.nix diff --git a/home-manager/firefox.nix b/home-manager/firefox.nix new file mode 100644 index 0000000..902f34f --- /dev/null +++ b/home-manager/firefox.nix @@ -0,0 +1,5 @@ +{ +programs.firefox = { + enable = true; +}; +} diff --git a/home-manager/hyprland.nix b/home-manager/hyprland.nix index 1afee27..d36878b 100644 --- a/home-manager/hyprland.nix +++ b/home-manager/hyprland.nix @@ -7,14 +7,15 @@ # "/usr/lib/polkit-kde-authentication-agent-1" # "dunst" "swww-daemon" - "swww img ./backgrounds/arknights-02.jpg" - # "hypridle" # "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 = [ + "swww img /usr/share/wallpaper/arknights-02.jpg" "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'" @@ -123,7 +124,7 @@ "SUPER, E, exec, $terminal" "SUPER, Q, killactive," "SUPER, L, exec, $lock" - "SUPER_SHIFT, M, exec, uwsm stop" + "SUPER_SHIFT, M, exec, loginctl terminate-user $USER" # prsc ", Print, exec, hyprshot -m window -m active --clipboard-only" @@ -184,8 +185,8 @@ ]; }; home.sessionVariables = { - HYPRCURSOR_THEME = "rose-pine-cursor-hyprcursor"; - HYPRCURSOR_SIZE = "24"; + HYPRCURSOR_THEME = ""; + HYPRCURSOR_SIZE = "12"; XCURSOR_SIZE = "24"; GTK_BACKEND = "wayland"; QT_QPA_PLATFORM = "wayland;xcb"; diff --git a/home-manager/obs-studio.nix b/home-manager/obs-studio.nix new file mode 100644 index 0000000..edd2865 --- /dev/null +++ b/home-manager/obs-studio.nix @@ -0,0 +1,11 @@ +{ config, pkgs, ... }: +{ + programs.obs-studio = { + enable = true; + plugins = with pkgs.obs-studio-plugins; [ + wlrobs + obs-backgroundremoval + obs-pipewire-audio-capture + ]; + }; +} diff --git a/hosts/arcadia/display.nix b/hosts/arcadia/display.nix new file mode 100644 index 0000000..6211044 --- /dev/null +++ b/hosts/arcadia/display.nix @@ -0,0 +1,10 @@ +{ + wayland.windowManager.hyprland = { + settings = { + monitor = [ + "DP-2, 2560x1440@144, 0x0, 1" + "DP-1, 1920x1080@120, -1920x180, 1" + ]; + }; + }; +} diff --git a/hosts/arcadia/hardware-configuration.nix b/hosts/arcadia/hardware-configuration.nix index 8bf8788..9810a82 100644 --- a/hosts/arcadia/hardware-configuration.nix +++ b/hosts/arcadia/hardware-configuration.nix @@ -42,4 +42,8 @@ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + + hardware.opengl = { + enable = true; + }; } diff --git a/hosts/arcadia/home-manager.nix b/hosts/arcadia/home-manager.nix index 2f414d2..fbe5636 100644 --- a/hosts/arcadia/home-manager.nix +++ b/hosts/arcadia/home-manager.nix @@ -2,15 +2,18 @@ { imports = [ ../../home-manager/hyprland.nix + ./display.nix + ../../home-manager/tofi.nix ../../home-manager/direnv.nix + ../../home-manager/firefox.nix + ../../home-manager/obs-studio.nix ]; home.packages = with pkgs; [ vscode vivaldi discord helvum - obs-studio superfile plemoljp plemoljp-nf @@ -40,4 +43,16 @@ }; }; }; + + xdg.mimeApps = { + enable = true; + + defaultApplications = { + "text/html" = "vivaldi-stable.desktop"; + "x-scheme-handler/http" = "vivaldi-stable.desktop"; + "x-scheme-handler/https" = "vivaldi-stable.desktop"; + "x-scheme-handler/about" = "vivaldi-stable.desktop"; + "x-scheme-handler/unknown" = "vivaldi-stable.desktop"; + }; + }; } diff --git a/programs/desktop/hyprland.nix b/programs/desktop/hyprland.nix index 0e8eb57..27b2e86 100644 --- a/programs/desktop/hyprland.nix +++ b/programs/desktop/hyprland.nix @@ -7,11 +7,9 @@ withUWSM = true; }; hyprlock.enable = true; - - regreet.enable = true; }; services.hypridle.enable = true; - + environment.systemPackages = with pkgs; [ swww eww diff --git a/programs/shell.nix b/programs/shell.nix index 699a587..36e480a 100644 --- a/programs/shell.nix +++ b/programs/shell.nix @@ -12,6 +12,7 @@ }; environment.systemPackages = with pkgs; [ + fishPlugins.z bc jq socat @@ -21,4 +22,4 @@ lsof pciutils ]; -} \ No newline at end of file +} diff --git a/programs/utility.nix b/programs/utility.nix index 3f2467e..b2199fb 100644 --- a/programs/utility.nix +++ b/programs/utility.nix @@ -8,6 +8,5 @@ bat wezterm - kitty nixfmt-rfc-style - ];} \ No newline at end of file + ];} diff --git a/programs/v4l2.nix b/programs/v4l2.nix index 735d139..87e7864 100644 --- a/programs/v4l2.nix +++ b/programs/v4l2.nix @@ -4,4 +4,7 @@ v4l-utils ffmpeg ]; + boot.extraModprobeConfig = '' + options v4l2loopback devices=2 video_nr=0,1 card_label="Scrcpy Source","OBS VirtualCamera" exclusive_caps=1 + ''; } diff --git a/system/core/default.nix b/system/core/default.nix index e7a517a..738833e 100644 --- a/system/core/default.nix +++ b/system/core/default.nix @@ -2,10 +2,12 @@ imports = [ ./nix.nix ./boot.nix - ./uwsm.nix ./locale.nix ./network.nix ./fonts.nix ./sound.nix + + ./uwsm.nix + ./regreet.nix ]; -} \ No newline at end of file +} diff --git a/system/core/regreet.nix b/system/core/regreet.nix new file mode 100644 index 0000000..9e9d86c --- /dev/null +++ b/system/core/regreet.nix @@ -0,0 +1,24 @@ +{ + programs.regreet = { + enable = true; + 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"; + }; + }; + }; +} From 94dcf0a93cad9310582eea8241f24d73cb62a4c0 Mon Sep 17 00:00:00 2001 From: Hare Date: Fri, 21 Feb 2025 19:56:38 +0900 Subject: [PATCH 09/28] add new host: fungus --- hosts/.default.nix.swp | Bin 0 -> 12288 bytes hosts/default.nix | 13 +++++++ hosts/fungus/hardware-configuration.nix | 32 ++++++++++++++++++ hosts/fungus/home-manager.nix | 43 ++++++++++++++++++++++++ hosts/fungus/nixos.nix | 41 ++++++++++++++++++++++ 5 files changed, 129 insertions(+) create mode 100644 hosts/.default.nix.swp create mode 100644 hosts/fungus/hardware-configuration.nix create mode 100644 hosts/fungus/home-manager.nix create mode 100644 hosts/fungus/nixos.nix diff --git a/hosts/.default.nix.swp b/hosts/.default.nix.swp new file mode 100644 index 0000000000000000000000000000000000000000..2e28a49fb979740abb279b32ed4eb39ec9fe9c93 GIT binary patch literal 12288 zcmeI2%ZnUE9LFnrS~c;N1VTV8$Dj$x_GDucVkEF35?^c%hTTgDv390rrrmx~UCr#W zPNIl-2#EiHpa&tB9DRTyUOebU5c~(sLA*qSJqTX>)@!DFHnNgKVBt6L=|^?duYUdc zRW~f#E60~#TjVcB^9;Yo8T)wo>;3}U$1d(>Y#@|0&D;I5cr7ot>xApqO~7_1S6MF+ ztFk@FOI^0RvL~uUM~L!2Vo(<{KnCu^K&5+gXZ9?;aAN+r8U1YQ8NT<)rTYj(L&yLb zAOmE843GgbKnBPF8Q7@?bg_%wK=L#G1}^#iuBp90r5za{17v^ab3;qU*yA7gA2`~mKOU%?OH3-BrU2z&_M18;%_a0EO7 zX29m7jQs>Y2k(OpSOCv~y z$jF~ZgFKaUsmMfMD$}!mj?Nos+9rbiF4GLP2hA~lDCfA$d9TX)Rf!(y>Z|xD(*_@h z=lrV6)bxznK0kcDImyp{ylF1GG#B%3l}LoU!fe~U1K6x;Bg^$t%hZiExrD)0DODy? z6R%~yAZ>+gjIVIvyt6pI=7O0aYiCYhJAHC4iL+|WU!Ewh-LJKe0UJ!o4z_V-lOKy3 zAHWAcdeqj#B^&ZF_j))^i(F|QMQxWt!_yHP()5E}W_Ny5sJyR4S~kia$xN(Rky=%< zK25DSAxf!*mdjF=ah{p`K5;UdpC9`Oy-d|!j&X-NSL>#m&98lEBUm1784_m$sbbAT zk7gbwptTle;BXg?Q@arA#hgk!#E!F~(xrU@Y(=-uCD*hPmkZg6MRH#CP0YzWwc2pr z$+KSEk3^E>!=v=&stxU{=+ZK4)V7BS>q{T8eXn|Jl*B8xl#A{G zzF>2zl+dO+AxBj)-JY^uc*8#nhPTY=*qIA;=-E30^PD6;itTmt5hUQcr)CiwkD8S zKxO2%wZ+|7HKt!Eg*nDUeTA6=_jB(2`-p{B&WEuc_?l15j90qv7+$%}6=au%y>!{W y?ELgDiP2d<)+{79?J?idNF_9eXC$15*I_t!gWQ>!!N2Ryu|#UT-OK}bmi-Gc7XuIg literal 0 HcmV?d00001 diff --git a/hosts/default.nix b/hosts/default.nix index 37586ae..c30c9a6 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -65,11 +65,24 @@ rec { ./arcadia/home-manager.nix ]; }; + fungus = mkHost { + system = "x86_64-linux"; + hostname = "Fungus"; + username = "hare"; + systemModules = [ + ./fungus/nixos.nix + ]; + homeModule = [ + ./fungus/home-manager.nix + ]; + }; }; nixos = { arcadia = hosts.arcadia.nixos; + fungus = hosts.fungus.nixos; }; home-manager = { arcadia = hosts.arcadia.home-manager; + fungus = hosts.fungus.home-manager; }; } diff --git a/hosts/fungus/hardware-configuration.nix b/hosts/fungus/hardware-configuration.nix new file mode 100644 index 0000000..6234d6f --- /dev/null +++ b/hosts/fungus/hardware-configuration.nix @@ -0,0 +1,32 @@ +# 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" "usbhid" "usb_storage" "sd_mod" "sr_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/e4eb343c-d88f-4d63-99aa-c2c41d8580db"; + fsType = "ext4"; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp3s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/fungus/home-manager.nix b/hosts/fungus/home-manager.nix new file mode 100644 index 0000000..2f414d2 --- /dev/null +++ b/hosts/fungus/home-manager.nix @@ -0,0 +1,43 @@ +{ conifg, pkgs, ... }: +{ + imports = [ + ../../home-manager/hyprland.nix + ../../home-manager/tofi.nix + ../../home-manager/direnv.nix + ]; + home.packages = with pkgs; [ + vscode + vivaldi + discord + helvum + obs-studio + superfile + plemoljp + plemoljp-nf + prismlauncher + scrcpy + tetrio-desktop + kicad + blender-hip + gimp + inkscape + obsidian + zed-editor + easyeffects + ]; + programs.git = { + enable = true; + userName = "Hare"; + userEmail = "kei.hiracchi.0928@gmail.com"; + }; + + fonts = { + fontconfig = { + defaultFonts = { + serif = [ "Noto Serif" ]; + sansSerif = [ "Noto Sans" ]; + monospace = [ "PlemolJP NF Console" ]; + }; + }; + }; +} diff --git a/hosts/fungus/nixos.nix b/hosts/fungus/nixos.nix new file mode 100644 index 0000000..5925e48 --- /dev/null +++ b/hosts/fungus/nixos.nix @@ -0,0 +1,41 @@ +{ + config, + pkgs, + username, + ... +}: +{ + system.stateVersion = "24.11"; + + imports = [ + ./hardware-configuration.nix + + ../../system/core + ../../programs/ssh.nix + ../../programs/utility.nix + ../../programs/shell.nix + ../../programs/docker.nix + ]; + environment.systemPackages = with pkgs; [ + ]; + + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + users.users.${username} = { + extraGroups = [ + "docker" + ]; + shell = pkgs.fish; + openssh.authorizedKeys.keys = [ + ]; + }; + programs.nix-ld.enable = true; + + services.openssh.enable = true; + + networking.firewall.allowedTCPPorts = [ + 22 + ]; + networking.firewall.allowedUDPPorts = [ ]; +} From 92bd37ab7163490d919e9b7d2579dd60a67229fd Mon Sep 17 00:00:00 2001 From: Hare Date: Sat, 22 Feb 2025 00:10:29 +0900 Subject: [PATCH 10/28] fungus: change boot settings --- hosts/fungus/home-manager.nix | 20 -------------------- hosts/fungus/nixos.nix | 7 ++++++- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/hosts/fungus/home-manager.nix b/hosts/fungus/home-manager.nix index 2f414d2..9110720 100644 --- a/hosts/fungus/home-manager.nix +++ b/hosts/fungus/home-manager.nix @@ -1,29 +1,9 @@ { conifg, pkgs, ... }: { imports = [ - ../../home-manager/hyprland.nix - ../../home-manager/tofi.nix ../../home-manager/direnv.nix ]; home.packages = with pkgs; [ - vscode - vivaldi - discord - helvum - obs-studio - superfile - plemoljp - plemoljp-nf - prismlauncher - scrcpy - tetrio-desktop - kicad - blender-hip - gimp - inkscape - obsidian - zed-editor - easyeffects ]; programs.git = { enable = true; diff --git a/hosts/fungus/nixos.nix b/hosts/fungus/nixos.nix index 5925e48..750e92e 100644 --- a/hosts/fungus/nixos.nix +++ b/hosts/fungus/nixos.nix @@ -19,7 +19,9 @@ environment.systemPackages = with pkgs; [ ]; - boot.loader.systemd-boot.enable = true; + boot.loader.grub.enable = true; + boot.loader.grub.device = "/dev/sda"; + boot.loader.grub.useOSProber = true; boot.loader.efi.canTouchEfiVariables = true; users.users.${username} = { @@ -28,6 +30,8 @@ ]; shell = pkgs.fish; openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBd45JtvgM44KUqhp3Xl2Wtt6rmxU13c/84YLyGKigkG hare@nixos" + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDZTkjrLwH+jsSHF/LI23+WPQ9rff9vWBH1VaxSjNADIIKDY7vGkWWRUCImt8QTzied3mNFv+EyZ8igiJdm5tEO1KkrWUqTZk5Ut79LTQftB23SDNC8XzuHKxwaKHdwZIP065biRFUqNYHu8h0EHKbQ3Djj6cZYBcEL1JOc0wtm4jmuW6Fp3rCn/ZCo0g3Kg7SfY4cpf4fJTB97bIjPJzG7JSSOuTkJcDQzFrySUPOpgrt5+iSqKJ/tQtfxLHcNq8AMrh1fH6sUzaJLmMs/7V9LTbsbILTY4YQj5FF07dBqEJBwvZ9sRTPPzl/HSdVmp9OlCZnryPbjTKJmK1Nxx+tOZfh4IY3mWWnEegvDNCYwKJu+d+zeqDaSUMx0kpAnK9PLSI0By8FtboRVvSFSce6FouiUhEzJyKXAr3E1JCgQXdLcTTb66rbBcauuqhuieKDGPpz45EbFi83uHNeDodi5b75h5r1Nn+oJmzagwUAoyw4gCCbiYwTAe3GA79LK7kE= hare@hr-r620" ]; }; programs.nix-ld.enable = true; @@ -36,6 +40,7 @@ networking.firewall.allowedTCPPorts = [ 22 + 25565 ]; networking.firewall.allowedUDPPorts = [ ]; } From 9ac4e308f63d011402d0e99eaa5407c825e01139 Mon Sep 17 00:00:00 2001 From: Hare Date: Sat, 4 Oct 2025 02:58:56 +0900 Subject: [PATCH 11/28] 20205-10-04 --- flake.lock | 55 +++++++++++++--- flake.nix | 6 +- home-manager/blender.nix | 9 +++ home-manager/code-cursor.nix | 6 ++ home-manager/hyprland.nix | 43 +++++++++++-- home-manager/vscode.nix | 11 ++++ hosts/.default.nix.swp | Bin 12288 -> 0 bytes hosts/arcadia/display.nix | 5 +- hosts/arcadia/hardware-configuration.nix | 13 +++- hosts/arcadia/home-manager.nix | 27 ++++++-- hosts/arcadia/nixos.nix | 78 +++++++++++++++++++---- hosts/default.nix | 1 - hosts/fungus/hardware-configuration.nix | 32 +++++++--- hosts/fungus/home-manager.nix | 1 + hosts/fungus/nixos.nix | 2 +- programs/fcitx.nix | 2 + programs/utility.nix | 7 +- programs/v4l2.nix | 2 +- system/core/sound.nix | 8 +++ 19 files changed, 253 insertions(+), 55 deletions(-) create mode 100644 home-manager/blender.nix create mode 100644 home-manager/code-cursor.nix create mode 100644 home-manager/vscode.nix delete mode 100644 hosts/.default.nix.swp diff --git a/flake.lock b/flake.lock index 8ce4779..a5167e5 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1738448366, - "narHash": "sha256-4ATtQqBlgsGqkHTemta0ydY6f7JBRXz4Hf574NHQpkg=", + "lastModified": 1759261733, + "narHash": "sha256-G104PUPKBgJmcu4NWs0LUaPpSOTD4jiq4mamLWu3Oc0=", "owner": "nix-community", "repo": "home-manager", - "rev": "18fa9f323d8adbb0b7b8b98a8488db308210ed93", + "rev": "5a21f4819ee1be645f46d6b255d49f4271ef6723", "type": "github" }, "original": { @@ -22,11 +22,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1738471961, - "narHash": "sha256-cgXDFrplNGs7bCVzXhRofjD8oJYqqXGcmUzXjHmip6Y=", + "lastModified": 1759261527, + "narHash": "sha256-wPd5oGvBBpUEzMF0kWnXge0WITNsITx/aGI9qLHgJ4g=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "537286c3c59b40311e5418a180b38034661d2536", + "rev": "e087756cf4abbe1a34f3544c480fc1034d68742f", "type": "github" }, "original": { @@ -37,11 +37,27 @@ }, "nixpkgs": { "locked": { - "lastModified": 1738410390, - "narHash": "sha256-xvTo0Aw0+veek7hvEVLzErmJyQkEcRk6PSR4zsRQFEc=", + "lastModified": 1759036355, + "narHash": "sha256-0m27AKv6ka+q270dw48KflE0LwQYrO7Fm4/2//KCVWg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e9f00bd893984bc8ce46c895c3bf7cac95331127", + "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": "3a228057f5b619feb3186e986dbe76278d707b6e", + "rev": "1925c603f17fc89f4c8f6bf6f631a802ad85d784", "type": "github" }, "original": { @@ -55,7 +71,26 @@ "inputs": { "home-manager": "home-manager", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "zen-browser": "zen-browser" + } + }, + "zen-browser": { + "inputs": { + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1754251351, + "narHash": "sha256-k9ZxAmwu7DfLGW6Z6910XsSyi5V9LEIdaYxe86PeEKE=", + "owner": "xaragon", + "repo": "zen-browser-flake", + "rev": "0db16223c3dc3e9337051e440c305a85b4bc3437", + "type": "github" + }, + "original": { + "owner": "xaragon", + "repo": "zen-browser-flake", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index c59ff00..0eaa4b1 100644 --- a/flake.nix +++ b/flake.nix @@ -2,16 +2,18 @@ description = "my config flake"; inputs = { - nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; home-manager.url = "github:nix-community/home-manager"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; nixos-hardware.url = "github:NixOS/nixos-hardware"; + + zen-browser.url = "github:xaragon/zen-browser-flake"; }; outputs = inputs: { nixosConfigurations = (import ./hosts inputs).nixos; homeConfigurations = (import ./hosts inputs).home-manager; }; -} \ No newline at end of file +} diff --git a/home-manager/blender.nix b/home-manager/blender.nix new file mode 100644 index 0000000..40f5ace --- /dev/null +++ b/home-manager/blender.nix @@ -0,0 +1,9 @@ +{ pkgs, ... }: +{ + home.packages = with pkgs; [ + (pkgs.blender-hip.overrideAttrs (oldAttrs: { + # Workaround for this: https://github.com/NixOS/nixpkgs/pull/385913 + cmakeFlags = oldAttrs.cmakeFlags ++ [ "-DWITH_ASSERT_ABORT=OFF" ]; + })) + ]; +} \ No newline at end of file diff --git a/home-manager/code-cursor.nix b/home-manager/code-cursor.nix new file mode 100644 index 0000000..da2368b --- /dev/null +++ b/home-manager/code-cursor.nix @@ -0,0 +1,6 @@ +{ pkgs, ... }: +{ + home.packages = with pkgs; [ + code-cursor + ]; +} diff --git a/home-manager/hyprland.nix b/home-manager/hyprland.nix index d36878b..e61a03e 100644 --- a/home-manager/hyprland.nix +++ b/home-manager/hyprland.nix @@ -1,4 +1,5 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +{ wayland.windowManager.hyprland = { enable = true; systemd.enable = false; @@ -23,6 +24,8 @@ "dconf write /org/gnome/desktop/interface/monospace-font-name 'Noto Sans Mono Medium 11'" ]; + ecosystem.no_update_news = true; + input = { kb_layout = "us"; kb_variant = ""; @@ -41,10 +44,10 @@ }; general = { - gaps_in = 8; - gaps_out = 10; - border_size = 4; - "col.active_border" = "rgba(6e848cee) rgba(ffffffee) 45deg"; + gaps_in = 4; + gaps_out = 7; + border_size = 3; + "col.active_border" = "rgba(6e848cee) rgba(eeeeffee) 90deg"; "col.inactive_border" = "rgba(595959aa)"; layout = "dwindle"; allow_tearing = true; @@ -101,6 +104,7 @@ "float,title:^(Picture.*)$" "pin,title:^(Picture.*)$" "immediate, class:^(Terraria)$" + "idleinhibit fullscreen, class:^(steam_app.*)$" ]; workspace = [ @@ -184,9 +188,13 @@ plugins = [ ]; }; + home.packages = with pkgs; [ + swww + eww + ]; home.sessionVariables = { - HYPRCURSOR_THEME = ""; - HYPRCURSOR_SIZE = "12"; + HYPRCURSOR_THEME = "rose-pine-hyprcursor"; + HYPRCURSOR_SIZE = "24"; XCURSOR_SIZE = "24"; GTK_BACKEND = "wayland"; QT_QPA_PLATFORM = "wayland;xcb"; @@ -195,4 +203,25 @@ XDG_CURRENT_DESKTOP = "Hyprland"; XDG_SESSION_DESKTOP = "Hyprland"; }; + services.fnott = { + enable = true; + settings = { + main = { + anchor = "bottom-right"; + min-width = 400; + + title-font = "Noto Sans Medium:size=12"; + title-color = "ffffffff"; + title-format = "%a%A"; + summary-font = "Noto Sans Regular:size=16"; + summary-color = "ffffffff"; + summary-format = "%s\n"; + body-font = "Noto Sans Regular:size=14"; + body-color = "ffffffff"; + body-format = "%b"; + background = "1a1a1aee"; + border-radius = 10; + }; + }; + }; } diff --git a/home-manager/vscode.nix b/home-manager/vscode.nix new file mode 100644 index 0000000..419cbc6 --- /dev/null +++ b/home-manager/vscode.nix @@ -0,0 +1,11 @@ +{ pkgs, ... }: +{ + programs.vscode = { + enable = true; + package = pkgs.vscode.fhs; + profiles.default = { + extensions = with pkgs.vscode-extensions; [ + ]; + }; + }; +} diff --git a/hosts/.default.nix.swp b/hosts/.default.nix.swp deleted file mode 100644 index 2e28a49fb979740abb279b32ed4eb39ec9fe9c93..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI2%ZnUE9LFnrS~c;N1VTV8$Dj$x_GDucVkEF35?^c%hTTgDv390rrrmx~UCr#W zPNIl-2#EiHpa&tB9DRTyUOebU5c~(sLA*qSJqTX>)@!DFHnNgKVBt6L=|^?duYUdc zRW~f#E60~#TjVcB^9;Yo8T)wo>;3}U$1d(>Y#@|0&D;I5cr7ot>xApqO~7_1S6MF+ ztFk@FOI^0RvL~uUM~L!2Vo(<{KnCu^K&5+gXZ9?;aAN+r8U1YQ8NT<)rTYj(L&yLb zAOmE843GgbKnBPF8Q7@?bg_%wK=L#G1}^#iuBp90r5za{17v^ab3;qU*yA7gA2`~mKOU%?OH3-BrU2z&_M18;%_a0EO7 zX29m7jQs>Y2k(OpSOCv~y z$jF~ZgFKaUsmMfMD$}!mj?Nos+9rbiF4GLP2hA~lDCfA$d9TX)Rf!(y>Z|xD(*_@h z=lrV6)bxznK0kcDImyp{ylF1GG#B%3l}LoU!fe~U1K6x;Bg^$t%hZiExrD)0DODy? z6R%~yAZ>+gjIVIvyt6pI=7O0aYiCYhJAHC4iL+|WU!Ewh-LJKe0UJ!o4z_V-lOKy3 zAHWAcdeqj#B^&ZF_j))^i(F|QMQxWt!_yHP()5E}W_Ny5sJyR4S~kia$xN(Rky=%< zK25DSAxf!*mdjF=ah{p`K5;UdpC9`Oy-d|!j&X-NSL>#m&98lEBUm1784_m$sbbAT zk7gbwptTle;BXg?Q@arA#hgk!#E!F~(xrU@Y(=-uCD*hPmkZg6MRH#CP0YzWwc2pr z$+KSEk3^E>!=v=&stxU{=+ZK4)V7BS>q{T8eXn|Jl*B8xl#A{G zzF>2zl+dO+AxBj)-JY^uc*8#nhPTY=*qIA;=-E30^PD6;itTmt5hUQcr)CiwkD8S zKxO2%wZ+|7HKt!Eg*nDUeTA6=_jB(2`-p{B&WEuc_?l15j90qv7+$%}6=au%y>!{W y?ELgDiP2d<)+{79?J?idNF_9eXC$15*I_t!gWQ>!!N2Ryu|#UT-OK}bmi-Gc7XuIg diff --git a/hosts/arcadia/display.nix b/hosts/arcadia/display.nix index 6211044..39d4dd7 100644 --- a/hosts/arcadia/display.nix +++ b/hosts/arcadia/display.nix @@ -2,8 +2,9 @@ wayland.windowManager.hyprland = { settings = { monitor = [ - "DP-2, 2560x1440@144, 0x0, 1" - "DP-1, 1920x1080@120, -1920x180, 1" + "DP-1, 5120x2880@60, 0x0, 2" + "DP-2, 1920x1080@144, 2560x-240, 1, transform, 1" + "HDMI-A-1, 2560x1440@144, -1440x-240, 1, transform, 1" ]; }; }; diff --git a/hosts/arcadia/hardware-configuration.nix b/hosts/arcadia/hardware-configuration.nix index 9810a82..2835087 100644 --- a/hosts/arcadia/hardware-configuration.nix +++ b/hosts/arcadia/hardware-configuration.nix @@ -43,7 +43,16 @@ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; - hardware.opengl = { - enable = true; + hardware.graphics = { + enable = true; + extraPackages = with pkgs; [ + mesa + libva + libvdpau-va-gl + vulkan-loader + vulkan-validation-layers + amdvlk # Optional: AMD's proprietary Vulkan driver + mesa.opencl # Enables Rusticl (OpenCL) support + ]; }; } diff --git a/hosts/arcadia/home-manager.nix b/hosts/arcadia/home-manager.nix index fbe5636..68b9ccc 100644 --- a/hosts/arcadia/home-manager.nix +++ b/hosts/arcadia/home-manager.nix @@ -1,17 +1,20 @@ -{ conifg, pkgs, ... }: +{ pkgs, inputs, ... }: { + home.stateVersion = "25.05"; imports = [ ../../home-manager/hyprland.nix ./display.nix + ../../home-manager/vscode.nix ../../home-manager/tofi.nix ../../home-manager/direnv.nix ../../home-manager/firefox.nix ../../home-manager/obs-studio.nix + ../../home-manager/blender.nix ]; home.packages = with pkgs; [ - vscode vivaldi + google-chrome discord helvum superfile @@ -21,13 +24,29 @@ scrcpy tetrio-desktop kicad - blender-hip gimp inkscape obsidian zed-editor - easyeffects + davinci-resolve + kdePackages.filelight + inputs.zen-browser.packages."${system}".default + (deno.overrideAttrs (oldAttrs: { + doCheck = false; + })) + nodejs_24 + pnpm + godot + nixd + rust-analyzer + beeper + aseprite + zrythm ]; + services.easyeffects = { + enable = true; + }; + programs.git = { enable = true; userName = "Hare"; diff --git a/hosts/arcadia/nixos.nix b/hosts/arcadia/nixos.nix index 29d4280..f049787 100644 --- a/hosts/arcadia/nixos.nix +++ b/hosts/arcadia/nixos.nix @@ -1,11 +1,13 @@ { - config, pkgs, username, ... }: +let + config.boot.kernelPackages = pkgs.linuxPackages_latest; +in { - system.stateVersion = "24.11"; + system.stateVersion = "25.05"; imports = [ ./hardware-configuration.nix @@ -21,9 +23,16 @@ ../../programs/steam.nix ]; environment.systemPackages = with pkgs; [ - deno - nodejs - pnpm + cargo + rustc + rustfmt + openssl + vulkan-tools + android-file-transfer + + rocmPackages.rocm-runtime + rocmPackages.rocminfo + rocmPackages.clr qemu (pkgs.writeShellScriptBin "qemu-system-x86_64-uefi" '' @@ -31,15 +40,16 @@ -bios ${pkgs.OVMF.fd}/FV/OVMF.fd \ "$@" '') + + wineWowPackages.waylandFull + winetricks + + bluez + bluez-tools + bluetuith + obexftp ]; - - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - boot.initrd.kernelModules = [ "amdgpu" ]; - - boot.kernelModules = [ "v4l2loopback" ]; - boot.extraModulePackages = [ pkgs.linuxPackages.v4l2loopback ]; + environment.sessionVariables.NIXOS_OZONE_WL = "1"; users.users.${username} = { extraGroups = [ @@ -48,7 +58,9 @@ ]; shell = pkgs.fish; openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIfql/a6ZtxOPgBhFzOfgTO6HGcy0Se9mgMLmOa40vMF" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIW2Yrqwi4YjIrdI8mygX5pTHDPmrUgbmpZ4WxoTqORi keihi@Vostro-LapTop" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICi8Cciepfs1ikPdfyHjc9qJX5z2QLFF9jBszsyEvCMA nix-on-droid@localhost" ]; }; programs.adb.enable = true; @@ -56,12 +68,52 @@ services.openssh.enable = true; + services.udisks2.enable = true; + networking.firewall.allowedTCPPorts = [ 8080 22 5173 8000 9001 + 11434 ]; networking.firewall.allowedUDPPorts = [ ]; + + services.udev.extraRules = '' + ATTRS{idVendor}=="3151", ATTRS{idProduct}=="502d", MODE="0777" + KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0660", GROUP="input" + ''; + + 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; + + boot.initrd.kernelModules = [ "amdgpu" ]; } diff --git a/hosts/default.nix b/hosts/default.nix index c30c9a6..6de67c0 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -43,7 +43,6 @@ let home = { inherit username; homeDirectory = "/home/${username}"; - stateVersion = "24.11"; }; programs.home-manager.enable = true; } diff --git a/hosts/fungus/hardware-configuration.nix b/hosts/fungus/hardware-configuration.nix index 6234d6f..7bc80b1 100644 --- a/hosts/fungus/hardware-configuration.nix +++ b/hosts/fungus/hardware-configuration.nix @@ -1,22 +1,34 @@ -# 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, ... }: +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sr_mod" ]; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "usbhid" + "usb_storage" + "sd_mod" + "sr_mod" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/e4eb343c-d88f-4d63-99aa-c2c41d8580db"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/e4eb343c-d88f-4d63-99aa-c2c41d8580db"; + fsType = "ext4"; + }; swapDevices = [ ]; diff --git a/hosts/fungus/home-manager.nix b/hosts/fungus/home-manager.nix index 9110720..3822e28 100644 --- a/hosts/fungus/home-manager.nix +++ b/hosts/fungus/home-manager.nix @@ -1,5 +1,6 @@ { conifg, pkgs, ... }: { + home.stateVersion = "25.05"; imports = [ ../../home-manager/direnv.nix ]; diff --git a/hosts/fungus/nixos.nix b/hosts/fungus/nixos.nix index 750e92e..51effa5 100644 --- a/hosts/fungus/nixos.nix +++ b/hosts/fungus/nixos.nix @@ -5,7 +5,7 @@ ... }: { - system.stateVersion = "24.11"; + system.stateVersion = "25.05"; imports = [ ./hardware-configuration.nix diff --git a/programs/fcitx.nix b/programs/fcitx.nix index 948081e..7a529b5 100644 --- a/programs/fcitx.nix +++ b/programs/fcitx.nix @@ -6,6 +6,8 @@ fcitx5.addons = with pkgs; [ fcitx5-mozc fcitx5-gtk + fcitx5-rose-pine ]; + fcitx5.waylandFrontend = true; }; } diff --git a/programs/utility.nix b/programs/utility.nix index b2199fb..ed3ebe8 100644 --- a/programs/utility.nix +++ b/programs/utility.nix @@ -1,12 +1,15 @@ { pkgs, ... }: { environment.systemPackages = with pkgs; [ + tmux zip unzip + rar ripgrep btop-rocm bat - wezterm + libsixel nixfmt-rfc-style - ];} + ]; +} diff --git a/programs/v4l2.nix b/programs/v4l2.nix index 87e7864..6bdbd21 100644 --- a/programs/v4l2.nix +++ b/programs/v4l2.nix @@ -5,6 +5,6 @@ ffmpeg ]; boot.extraModprobeConfig = '' - options v4l2loopback devices=2 video_nr=0,1 card_label="Scrcpy Source","OBS VirtualCamera" exclusive_caps=1 + options v4l2loopback devices=2 video_nr=0,1 card_label="Scrcpy Source,OBS VirtualCamera" exclusive_caps=1 ''; } diff --git a/system/core/sound.nix b/system/core/sound.nix index e372d47..ea8c2e6 100644 --- a/system/core/sound.nix +++ b/system/core/sound.nix @@ -5,5 +5,13 @@ 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; + }; + }; }; } From 9875eaf3096a6e464af74d707d0336fe859c64c8 Mon Sep 17 00:00:00 2001 From: Hare Date: Thu, 25 Dec 2025 18:37:54 +0900 Subject: [PATCH 12/28] 2025-12-25 --- flake.lock | 24 ++++++------- hosts/arcadia/display.nix | 4 +-- hosts/arcadia/hardware-configuration.nix | 2 +- hosts/arcadia/home-manager.nix | 20 +++++++---- hosts/arcadia/nixos.nix | 7 +++- system/core/default.nix | 2 +- system/core/fonts.nix | 2 +- system/core/greeter.nix | 45 ++++++++++++++++++++++++ system/core/regreet.nix | 24 ------------- 9 files changed, 82 insertions(+), 48 deletions(-) create mode 100644 system/core/greeter.nix delete mode 100644 system/core/regreet.nix diff --git a/flake.lock b/flake.lock index a5167e5..4f03dc7 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1759261733, - "narHash": "sha256-G104PUPKBgJmcu4NWs0LUaPpSOTD4jiq4mamLWu3Oc0=", + "lastModified": 1766387499, + "narHash": "sha256-AjK3/UKDzeXFeYNLVBaJ3+HLE9he1g5UrlNd4/BM3eA=", "owner": "nix-community", "repo": "home-manager", - "rev": "5a21f4819ee1be645f46d6b255d49f4271ef6723", + "rev": "527ad07e6625302b648ed3b28c34b62a79bd103e", "type": "github" }, "original": { @@ -22,11 +22,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1759261527, - "narHash": "sha256-wPd5oGvBBpUEzMF0kWnXge0WITNsITx/aGI9qLHgJ4g=", + "lastModified": 1764440730, + "narHash": "sha256-ZlJTNLUKQRANlLDomuRWLBCH5792x+6XUJ4YdFRjtO4=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "e087756cf4abbe1a34f3544c480fc1034d68742f", + "rev": "9154f4569b6cdfd3c595851a6ba51bfaa472d9f3", "type": "github" }, "original": { @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1759036355, - "narHash": "sha256-0m27AKv6ka+q270dw48KflE0LwQYrO7Fm4/2//KCVWg=", + "lastModified": 1766309749, + "narHash": "sha256-3xY8CZ4rSnQ0NqGhMKAy5vgC+2IVK0NoVEzDoOh4DA4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e9f00bd893984bc8ce46c895c3bf7cac95331127", + "rev": "a6531044f6d0bef691ea18d4d4ce44d0daa6e816", "type": "github" }, "original": { @@ -80,11 +80,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1754251351, - "narHash": "sha256-k9ZxAmwu7DfLGW6Z6910XsSyi5V9LEIdaYxe86PeEKE=", + "lastModified": 1761859251, + "narHash": "sha256-+Kxwwlis5m8b69DBQ42wxM0f7sKCa7RRy5ADCMEI1Ss=", "owner": "xaragon", "repo": "zen-browser-flake", - "rev": "0db16223c3dc3e9337051e440c305a85b4bc3437", + "rev": "20dbd219c8238f297d53603b5f0001167a35ce51", "type": "github" }, "original": { diff --git a/hosts/arcadia/display.nix b/hosts/arcadia/display.nix index 39d4dd7..3b8ae77 100644 --- a/hosts/arcadia/display.nix +++ b/hosts/arcadia/display.nix @@ -3,8 +3,8 @@ settings = { monitor = [ "DP-1, 5120x2880@60, 0x0, 2" - "DP-2, 1920x1080@144, 2560x-240, 1, transform, 1" - "HDMI-A-1, 2560x1440@144, -1440x-240, 1, transform, 1" + "DP-2, 2560x1440@144, 2560x0, 1, transform, 0" + "DP-3, 1920x1080@144, -1080x-240, 1, transform, 1" ]; }; }; diff --git a/hosts/arcadia/hardware-configuration.nix b/hosts/arcadia/hardware-configuration.nix index 2835087..43af020 100644 --- a/hosts/arcadia/hardware-configuration.nix +++ b/hosts/arcadia/hardware-configuration.nix @@ -51,8 +51,8 @@ libvdpau-va-gl vulkan-loader vulkan-validation-layers - amdvlk # Optional: AMD's proprietary Vulkan driver mesa.opencl # Enables Rusticl (OpenCL) support + rocmPackages.clr.icd ]; }; } diff --git a/hosts/arcadia/home-manager.nix b/hosts/arcadia/home-manager.nix index 68b9ccc..4fcb38b 100644 --- a/hosts/arcadia/home-manager.nix +++ b/hosts/arcadia/home-manager.nix @@ -17,7 +17,6 @@ google-chrome discord helvum - superfile plemoljp plemoljp-nf prismlauncher @@ -28,20 +27,29 @@ inkscape obsidian zed-editor - davinci-resolve + # davinci-resolve kdePackages.filelight inputs.zen-browser.packages."${system}".default (deno.overrideAttrs (oldAttrs: { doCheck = false; })) nodejs_24 - pnpm godot + unityhub nixd rust-analyzer beeper aseprite - zrythm + bambu-studio + orca-slicer + + # voicevox-core + # voicevox-engine + # voicevox + + vinegar + + antigravity ]; services.easyeffects = { enable = true; @@ -49,8 +57,8 @@ programs.git = { enable = true; - userName = "Hare"; - userEmail = "kei.hiracchi.0928@gmail.com"; + settings.user.name = "Hare"; + settings.user.email = "kei.hiracchi.0928@gmail.com"; }; fonts = { diff --git a/hosts/arcadia/nixos.nix b/hosts/arcadia/nixos.nix index f049787..ab8e91c 100644 --- a/hosts/arcadia/nixos.nix +++ b/hosts/arcadia/nixos.nix @@ -7,7 +7,7 @@ let config.boot.kernelPackages = pkgs.linuxPackages_latest; in { - system.stateVersion = "25.05"; + system.stateVersion = "25.11"; imports = [ ./hardware-configuration.nix @@ -48,6 +48,8 @@ in bluez-tools bluetuith obexftp + fzf + ghq ]; environment.sessionVariables.NIXOS_OZONE_WL = "1"; @@ -76,12 +78,14 @@ in 5173 8000 9001 + 2222 # crtb server 11434 ]; networking.firewall.allowedUDPPorts = [ ]; services.udev.extraRules = '' ATTRS{idVendor}=="3151", ATTRS{idProduct}=="502d", MODE="0777" + ATTRS{idVendor}=="414", ATTRS{idProduct}=="211a", MODE="0777" KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0660", GROUP="input" ''; @@ -116,4 +120,5 @@ in boot.loader.efi.canTouchEfiVariables = true; boot.initrd.kernelModules = [ "amdgpu" ]; + } diff --git a/system/core/default.nix b/system/core/default.nix index 738833e..2fb0acc 100644 --- a/system/core/default.nix +++ b/system/core/default.nix @@ -8,6 +8,6 @@ ./sound.nix ./uwsm.nix - ./regreet.nix + ./greeter.nix ]; } diff --git a/system/core/fonts.nix b/system/core/fonts.nix index 5fc22be..b5dc10b 100644 --- a/system/core/fonts.nix +++ b/system/core/fonts.nix @@ -4,7 +4,7 @@ packages = with pkgs; [ noto-fonts noto-fonts-cjk-sans - noto-fonts-emoji + noto-fonts-color-emoji ibm-plex ]; fontconfig = { diff --git a/system/core/greeter.nix b/system/core/greeter.nix new file mode 100644 index 0000000..a67df49 --- /dev/null +++ b/system/core/greeter.nix @@ -0,0 +1,45 @@ +{ config, pkgs, ... }: +let + hyprGreetConf = pkgs.writeText "hyprland-greetd.conf" '' + monitor = DP-1, 5120x2880@60, 0x0, 2 + + monitor = DP-2, disable + monitor = DP-3, disable + + exec-once = ${config.programs.regreet.package or pkgs.regreet}/bin/regreet; hyprctl dispatch exit + ''; +in +{ + services.greetd.enable = true; + services.greetd.settings.default_session = { + command = "${pkgs.hyprland}/bin/Hyprland --config ${hyprGreetConf}"; + user = "greeter"; + }; + + 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"; + }; + }; + }; +} diff --git a/system/core/regreet.nix b/system/core/regreet.nix deleted file mode 100644 index 9e9d86c..0000000 --- a/system/core/regreet.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ - programs.regreet = { - enable = true; - 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"; - }; - }; - }; -} From 8cacd2eea40855e52ad2cea27909cc1cd49e87ed Mon Sep 17 00:00:00 2001 From: Hare Date: Sat, 3 Jan 2026 22:04:35 +0900 Subject: [PATCH 13/28] x1carbon --- flake.lock | 18 ++--- home-manager/hyprland-theme-thin.nix | 47 +++++++++++ hosts/arcadia/nixos.nix | 3 +- hosts/default.nix | 13 +++ hosts/x1carbon/hardware-configuration.nix | 31 +++++++ hosts/x1carbon/home-manager.nix | 58 ++++++++++++++ hosts/x1carbon/nixos.nix | 98 +++++++++++++++++++++++ system/core/uwsm.nix | 1 - 8 files changed, 258 insertions(+), 11 deletions(-) create mode 100644 home-manager/hyprland-theme-thin.nix create mode 100644 hosts/x1carbon/hardware-configuration.nix create mode 100644 hosts/x1carbon/home-manager.nix create mode 100644 hosts/x1carbon/nixos.nix diff --git a/flake.lock b/flake.lock index 4f03dc7..7f95e59 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1766387499, - "narHash": "sha256-AjK3/UKDzeXFeYNLVBaJ3+HLE9he1g5UrlNd4/BM3eA=", + "lastModified": 1767391542, + "narHash": "sha256-qHXxJuFkQhggyeao/kQb6KcOjgz0Ky+ArfowRX1MHaE=", "owner": "nix-community", "repo": "home-manager", - "rev": "527ad07e6625302b648ed3b28c34b62a79bd103e", + "rev": "2f06b726061b7e1aa69f718e943da9ffcecd6397", "type": "github" }, "original": { @@ -22,11 +22,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1764440730, - "narHash": "sha256-ZlJTNLUKQRANlLDomuRWLBCH5792x+6XUJ4YdFRjtO4=", + "lastModified": 1767185284, + "narHash": "sha256-ljDBUDpD1Cg5n3mJI81Hz5qeZAwCGxon4kQW3Ho3+6Q=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "9154f4569b6cdfd3c595851a6ba51bfaa472d9f3", + "rev": "40b1a28dce561bea34858287fbb23052c3ee63fe", "type": "github" }, "original": { @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1766309749, - "narHash": "sha256-3xY8CZ4rSnQ0NqGhMKAy5vgC+2IVK0NoVEzDoOh4DA4=", + "lastModified": 1767116409, + "narHash": "sha256-5vKw92l1GyTnjoLzEagJy5V5mDFck72LiQWZSOnSicw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a6531044f6d0bef691ea18d4d4ce44d0daa6e816", + "rev": "cad22e7d996aea55ecab064e84834289143e44a0", "type": "github" }, "original": { diff --git a/home-manager/hyprland-theme-thin.nix b/home-manager/hyprland-theme-thin.nix new file mode 100644 index 0000000..eba9f76 --- /dev/null +++ b/home-manager/hyprland-theme-thin.nix @@ -0,0 +1,47 @@ +{ pkgs, lib, ... }: +{ + wayland.windowManager.hyprland = { + settings = { + 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%" + ]; + }; + }; + }; +} diff --git a/hosts/arcadia/nixos.nix b/hosts/arcadia/nixos.nix index ab8e91c..f6de238 100644 --- a/hosts/arcadia/nixos.nix +++ b/hosts/arcadia/nixos.nix @@ -63,7 +63,8 @@ in "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIfql/a6ZtxOPgBhFzOfgTO6HGcy0Se9mgMLmOa40vMF" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIW2Yrqwi4YjIrdI8mygX5pTHDPmrUgbmpZ4WxoTqORi keihi@Vostro-LapTop" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICi8Cciepfs1ikPdfyHjc9qJX5z2QLFF9jBszsyEvCMA nix-on-droid@localhost" - ]; + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID8Eo/QDJtXqluvjNx5ZpeIt0c/yf/Mgr7dKhNWAICZX hare@x1carbon" + ]; }; programs.adb.enable = true; programs.nix-ld.enable = true; diff --git a/hosts/default.nix b/hosts/default.nix index 6de67c0..a496a9c 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -64,6 +64,17 @@ rec { ./arcadia/home-manager.nix ]; }; + x1carbon = mkHost { + system = "x86_64-linux"; + hostname = "x1carbon"; + username = "hare"; + systemModules = [ + ./x1carbon/nixos.nix + ]; + homeModule = [ + ./x1carbon/home-manager.nix + ]; + }; fungus = mkHost { system = "x86_64-linux"; hostname = "Fungus"; @@ -79,9 +90,11 @@ rec { nixos = { arcadia = hosts.arcadia.nixos; fungus = hosts.fungus.nixos; + x1carbon = hosts.x1carbon.nixos; }; home-manager = { arcadia = hosts.arcadia.home-manager; fungus = hosts.fungus.home-manager; + x1carbon = hosts.x1carbon.home-manager; }; } diff --git a/hosts/x1carbon/hardware-configuration.nix b/hosts/x1carbon/hardware-configuration.nix new file mode 100644 index 0000000..50fa13e --- /dev/null +++ b/hosts/x1carbon/hardware-configuration.nix @@ -0,0 +1,31 @@ +# 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" "ehci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/92c8bab5-07b9-4394-888d-6cb481972018"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/1711-8E2B"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = [ ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/x1carbon/home-manager.nix b/hosts/x1carbon/home-manager.nix new file mode 100644 index 0000000..c72d282 --- /dev/null +++ b/hosts/x1carbon/home-manager.nix @@ -0,0 +1,58 @@ +{ pkgs, inputs, ... }: +{ + home.stateVersion = "25.05"; + imports = [ + ../../home-manager/hyprland.nix + ../../home-manager/hyprland-theme-thin.nix + + + ../../home-manager/tofi.nix + ../../home-manager/direnv.nix + ../../home-manager/obs-studio.nix + ]; + home.packages = with pkgs; [ + vivaldi + discord + helvum + plemoljp + plemoljp-nf + prismlauncher + scrcpy + gimp + zed-editor + deno + nodejs_latest + # aseprite + ]; + services.easyeffects = { + enable = true; + }; + + programs.git = { + enable = true; + settings.user.name = "Hare"; + settings.user.email = "kei.hiracchi.0928@gmail.com"; + }; + + fonts = { + fontconfig = { + defaultFonts = { + serif = [ "Noto Serif" ]; + sansSerif = [ "Noto Sans" ]; + monospace = [ "PlemolJP NF Console" ]; + }; + }; + }; + + xdg.mimeApps = { + enable = true; + + defaultApplications = { + "text/html" = "vivaldi-stable.desktop"; + "x-scheme-handler/http" = "vivaldi-stable.desktop"; + "x-scheme-handler/https" = "vivaldi-stable.desktop"; + "x-scheme-handler/about" = "vivaldi-stable.desktop"; + "x-scheme-handler/unknown" = "vivaldi-stable.desktop"; + }; + }; +} diff --git a/hosts/x1carbon/nixos.nix b/hosts/x1carbon/nixos.nix new file mode 100644 index 0000000..3fb0a7c --- /dev/null +++ b/hosts/x1carbon/nixos.nix @@ -0,0 +1,98 @@ +{ + 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; [ + openssl + + bluez + bluez-tools + bluetuith + + brightnessctl + + fzf + ghq + ]; + environment.sessionVariables.NIXOS_OZONE_WL = "1"; + + users.users.${username} = { + extraGroups = [ + "adbusers" + "docker" + ]; + shell = pkgs.fish; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIfql/a6ZtxOPgBhFzOfgTO6HGcy0Se9mgMLmOa40vMF" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIW2Yrqwi4YjIrdI8mygX5pTHDPmrUgbmpZ4WxoTqORi keihi@Vostro-LapTop" + ]; + }; + programs.adb.enable = true; + programs.nix-ld.enable = true; + programs.light.enable = true; + + services.openssh.enable = true; + + services.udisks2.enable = true; + + networking.firewall.allowedTCPPorts = [ + 22 + ]; + networking.firewall.allowedUDPPorts = [ ]; + + services.udev.extraRules = '' + ATTRS{idVendor}=="3151", ATTRS{idProduct}=="502d", MODE="0777" + ATTRS{idVendor}=="414", ATTRS{idProduct}=="211a", MODE="0777" + KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0660", GROUP="input" + ''; + + 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; +} diff --git a/system/core/uwsm.nix b/system/core/uwsm.nix index 3bf9939..be70bc7 100644 --- a/system/core/uwsm.nix +++ b/system/core/uwsm.nix @@ -5,7 +5,6 @@ hyprland = { prettyName = "Hyprland"; comment = "Hyprland compositor managed by UWSM"; - binPath = "/run/current-system/sw/bin/Hyprland"; }; }; }; From 5c2ed26f6913475c93a7bfd4fab7a06a1cc08c08 Mon Sep 17 00:00:00 2001 From: Hare Date: Sun, 4 Jan 2026 00:30:45 +0900 Subject: [PATCH 14/28] hypr config --- home-manager/hyprland.nix | 1 - hosts/x1carbon/home-manager.nix | 5 +++-- hosts/x1carbon/nixos.nix | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/home-manager/hyprland.nix b/home-manager/hyprland.nix index e61a03e..bc062b6 100644 --- a/home-manager/hyprland.nix +++ b/home-manager/hyprland.nix @@ -40,7 +40,6 @@ }; natural_scroll = true; - sensitivity = -1.0; }; general = { diff --git a/hosts/x1carbon/home-manager.nix b/hosts/x1carbon/home-manager.nix index c72d282..c8372f3 100644 --- a/hosts/x1carbon/home-manager.nix +++ b/hosts/x1carbon/home-manager.nix @@ -1,11 +1,10 @@ -{ pkgs, inputs, ... }: +{ pkgs, inputs, lib, ... }: { home.stateVersion = "25.05"; imports = [ ../../home-manager/hyprland.nix ../../home-manager/hyprland-theme-thin.nix - ../../home-manager/tofi.nix ../../home-manager/direnv.nix ../../home-manager/obs-studio.nix @@ -44,6 +43,8 @@ }; }; + wayland.windowManager.hyprland.settings.input.sensitivity = -0.5; + xdg.mimeApps = { enable = true; diff --git a/hosts/x1carbon/nixos.nix b/hosts/x1carbon/nixos.nix index 3fb0a7c..5223ae0 100644 --- a/hosts/x1carbon/nixos.nix +++ b/hosts/x1carbon/nixos.nix @@ -60,6 +60,10 @@ in ]; networking.firewall.allowedUDPPorts = [ ]; + services.openvpn.servers = { + homeVPN = { config = '' config /root/nixos/openvpn/homeVPN.conf ''; }; + }; + services.udev.extraRules = '' ATTRS{idVendor}=="3151", ATTRS{idProduct}=="502d", MODE="0777" ATTRS{idVendor}=="414", ATTRS{idProduct}=="211a", MODE="0777" From d9d740223436d0209fb64e88adf84dccf93c96bf Mon Sep 17 00:00:00 2001 From: Hare Date: Sun, 4 Jan 2026 01:32:32 +0900 Subject: [PATCH 15/28] =?UTF-8?q?hypr=E8=A8=AD=E5=AE=9A=E3=81=A8home-manag?= =?UTF-8?q?er=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flake.lock | 34 ++++ flake.nix | 28 ++- home-manager/fnott.nix | 81 +++++++++ home-manager/hyprland-theme-thin.nix | 47 ----- home-manager/hyprland.nix | 226 ------------------------ home-manager/hyprland/default.nix | 239 ++++++++++++++++++++++++++ home-manager/hyprland/styles/thin.nix | 43 +++++ hosts/arcadia/home-manager.nix | 16 +- hosts/default.nix | 3 +- hosts/x1carbon/home-manager.nix | 18 +- 10 files changed, 446 insertions(+), 289 deletions(-) create mode 100644 home-manager/fnott.nix delete mode 100644 home-manager/hyprland-theme-thin.nix delete mode 100644 home-manager/hyprland.nix create mode 100644 home-manager/hyprland/default.nix create mode 100644 home-manager/hyprland/styles/thin.nix diff --git a/flake.lock b/flake.lock index 7f95e59..1ef8dbb 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,23 @@ { "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": [ @@ -69,12 +87,28 @@ }, "root": { "inputs": { + "flake-utils": "flake-utils", "home-manager": "home-manager", "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" diff --git a/flake.nix b/flake.nix index 0eaa4b1..16637af 100644 --- a/flake.nix +++ b/flake.nix @@ -7,13 +7,31 @@ 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"; }; - outputs = inputs: { - nixosConfigurations = (import ./hosts inputs).nixos; - homeConfigurations = (import ./hosts inputs).home-manager; - }; + 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"; + }; + } + )); } diff --git a/home-manager/fnott.nix b/home-manager/fnott.nix new file mode 100644 index 0000000..04e37df --- /dev/null +++ b/home-manager/fnott.nix @@ -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 = "auto"; + }; + + low = { + timeout = 4; + border-color = "232327ff"; + }; + + normal = { + timeout = 7; + border-color = "2a2a2fff"; + }; + + critical = { + timeout = 0; + border-color = "6a6a6fff"; + border-size = 2; + background = "101012f2"; + }; + }; + }; + + home.packages = with pkgs; [ + papirus-icon-theme + ]; +} diff --git a/home-manager/hyprland-theme-thin.nix b/home-manager/hyprland-theme-thin.nix deleted file mode 100644 index eba9f76..0000000 --- a/home-manager/hyprland-theme-thin.nix +++ /dev/null @@ -1,47 +0,0 @@ -{ pkgs, lib, ... }: -{ - wayland.windowManager.hyprland = { - settings = { - 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%" - ]; - }; - }; - }; -} diff --git a/home-manager/hyprland.nix b/home-manager/hyprland.nix deleted file mode 100644 index bc062b6..0000000 --- a/home-manager/hyprland.nix +++ /dev/null @@ -1,226 +0,0 @@ -{ pkgs, ... }: -{ - wayland.windowManager.hyprland = { - enable = true; - systemd.enable = false; - settings = { - 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 = [ - "swww img /usr/share/wallpaper/arknights-02.jpg" - "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'" - ]; - - ecosystem.no_update_news = true; - - input = { - kb_layout = "us"; - kb_variant = ""; - kb_model = ""; - kb_options = ""; - kb_rules = ""; - - follow_mouse = true; - - touchpad = { - natural_scroll = true; - }; - - natural_scroll = true; - }; - - general = { - gaps_in = 4; - gaps_out = 7; - border_size = 3; - "col.active_border" = "rgba(6e848cee) rgba(eeeeffee) 90deg"; - "col.inactive_border" = "rgba(595959aa)"; - layout = "dwindle"; - allow_tearing = true; - }; - - 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%" - ]; - }; - - dwindle = { - pseudotile = true; - preserve_split = true; - }; - - misc = { - force_default_wallpaper = false; - disable_hyprland_logo = false; - }; - - windowrulev2 = [ - "animation windowsIn 0,title:^(.*wofi.*)$" - "float,title:^(.*feh.*)$" - "center,title:^(.*feh.*)$" - "float,title:^(Picture.*)$" - "pin,title:^(Picture.*)$" - "immediate, class:^(Terraria)$" - "idleinhibit fullscreen, class:^(steam_app.*)$" - ]; - - 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 - ) - ); - }; - plugins = [ - ]; - }; - home.packages = with pkgs; [ - swww - eww - ]; - 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"; - XDG_SESSION_TYPE = "wayland"; - XDG_CURRENT_DESKTOP = "Hyprland"; - XDG_SESSION_DESKTOP = "Hyprland"; - }; - services.fnott = { - enable = true; - settings = { - main = { - anchor = "bottom-right"; - min-width = 400; - - title-font = "Noto Sans Medium:size=12"; - title-color = "ffffffff"; - title-format = "%a%A"; - summary-font = "Noto Sans Regular:size=16"; - summary-color = "ffffffff"; - summary-format = "%s\n"; - body-font = "Noto Sans Regular:size=14"; - body-color = "ffffffff"; - body-format = "%b"; - background = "1a1a1aee"; - border-radius = 10; - }; - }; - }; -} diff --git a/home-manager/hyprland/default.nix b/home-manager/hyprland/default.nix new file mode 100644 index 0000000..730ed5c --- /dev/null +++ b/home-manager/hyprland/default.nix @@ -0,0 +1,239 @@ +{ + pkgs, + lib, + config, + ... +}: +let + inherit (lib) mkOption recursiveUpdate types; + + defaultInput = { + kb_layout = "us"; + kb_variant = ""; + kb_model = ""; + kb_options = ""; + kb_rules = ""; + + follow_mouse = true; + + touchpad = { + natural_scroll = true; + }; + + natural_scroll = true; + sensitivity = 0.0; + }; + + 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 = [ + "swww img /usr/share/wallpaper/arknights-02.jpg" + "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'" + ]; + + 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 = false; + }; + + windowrulev2 = [ + "animation windowsIn 0,title:^(.*wofi.*)$" + "float,title:^(.*feh.*)$" + "center,title:^(.*feh.*)$" + "float,title:^(Picture.*)$" + "pin,title:^(Picture.*)$" + "immediate, class:^(Terraria)$" + "idleinhibit fullscreen, class:^(steam_app.*)$" + ]; + + 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)."; + }; + + config = { + wayland.windowManager.hyprland = { + enable = true; + systemd.enable = false; + settings = recursiveUpdate (recursiveUpdate baseSettings styleSettings) { + input = inputSettings; + }; + plugins = [ + ]; + }; + home.packages = with pkgs; [ + swww + eww + ]; + 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"; + XDG_SESSION_TYPE = "wayland"; + XDG_CURRENT_DESKTOP = "Hyprland"; + XDG_SESSION_DESKTOP = "Hyprland"; + }; + }; +} diff --git a/home-manager/hyprland/styles/thin.nix b/home-manager/hyprland/styles/thin.nix new file mode 100644 index 0000000..cce0938 --- /dev/null +++ b/home-manager/hyprland/styles/thin.nix @@ -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%" + ]; + }; +} diff --git a/hosts/arcadia/home-manager.nix b/hosts/arcadia/home-manager.nix index 4fcb38b..53c8e97 100644 --- a/hosts/arcadia/home-manager.nix +++ b/hosts/arcadia/home-manager.nix @@ -1,17 +1,25 @@ -{ pkgs, inputs, ... }: +{ + pkgs, + inputs, + lib, + ... +}: { home.stateVersion = "25.05"; imports = [ - ../../home-manager/hyprland.nix + ../../home-manager/hyprland + ../../home-manager/tofi.nix + ../../home-manager/fnott.nix + ./display.nix ../../home-manager/vscode.nix - ../../home-manager/tofi.nix ../../home-manager/direnv.nix ../../home-manager/firefox.nix ../../home-manager/obs-studio.nix ../../home-manager/blender.nix ]; + hare.hyprland.input.sensitivity = -1.0; home.packages = with pkgs; [ vivaldi google-chrome @@ -39,7 +47,7 @@ nixd rust-analyzer beeper - aseprite + # aseprite bambu-studio orca-slicer diff --git a/hosts/default.nix b/hosts/default.nix index a496a9c..98e0980 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -47,7 +47,8 @@ let programs.home-manager.enable = true; } (import ../system/home-manager) - ] ++ homeModule; + ] + ++ homeModule; }; }; in diff --git a/hosts/x1carbon/home-manager.nix b/hosts/x1carbon/home-manager.nix index c8372f3..07cb0d0 100644 --- a/hosts/x1carbon/home-manager.nix +++ b/hosts/x1carbon/home-manager.nix @@ -1,14 +1,22 @@ -{ pkgs, inputs, lib, ... }: +{ + pkgs, + inputs, + lib, + ... +}: { home.stateVersion = "25.05"; imports = [ - ../../home-manager/hyprland.nix - ../../home-manager/hyprland-theme-thin.nix - + ../../home-manager/hyprland ../../home-manager/tofi.nix + ../../home-manager/fnott.nix ../../home-manager/direnv.nix ../../home-manager/obs-studio.nix ]; + hare.hyprland = { + style = import ../../home-manager/hyprland/styles/thin.nix { inherit lib; }; + input.sensitivity = -0.6; + }; home.packages = with pkgs; [ vivaldi discord @@ -43,8 +51,6 @@ }; }; - wayland.windowManager.hyprland.settings.input.sensitivity = -0.5; - xdg.mimeApps = { enable = true; From 9129863969373433261ce80a070d1b0f394a150b Mon Sep 17 00:00:00 2001 From: Hare Date: Sun, 4 Jan 2026 01:49:46 +0900 Subject: [PATCH 16/28] fish and wezterm --- flake.lock | 6 +- home-manager/fish/default.nix | 6 ++ home-manager/fish/functions/fish_prompt.fish | 41 +++++++++ home-manager/wezterm/default.nix | 6 ++ home-manager/wezterm/wezterm.lua | 88 ++++++++++++++++++++ hosts/arcadia/home-manager.nix | 3 + hosts/fungus/home-manager.nix | 2 + hosts/x1carbon/home-manager.nix | 2 + 8 files changed, 151 insertions(+), 3 deletions(-) create mode 100644 home-manager/fish/default.nix create mode 100644 home-manager/fish/functions/fish_prompt.fish create mode 100644 home-manager/wezterm/default.nix create mode 100644 home-manager/wezterm/wezterm.lua diff --git a/flake.lock b/flake.lock index 1ef8dbb..613d1f9 100644 --- a/flake.lock +++ b/flake.lock @@ -25,11 +25,11 @@ ] }, "locked": { - "lastModified": 1767391542, - "narHash": "sha256-qHXxJuFkQhggyeao/kQb6KcOjgz0Ky+ArfowRX1MHaE=", + "lastModified": 1767437240, + "narHash": "sha256-OA0dBHhccdupFXp+/eaFfb8K1dQxk61in4aF5ITGVX8=", "owner": "nix-community", "repo": "home-manager", - "rev": "2f06b726061b7e1aa69f718e943da9ffcecd6397", + "rev": "1cfa305fba94468f665de1bd1b62dddf2e0cb012", "type": "github" }, "original": { diff --git a/home-manager/fish/default.nix b/home-manager/fish/default.nix new file mode 100644 index 0000000..6aeaa80 --- /dev/null +++ b/home-manager/fish/default.nix @@ -0,0 +1,6 @@ +{ ... }: +{ + programs.fish.enable = true; + + xdg.configFile."fish/functions/fish_prompt.fish".source = ./functions/fish_prompt.fish; +} diff --git a/home-manager/fish/functions/fish_prompt.fish b/home-manager/fish/functions/fish_prompt.fish new file mode 100644 index 0000000..00d0622 --- /dev/null +++ b/home-manager/fish/functions/fish_prompt.fish @@ -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 diff --git a/home-manager/wezterm/default.nix b/home-manager/wezterm/default.nix new file mode 100644 index 0000000..e785e11 --- /dev/null +++ b/home-manager/wezterm/default.nix @@ -0,0 +1,6 @@ +{ ... }: +{ + programs.wezterm.enable = true; + + xdg.configFile."wezterm/wezterm.lua".source = ./wezterm.lua; +} diff --git a/home-manager/wezterm/wezterm.lua b/home-manager/wezterm/wezterm.lua new file mode 100644 index 0000000..542222e --- /dev/null +++ b/home-manager/wezterm/wezterm.lua @@ -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 diff --git a/hosts/arcadia/home-manager.nix b/hosts/arcadia/home-manager.nix index 53c8e97..407bffc 100644 --- a/hosts/arcadia/home-manager.nix +++ b/hosts/arcadia/home-manager.nix @@ -13,6 +13,9 @@ ./display.nix + ../../home-manager/wezterm + ../../home-manager/fish + ../../home-manager/vscode.nix ../../home-manager/direnv.nix ../../home-manager/firefox.nix diff --git a/hosts/fungus/home-manager.nix b/hosts/fungus/home-manager.nix index 3822e28..909492b 100644 --- a/hosts/fungus/home-manager.nix +++ b/hosts/fungus/home-manager.nix @@ -3,6 +3,8 @@ home.stateVersion = "25.05"; imports = [ ../../home-manager/direnv.nix + ../../home-manager/wezterm + ../../home-manager/fish ]; home.packages = with pkgs; [ ]; diff --git a/hosts/x1carbon/home-manager.nix b/hosts/x1carbon/home-manager.nix index 07cb0d0..28cc0fd 100644 --- a/hosts/x1carbon/home-manager.nix +++ b/hosts/x1carbon/home-manager.nix @@ -12,6 +12,8 @@ ../../home-manager/fnott.nix ../../home-manager/direnv.nix ../../home-manager/obs-studio.nix + ../../home-manager/wezterm + ../../home-manager/fish ]; hare.hyprland = { style = import ../../home-manager/hyprland/styles/thin.nix { inherit lib; }; From a3fd436314ec39715359d0a7ceea2ce4d0f79d45 Mon Sep 17 00:00:00 2001 From: Hare Date: Sun, 4 Jan 2026 01:54:21 +0900 Subject: [PATCH 17/28] fix --- README.md | 10 ++++------ home-manager/direnv.nix | 1 - 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 5dcb39d..243febb 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,7 @@ # 🌽❄ -my nixos configuration +``` +sudo nixos-rebuild switch --flake .# -## TODO - -- [ ] More adjustments about uwsm and hyprland -- [ ] Setting up for uniform configuration for common applications -- [ ] Make it selectable for NixOS/Nix-darwin/Standalone \ No newline at end of file +nix run .#home-manager -- switch --flake .# +``` diff --git a/home-manager/direnv.nix b/home-manager/direnv.nix index ad23ea9..bf4e94e 100644 --- a/home-manager/direnv.nix +++ b/home-manager/direnv.nix @@ -2,7 +2,6 @@ programs = { direnv = { enable = true; - enableFishIntegration = true; # see note on other shells below nix-direnv.enable = true; }; }; From 2bb37281ac24e4c536f5d0bca882815bc84d7016 Mon Sep 17 00:00:00 2001 From: Hare Date: Sun, 4 Jan 2026 12:18:59 +0900 Subject: [PATCH 18/28] =?UTF-8?q?rose-pine-hyprcursor,=20fnott=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- home-manager/fish/default.nix | 7 +++- home-manager/fnott.nix | 8 ++-- home-manager/hyprland/default.nix | 13 +++++-- .../hyprland/rose-pine-hyprcursor.nix | 33 ++++++++++++++++ hosts/default.nix | 39 +++++++------------ hosts/x1carbon/nixos.nix | 8 ++-- system/core/uwsm.nix | 2 + 7 files changed, 72 insertions(+), 38 deletions(-) create mode 100644 home-manager/hyprland/rose-pine-hyprcursor.nix diff --git a/home-manager/fish/default.nix b/home-manager/fish/default.nix index 6aeaa80..29bef19 100644 --- a/home-manager/fish/default.nix +++ b/home-manager/fish/default.nix @@ -1,6 +1,11 @@ { ... }: { - programs.fish.enable = true; + programs.fish = { + enable = true; + interactiveShellInit = '' + set -g fish_greeting "" + ''; + }; xdg.configFile."fish/functions/fish_prompt.fish".source = ./functions/fish_prompt.fish; } diff --git a/home-manager/fnott.nix b/home-manager/fnott.nix index 04e37df..007fe38 100644 --- a/home-manager/fnott.nix +++ b/home-manager/fnott.nix @@ -53,21 +53,21 @@ max-icon-size = 64; # デフォルト32 -> 強調 icon = "dialog-information"; # フォールバック(任意) - dpi-aware = "auto"; + dpi-aware = false; }; low = { - timeout = 4; + default-timeout = 4; border-color = "232327ff"; }; normal = { - timeout = 7; + default-timeout = 7; border-color = "2a2a2fff"; }; critical = { - timeout = 0; + default-timeout = 0; border-color = "6a6a6fff"; border-size = 2; background = "101012f2"; diff --git a/home-manager/hyprland/default.nix b/home-manager/hyprland/default.nix index 730ed5c..d19c028 100644 --- a/home-manager/hyprland/default.nix +++ b/home-manager/hyprland/default.nix @@ -6,6 +6,7 @@ }: let inherit (lib) mkOption recursiveUpdate types; + rosePineHyprcursor = pkgs.callPackage ./rose-pine-hyprcursor.nix { }; defaultInput = { kb_layout = "us"; @@ -220,10 +221,14 @@ in plugins = [ ]; }; - home.packages = with pkgs; [ - swww - eww - ]; + home.packages = + [ + rosePineHyprcursor + ] + ++ (with pkgs; [ + swww + eww + ]); home.sessionVariables = { HYPRCURSOR_THEME = "rose-pine-hyprcursor"; HYPRCURSOR_SIZE = "24"; diff --git a/home-manager/hyprland/rose-pine-hyprcursor.nix b/home-manager/hyprland/rose-pine-hyprcursor.nix new file mode 100644 index 0000000..7691537 --- /dev/null +++ b/home-manager/hyprland/rose-pine-hyprcursor.nix @@ -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; + }; +}) diff --git a/hosts/default.nix b/hosts/default.nix index 98e0980..9308830 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -10,21 +10,18 @@ let }: { nixos = inputs.nixpkgs.lib.nixosSystem { - modules = - with inputs; - systemModules - ++ [ - { - users.users.${username} = { - isNormalUser = true; - description = ""; - extraGroups = [ - "networkmanager" - "wheel" - ]; - }; - } - ]; + modules = systemModules ++ [ + { + users.users.${username} = { + isNormalUser = true; + description = ""; + extraGroups = [ + "networkmanager" + "wheel" + ]; + }; + } + ]; inherit system; specialArgs = { inherit inputs hostname username; @@ -88,14 +85,6 @@ rec { ]; }; }; - nixos = { - arcadia = hosts.arcadia.nixos; - fungus = hosts.fungus.nixos; - x1carbon = hosts.x1carbon.nixos; - }; - home-manager = { - arcadia = hosts.arcadia.home-manager; - fungus = hosts.fungus.home-manager; - x1carbon = hosts.x1carbon.home-manager; - }; + nixos = builtins.mapAttrs (_: host: host.nixos) hosts; + home-manager = builtins.mapAttrs (_: host: host.home-manager) hosts; } diff --git a/hosts/x1carbon/nixos.nix b/hosts/x1carbon/nixos.nix index 5223ae0..86a8f21 100644 --- a/hosts/x1carbon/nixos.nix +++ b/hosts/x1carbon/nixos.nix @@ -25,10 +25,8 @@ in environment.systemPackages = with pkgs; [ openssl - bluez - bluez-tools bluetuith - + brightnessctl fzf @@ -61,7 +59,9 @@ in networking.firewall.allowedUDPPorts = [ ]; services.openvpn.servers = { - homeVPN = { config = '' config /root/nixos/openvpn/homeVPN.conf ''; }; + homeVPN = { + config = ''config /root/nixos/openvpn/homeVPN.conf ''; + }; }; services.udev.extraRules = '' diff --git a/system/core/uwsm.nix b/system/core/uwsm.nix index be70bc7..46cb00e 100644 --- a/system/core/uwsm.nix +++ b/system/core/uwsm.nix @@ -1,3 +1,4 @@ +{ pkgs, lib, ... }: { programs.uwsm = { enable = true; @@ -5,6 +6,7 @@ hyprland = { prettyName = "Hyprland"; comment = "Hyprland compositor managed by UWSM"; + binPath = lib.mkDefault "${pkgs.hyprland}/bin/Hyprland"; }; }; }; From 69aefb5297ad332c4984de910dcbd6d20de78514 Mon Sep 17 00:00:00 2001 From: Hare Date: Sun, 4 Jan 2026 14:22:14 +0900 Subject: [PATCH 19/28] default wallpaper --- home-manager/hyprland/default.nix | 34 ++++++++++++++++++++----------- hosts/arcadia/home-manager.nix | 5 ++++- hosts/x1carbon/home-manager.nix | 1 + 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/home-manager/hyprland/default.nix b/home-manager/hyprland/default.nix index d19c028..92a5355 100644 --- a/home-manager/hyprland/default.nix +++ b/home-manager/hyprland/default.nix @@ -5,7 +5,7 @@ ... }: let - inherit (lib) mkOption recursiveUpdate types; + inherit (lib) mkOption recursiveUpdate types optionals; rosePineHyprcursor = pkgs.callPackage ./rose-pine-hyprcursor.nix { }; defaultInput = { @@ -25,6 +25,8 @@ let sensitivity = 0.0; }; + wallpaperCommand = config.hare.hyprland.wallpaperCommand; + baseSettings = { exec-once = [ # "/usr/lib/polkit-kde-authentication-agent-1" @@ -37,8 +39,11 @@ let "eww open bar" "eww open roundedEdge" ]; - exec = [ - "swww img /usr/share/wallpaper/arknights-02.jpg" + 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'" @@ -62,7 +67,8 @@ let misc = { force_default_wallpaper = false; - disable_hyprland_logo = false; + disable_hyprland_logo = true; + disable_splash_rendering = true; }; windowrulev2 = [ @@ -210,6 +216,11 @@ in 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 \"); appended to Hyprland's exec list when provided."; + }; config = { wayland.windowManager.hyprland = { @@ -221,14 +232,13 @@ in plugins = [ ]; }; - home.packages = - [ - rosePineHyprcursor - ] - ++ (with pkgs; [ - swww - eww - ]); + home.packages = [ + rosePineHyprcursor + ] + ++ (with pkgs; [ + swww + eww + ]); home.sessionVariables = { HYPRCURSOR_THEME = "rose-pine-hyprcursor"; HYPRCURSOR_SIZE = "24"; diff --git a/hosts/arcadia/home-manager.nix b/hosts/arcadia/home-manager.nix index 407bffc..a28f21d 100644 --- a/hosts/arcadia/home-manager.nix +++ b/hosts/arcadia/home-manager.nix @@ -22,7 +22,10 @@ ../../home-manager/obs-studio.nix ../../home-manager/blender.nix ]; - hare.hyprland.input.sensitivity = -1.0; + hare.hyprland = { + input.sensitivity = -1.0; + wallpaperCommand = "swww img /usr/share/wallpaper/arknights-02.jpg"; + }; home.packages = with pkgs; [ vivaldi google-chrome diff --git a/hosts/x1carbon/home-manager.nix b/hosts/x1carbon/home-manager.nix index 28cc0fd..6305a26 100644 --- a/hosts/x1carbon/home-manager.nix +++ b/hosts/x1carbon/home-manager.nix @@ -18,6 +18,7 @@ hare.hyprland = { style = import ../../home-manager/hyprland/styles/thin.nix { inherit lib; }; input.sensitivity = -0.6; + wallpaperCommand = "swww img /usr/share/wallpaper/"; }; home.packages = with pkgs; [ vivaldi From 0762ccc9bc107041f07622c0f28cf86837a2032d Mon Sep 17 00:00:00 2001 From: Hare Date: Sat, 10 Jan 2026 18:21:38 +0900 Subject: [PATCH 20/28] greeter config --- flake.lock | 12 ++++++------ home-manager/hyprland/default.nix | 8 +++++--- home-manager/obs-studio.nix | 1 + programs/shell.nix | 1 + programs/v4l2.nix | 5 +++-- system/core/greeter.nix | 27 +++++++++++++++++++++++++++ 6 files changed, 43 insertions(+), 11 deletions(-) diff --git a/flake.lock b/flake.lock index 613d1f9..801dfce 100644 --- a/flake.lock +++ b/flake.lock @@ -25,11 +25,11 @@ ] }, "locked": { - "lastModified": 1767437240, - "narHash": "sha256-OA0dBHhccdupFXp+/eaFfb8K1dQxk61in4aF5ITGVX8=", + "lastModified": 1767606757, + "narHash": "sha256-lCl9QyHHHG/lKkpZu9nhJ5ri30FUD66VWNMJp167wPY=", "owner": "nix-community", "repo": "home-manager", - "rev": "1cfa305fba94468f665de1bd1b62dddf2e0cb012", + "rev": "c4eabb884b01366f25c3f80823b12dd595ed603a", "type": "github" }, "original": { @@ -55,11 +55,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1767116409, - "narHash": "sha256-5vKw92l1GyTnjoLzEagJy5V5mDFck72LiQWZSOnSicw=", + "lastModified": 1767379071, + "narHash": "sha256-EgE0pxsrW9jp9YFMkHL9JMXxcqi/OoumPJYwf+Okucw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "cad22e7d996aea55ecab064e84834289143e44a0", + "rev": "fb7944c166a3b630f177938e478f0378e64ce108", "type": "github" }, "original": { diff --git a/home-manager/hyprland/default.nix b/home-manager/hyprland/default.nix index 92a5355..84dfb2d 100644 --- a/home-manager/hyprland/default.nix +++ b/home-manager/hyprland/default.nix @@ -50,6 +50,11 @@ let "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; @@ -246,9 +251,6 @@ in GTK_BACKEND = "wayland"; QT_QPA_PLATFORM = "wayland;xcb"; QT_QPA_PLATFORMTHEME = "qt5ct"; - XDG_SESSION_TYPE = "wayland"; - XDG_CURRENT_DESKTOP = "Hyprland"; - XDG_SESSION_DESKTOP = "Hyprland"; }; }; } diff --git a/home-manager/obs-studio.nix b/home-manager/obs-studio.nix index edd2865..a8c2ffa 100644 --- a/home-manager/obs-studio.nix +++ b/home-manager/obs-studio.nix @@ -6,6 +6,7 @@ wlrobs obs-backgroundremoval obs-pipewire-audio-capture + obs-shaderfilter ]; }; } diff --git a/programs/shell.nix b/programs/shell.nix index 36e480a..c080300 100644 --- a/programs/shell.nix +++ b/programs/shell.nix @@ -15,6 +15,7 @@ fishPlugins.z bc jq + tree socat acpi btrfs-progs diff --git a/programs/v4l2.nix b/programs/v4l2.nix index 6bdbd21..793dbf7 100644 --- a/programs/v4l2.nix +++ b/programs/v4l2.nix @@ -1,10 +1,11 @@ -{ pkgs, ... }: +{ 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="Scrcpy Source,OBS VirtualCamera" exclusive_caps=1 + options v4l2loopback devices=2 video_nr=0,1 card_label="OBS Virtual Camera,Scrcpy Source" exclusive_caps=1 ''; } diff --git a/system/core/greeter.nix b/system/core/greeter.nix index a67df49..ccb27bc 100644 --- a/system/core/greeter.nix +++ b/system/core/greeter.nix @@ -1,11 +1,34 @@ { config, pkgs, ... }: let + rosePineHyprcursor = pkgs.callPackage ../../home-manager/hyprland/rose-pine-hyprcursor.nix { }; hyprGreetConf = pkgs.writeText "hyprland-greetd.conf" '' monitor = DP-1, 5120x2880@60, 0x0, 2 monitor = DP-2, disable monitor = DP-3, disable + 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 @@ -16,6 +39,10 @@ in user = "greeter"; }; + environment.systemPackages = [ + rosePineHyprcursor + ]; + programs.regreet = { # greetd を Hyprland で動かす enable = true; From e3de591a27158c98f7e330ec0f331356ef107d50 Mon Sep 17 00:00:00 2001 From: Hare Date: Thu, 19 Feb 2026 09:30:42 +0900 Subject: [PATCH 21/28] Update Hyprland settings --- flake.lock | 39 ++++++++++++++++++++++++------- flake.nix | 3 +++ home-manager/blender.nix | 8 +++---- home-manager/hyprland/default.nix | 16 ++++++------- home-manager/voicevox.nix | 8 +++++++ home-manager/zeditor.nix | 22 +++++++++++++++++ hosts/arcadia/home-manager.nix | 22 ++++++++--------- hosts/arcadia/nixos.nix | 5 ++-- hosts/default.nix | 28 +++++++++++++--------- system/core/greeter.nix | 2 +- system/core/uwsm.nix | 2 +- 11 files changed, 106 insertions(+), 49 deletions(-) create mode 100644 home-manager/voicevox.nix create mode 100644 home-manager/zeditor.nix diff --git a/flake.lock b/flake.lock index 801dfce..a908112 100644 --- a/flake.lock +++ b/flake.lock @@ -25,11 +25,11 @@ ] }, "locked": { - "lastModified": 1767606757, - "narHash": "sha256-lCl9QyHHHG/lKkpZu9nhJ5ri30FUD66VWNMJp167wPY=", + "lastModified": 1770318660, + "narHash": "sha256-yFVde8QZK7Dc0Xa8eQDsmxLX4NJNfL1NKfctSyiQgMY=", "owner": "nix-community", "repo": "home-manager", - "rev": "c4eabb884b01366f25c3f80823b12dd595ed603a", + "rev": "471e6a065f9efed51488d7c51a9abbd387df91b8", "type": "github" }, "original": { @@ -38,13 +38,33 @@ "type": "github" } }, + "nix-index-database": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1771130777, + "narHash": "sha256-UIKOwG0D9XVIJfNWg6+gENAvQP+7LO46eO0Jpe+ItJ0=", + "owner": "Mic92", + "repo": "nix-index-database", + "rev": "efec7aaad8d43f8e5194df46a007456093c40f88", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "nix-index-database", + "type": "github" + } + }, "nixos-hardware": { "locked": { - "lastModified": 1767185284, - "narHash": "sha256-ljDBUDpD1Cg5n3mJI81Hz5qeZAwCGxon4kQW3Ho3+6Q=", + "lastModified": 1769302137, + "narHash": "sha256-QEDtctEkOsbx8nlFh4yqPEOtr4tif6KTqWwJ37IM2ds=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "40b1a28dce561bea34858287fbb23052c3ee63fe", + "rev": "a351494b0e35fd7c0b7a1aae82f0afddf4907aa8", "type": "github" }, "original": { @@ -55,11 +75,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1767379071, - "narHash": "sha256-EgE0pxsrW9jp9YFMkHL9JMXxcqi/OoumPJYwf+Okucw=", + "lastModified": 1770197578, + "narHash": "sha256-AYqlWrX09+HvGs8zM6ebZ1pwUqjkfpnv8mewYwAo+iM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "fb7944c166a3b630f177938e478f0378e64ce108", + "rev": "00c21e4c93d963c50d4c0c89bfa84ed6e0694df2", "type": "github" }, "original": { @@ -89,6 +109,7 @@ "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" diff --git a/flake.nix b/flake.nix index 16637af..fc42b0b 100644 --- a/flake.nix +++ b/flake.nix @@ -10,6 +10,9 @@ 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 = diff --git a/home-manager/blender.nix b/home-manager/blender.nix index 40f5ace..faae648 100644 --- a/home-manager/blender.nix +++ b/home-manager/blender.nix @@ -1,9 +1,7 @@ { pkgs, ... }: + { home.packages = with pkgs; [ - (pkgs.blender-hip.overrideAttrs (oldAttrs: { - # Workaround for this: https://github.com/NixOS/nixpkgs/pull/385913 - cmakeFlags = oldAttrs.cmakeFlags ++ [ "-DWITH_ASSERT_ABORT=OFF" ]; - })) + blender ]; -} \ No newline at end of file +} diff --git a/home-manager/hyprland/default.nix b/home-manager/hyprland/default.nix index 84dfb2d..870c0c9 100644 --- a/home-manager/hyprland/default.nix +++ b/home-manager/hyprland/default.nix @@ -76,14 +76,13 @@ let disable_splash_rendering = true; }; - windowrulev2 = [ - "animation windowsIn 0,title:^(.*wofi.*)$" - "float,title:^(.*feh.*)$" - "center,title:^(.*feh.*)$" - "float,title:^(Picture.*)$" - "pin,title:^(Picture.*)$" - "immediate, class:^(Terraria)$" - "idleinhibit fullscreen, class:^(steam_app.*)$" + 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 = [ @@ -243,6 +242,7 @@ in ++ (with pkgs; [ swww eww + hyprshot ]); home.sessionVariables = { HYPRCURSOR_THEME = "rose-pine-hyprcursor"; diff --git a/home-manager/voicevox.nix b/home-manager/voicevox.nix new file mode 100644 index 0000000..0dfa7ee --- /dev/null +++ b/home-manager/voicevox.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: +{ + home.packages = with pkgs; [ + voicevox-core + voicevox-engine + voicevox + ]; +} diff --git a/home-manager/zeditor.nix b/home-manager/zeditor.nix new file mode 100644 index 0000000..1ad88f2 --- /dev/null +++ b/home-manager/zeditor.nix @@ -0,0 +1,22 @@ +{ 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 = true; + 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"; +} diff --git a/hosts/arcadia/home-manager.nix b/hosts/arcadia/home-manager.nix index a28f21d..b84f095 100644 --- a/hosts/arcadia/home-manager.nix +++ b/hosts/arcadia/home-manager.nix @@ -7,25 +7,28 @@ { home.stateVersion = "25.05"; imports = [ - ../../home-manager/hyprland - ../../home-manager/tofi.nix - ../../home-manager/fnott.nix - + inputs.nix-index-database.homeModules.nix-index ./display.nix - + ../../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/blender.nix + ../../home-manager/voicevox.nix ]; hare.hyprland = { input.sensitivity = -1.0; wallpaperCommand = "swww img /usr/share/wallpaper/arknights-02.jpg"; }; + + programs.nix-index-database.comma.enable = true; + home.packages = with pkgs; [ vivaldi google-chrome @@ -40,10 +43,9 @@ gimp inkscape obsidian - zed-editor # davinci-resolve kdePackages.filelight - inputs.zen-browser.packages."${system}".default + inputs.zen-browser.packages."${stdenv.hostPlatform.system}".default (deno.overrideAttrs (oldAttrs: { doCheck = false; })) @@ -57,10 +59,6 @@ bambu-studio orca-slicer - # voicevox-core - # voicevox-engine - # voicevox - vinegar antigravity diff --git a/hosts/arcadia/nixos.nix b/hosts/arcadia/nixos.nix index f6de238..bfbf60e 100644 --- a/hosts/arcadia/nixos.nix +++ b/hosts/arcadia/nixos.nix @@ -28,11 +28,13 @@ in rustfmt openssl vulkan-tools + android-tools android-file-transfer rocmPackages.rocm-runtime rocmPackages.rocminfo rocmPackages.clr + rocmPackages.rocm-smi qemu (pkgs.writeShellScriptBin "qemu-system-x86_64-uefi" '' @@ -64,9 +66,8 @@ in "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIW2Yrqwi4YjIrdI8mygX5pTHDPmrUgbmpZ4WxoTqORi keihi@Vostro-LapTop" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICi8Cciepfs1ikPdfyHjc9qJX5z2QLFF9jBszsyEvCMA nix-on-droid@localhost" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID8Eo/QDJtXqluvjNx5ZpeIt0c/yf/Mgr7dKhNWAICZX hare@x1carbon" - ]; + ]; }; - programs.adb.enable = true; programs.nix-ld.enable = true; services.openssh.enable = true; diff --git a/hosts/default.nix b/hosts/default.nix index 9308830..dd7519a 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -51,17 +51,23 @@ let in rec { hosts = { - arcadia = mkHost { - system = "x86_64-linux"; - hostname = "Arcadia"; - username = "hare"; - systemModules = [ - ./arcadia/nixos.nix - ]; - homeModule = [ - ./arcadia/home-manager.nix - ]; - }; + arcadia = + let + inputs.nixpkgs = import inputs.nixpkgs { + config.rocmSupport = true; + }; + in + mkHost { + system = "x86_64-linux"; + hostname = "Arcadia"; + username = "hare"; + systemModules = [ + ./arcadia/nixos.nix + ]; + homeModule = [ + ./arcadia/home-manager.nix + ]; + }; x1carbon = mkHost { system = "x86_64-linux"; hostname = "x1carbon"; diff --git a/system/core/greeter.nix b/system/core/greeter.nix index ccb27bc..588b4ca 100644 --- a/system/core/greeter.nix +++ b/system/core/greeter.nix @@ -35,7 +35,7 @@ in { services.greetd.enable = true; services.greetd.settings.default_session = { - command = "${pkgs.hyprland}/bin/Hyprland --config ${hyprGreetConf}"; + command = "${pkgs.hyprland}/bin/start-hyprland -- -c ${hyprGreetConf}"; user = "greeter"; }; diff --git a/system/core/uwsm.nix b/system/core/uwsm.nix index 46cb00e..cac1f4e 100644 --- a/system/core/uwsm.nix +++ b/system/core/uwsm.nix @@ -6,7 +6,7 @@ hyprland = { prettyName = "Hyprland"; comment = "Hyprland compositor managed by UWSM"; - binPath = lib.mkDefault "${pkgs.hyprland}/bin/Hyprland"; + binPath = "${pkgs.hyprland}/bin/start-hyprland"; }; }; }; From 2acc8a1e671607ebf7e77ae2535bc17227683b69 Mon Sep 17 00:00:00 2001 From: Hare Date: Sat, 28 Feb 2026 19:06:35 +0900 Subject: [PATCH 22/28] Update structure --- home-manager/fish/default.nix | 1 + hosts/arcadia/default.nix | 11 ++++ hosts/arcadia/home-manager.nix | 3 +- hosts/default.nix | 92 ++-------------------------------- hosts/fungus/default.nix | 11 ++++ hosts/mkHost.nix | 48 ++++++++++++++++++ hosts/x1carbon/default.nix | 11 ++++ hosts/x1carbon/nixos.nix | 4 +- programs/ssh.nix | 2 + 9 files changed, 91 insertions(+), 92 deletions(-) create mode 100644 hosts/arcadia/default.nix create mode 100644 hosts/fungus/default.nix create mode 100644 hosts/mkHost.nix create mode 100644 hosts/x1carbon/default.nix diff --git a/home-manager/fish/default.nix b/home-manager/fish/default.nix index 29bef19..f6b528c 100644 --- a/home-manager/fish/default.nix +++ b/home-manager/fish/default.nix @@ -4,6 +4,7 @@ enable = true; interactiveShellInit = '' set -g fish_greeting "" + set -gx SSH_AUTH_SOCK "$XDG_RUNTIME_DIR/ssh-agent" ''; }; diff --git a/hosts/arcadia/default.nix b/hosts/arcadia/default.nix new file mode 100644 index 0000000..cf858d5 --- /dev/null +++ b/hosts/arcadia/default.nix @@ -0,0 +1,11 @@ +inputs: +let + mkHost = import ../mkHost.nix inputs; +in +mkHost { + system = "x86_64-linux"; + hostname = "Arcadia"; + username = "hare"; + systemModules = [ ./nixos.nix ]; + homeModule = [ ./home-manager.nix ]; +} diff --git a/hosts/arcadia/home-manager.nix b/hosts/arcadia/home-manager.nix index b84f095..654936b 100644 --- a/hosts/arcadia/home-manager.nix +++ b/hosts/arcadia/home-manager.nix @@ -43,7 +43,6 @@ gimp inkscape obsidian - # davinci-resolve kdePackages.filelight inputs.zen-browser.packages."${stdenv.hostPlatform.system}".default (deno.overrideAttrs (oldAttrs: { @@ -62,6 +61,8 @@ vinegar antigravity + + davinci-resolve ]; services.easyeffects = { enable = true; diff --git a/hosts/default.nix b/hosts/default.nix index dd7519a..03b5daf 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -1,95 +1,9 @@ inputs: -let - mkHost = - { - system, - hostname, - username, - systemModules, - homeModule, - }: - { - nixos = inputs.nixpkgs.lib.nixosSystem { - modules = systemModules ++ [ - { - users.users.${username} = { - isNormalUser = true; - description = ""; - extraGroups = [ - "networkmanager" - "wheel" - ]; - }; - } - ]; - inherit system; - specialArgs = { - inherit inputs hostname username; - }; - }; - home-manager = inputs.home-manager.lib.homeManagerConfiguration { - pkgs = import inputs.nixpkgs { - inherit system; - config.allowUnfree = true; - }; - extraSpecialArgs = { - inherit inputs hostname username; - }; - modules = [ - { - home = { - inherit username; - homeDirectory = "/home/${username}"; - }; - programs.home-manager.enable = true; - } - (import ../system/home-manager) - ] - ++ homeModule; - }; - }; -in rec { hosts = { - arcadia = - let - inputs.nixpkgs = import inputs.nixpkgs { - config.rocmSupport = true; - }; - in - mkHost { - system = "x86_64-linux"; - hostname = "Arcadia"; - username = "hare"; - systemModules = [ - ./arcadia/nixos.nix - ]; - homeModule = [ - ./arcadia/home-manager.nix - ]; - }; - x1carbon = mkHost { - system = "x86_64-linux"; - hostname = "x1carbon"; - username = "hare"; - systemModules = [ - ./x1carbon/nixos.nix - ]; - homeModule = [ - ./x1carbon/home-manager.nix - ]; - }; - fungus = mkHost { - system = "x86_64-linux"; - hostname = "Fungus"; - username = "hare"; - systemModules = [ - ./fungus/nixos.nix - ]; - homeModule = [ - ./fungus/home-manager.nix - ]; - }; + arcadia = import ./arcadia inputs; + x1carbon = import ./x1carbon inputs; + fungus = import ./fungus inputs; }; nixos = builtins.mapAttrs (_: host: host.nixos) hosts; home-manager = builtins.mapAttrs (_: host: host.home-manager) hosts; diff --git a/hosts/fungus/default.nix b/hosts/fungus/default.nix new file mode 100644 index 0000000..d2909a4 --- /dev/null +++ b/hosts/fungus/default.nix @@ -0,0 +1,11 @@ +inputs: +let + mkHost = import ../mkHost.nix inputs; +in +mkHost { + system = "x86_64-linux"; + hostname = "Fungus"; + username = "hare"; + systemModules = [ ./nixos.nix ]; + homeModule = [ ./home-manager.nix ]; +} diff --git a/hosts/mkHost.nix b/hosts/mkHost.nix new file mode 100644 index 0000000..c5929c4 --- /dev/null +++ b/hosts/mkHost.nix @@ -0,0 +1,48 @@ +inputs: +{ + system, + hostname, + username, + systemModules, + homeModule, +}: +{ + nixos = inputs.nixpkgs.lib.nixosSystem { + modules = systemModules ++ [ + { + users.users.${username} = { + isNormalUser = true; + description = ""; + extraGroups = [ + "networkmanager" + "wheel" + ]; + }; + } + ]; + inherit system; + specialArgs = { + inherit inputs hostname username; + }; + }; + home-manager = inputs.home-manager.lib.homeManagerConfiguration { + pkgs = import inputs.nixpkgs { + inherit system; + config.allowUnfree = true; + }; + extraSpecialArgs = { + inherit inputs hostname username; + }; + modules = [ + { + home = { + inherit username; + homeDirectory = "/home/${username}"; + }; + programs.home-manager.enable = true; + } + (import ../system/home-manager) + ] + ++ homeModule; + }; +} diff --git a/hosts/x1carbon/default.nix b/hosts/x1carbon/default.nix new file mode 100644 index 0000000..b184f44 --- /dev/null +++ b/hosts/x1carbon/default.nix @@ -0,0 +1,11 @@ +inputs: +let + mkHost = import ../mkHost.nix inputs; +in +mkHost { + system = "x86_64-linux"; + hostname = "x1carbon"; + username = "hare"; + systemModules = [ ./nixos.nix ]; + homeModule = [ ./home-manager.nix ]; +} diff --git a/hosts/x1carbon/nixos.nix b/hosts/x1carbon/nixos.nix index 86a8f21..7013324 100644 --- a/hosts/x1carbon/nixos.nix +++ b/hosts/x1carbon/nixos.nix @@ -31,12 +31,13 @@ in fzf ghq + + android-tools ]; environment.sessionVariables.NIXOS_OZONE_WL = "1"; users.users.${username} = { extraGroups = [ - "adbusers" "docker" ]; shell = pkgs.fish; @@ -45,7 +46,6 @@ in "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIW2Yrqwi4YjIrdI8mygX5pTHDPmrUgbmpZ4WxoTqORi keihi@Vostro-LapTop" ]; }; - programs.adb.enable = true; programs.nix-ld.enable = true; programs.light.enable = true; diff --git a/programs/ssh.nix b/programs/ssh.nix index d7b07d3..f0b1ac2 100644 --- a/programs/ssh.nix +++ b/programs/ssh.nix @@ -1,4 +1,6 @@ { + programs.ssh.startAgent = true; + services.openssh = { enable = true; ports = [ 22 ]; From 35623910b0507eee054c4014632cffdf2ae8c385 Mon Sep 17 00:00:00 2001 From: Hare Date: Sat, 28 Feb 2026 19:42:36 +0900 Subject: [PATCH 23/28] feat: multiple user --- hosts/arcadia/default.nix | 8 ++- .../{home-manager.nix => hare/default.nix} | 26 +++---- hosts/default.nix | 2 +- hosts/fungus/default.nix | 8 ++- .../{home-manager.nix => hare/default.nix} | 15 ++-- hosts/mkHost.nix | 69 +++++++++++-------- hosts/x1carbon/default.nix | 8 ++- .../{home-manager.nix => hare/default.nix} | 16 ++--- 8 files changed, 86 insertions(+), 66 deletions(-) rename hosts/arcadia/{home-manager.nix => hare/default.nix} (77%) rename hosts/fungus/{home-manager.nix => hare/default.nix} (54%) rename hosts/x1carbon/{home-manager.nix => hare/default.nix} (77%) diff --git a/hosts/arcadia/default.nix b/hosts/arcadia/default.nix index cf858d5..3a96f57 100644 --- a/hosts/arcadia/default.nix +++ b/hosts/arcadia/default.nix @@ -5,7 +5,11 @@ in mkHost { system = "x86_64-linux"; hostname = "Arcadia"; - username = "hare"; + users = [ + { + username = "hare"; + homeModule = [ ./hare ]; + } + ]; systemModules = [ ./nixos.nix ]; - homeModule = [ ./home-manager.nix ]; } diff --git a/hosts/arcadia/home-manager.nix b/hosts/arcadia/hare/default.nix similarity index 77% rename from hosts/arcadia/home-manager.nix rename to hosts/arcadia/hare/default.nix index 654936b..b906d1e 100644 --- a/hosts/arcadia/home-manager.nix +++ b/hosts/arcadia/hare/default.nix @@ -8,19 +8,19 @@ home.stateVersion = "25.05"; imports = [ inputs.nix-index-database.homeModules.nix-index - ./display.nix - ../../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/blender.nix - ../../home-manager/voicevox.nix + ../display.nix + ../../../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/blender.nix + ../../../home-manager/voicevox.nix ]; hare.hyprland = { input.sensitivity = -1.0; diff --git a/hosts/default.nix b/hosts/default.nix index 03b5daf..09a9938 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -6,5 +6,5 @@ rec { fungus = import ./fungus inputs; }; nixos = builtins.mapAttrs (_: host: host.nixos) hosts; - home-manager = builtins.mapAttrs (_: host: host.home-manager) hosts; + home-manager = builtins.foldl' (a: b: a // b) { } (map (h: h.home-manager) (builtins.attrValues hosts)); } diff --git a/hosts/fungus/default.nix b/hosts/fungus/default.nix index d2909a4..8457138 100644 --- a/hosts/fungus/default.nix +++ b/hosts/fungus/default.nix @@ -5,7 +5,11 @@ in mkHost { system = "x86_64-linux"; hostname = "Fungus"; - username = "hare"; + users = [ + { + username = "hare"; + homeModule = [ ./hare ]; + } + ]; systemModules = [ ./nixos.nix ]; - homeModule = [ ./home-manager.nix ]; } diff --git a/hosts/fungus/home-manager.nix b/hosts/fungus/hare/default.nix similarity index 54% rename from hosts/fungus/home-manager.nix rename to hosts/fungus/hare/default.nix index 909492b..ed6d331 100644 --- a/hosts/fungus/home-manager.nix +++ b/hosts/fungus/hare/default.nix @@ -1,17 +1,16 @@ -{ conifg, pkgs, ... }: +{ pkgs, ... }: { home.stateVersion = "25.05"; imports = [ - ../../home-manager/direnv.nix - ../../home-manager/wezterm - ../../home-manager/fish - ]; - home.packages = with pkgs; [ + ../../../home-manager/direnv.nix + ../../../home-manager/wezterm + ../../../home-manager/fish ]; + home.packages = with pkgs; [ ]; programs.git = { enable = true; - userName = "Hare"; - userEmail = "kei.hiracchi.0928@gmail.com"; + settings.user.name = "Hare"; + settings.user.email = "kei.hiracchi.0928@gmail.com"; }; fonts = { diff --git a/hosts/mkHost.nix b/hosts/mkHost.nix index c5929c4..5a7a314 100644 --- a/hosts/mkHost.nix +++ b/hosts/mkHost.nix @@ -2,47 +2,56 @@ inputs: { system, hostname, - username, + users, systemModules, - homeModule, }: +let + pkgs = import inputs.nixpkgs { + inherit system; + config.allowUnfree = true; + }; +in { nixos = inputs.nixpkgs.lib.nixosSystem { modules = systemModules ++ [ { - users.users.${username} = { - isNormalUser = true; - description = ""; - extraGroups = [ - "networkmanager" - "wheel" - ]; - }; + users.users = builtins.listToAttrs (map (u: { + name = u.username; + value = { + isNormalUser = true; + description = ""; + extraGroups = [ + "networkmanager" + "wheel" + ]; + }; + }) users); } ]; inherit system; specialArgs = { - inherit inputs hostname username; + inherit inputs hostname; + username = (builtins.head users).username; }; }; - home-manager = inputs.home-manager.lib.homeManagerConfiguration { - pkgs = import inputs.nixpkgs { - inherit system; - config.allowUnfree = true; + 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; }; - extraSpecialArgs = { - inherit inputs hostname username; - }; - modules = [ - { - home = { - inherit username; - homeDirectory = "/home/${username}"; - }; - programs.home-manager.enable = true; - } - (import ../system/home-manager) - ] - ++ homeModule; - }; + }) users); } diff --git a/hosts/x1carbon/default.nix b/hosts/x1carbon/default.nix index b184f44..5f3249f 100644 --- a/hosts/x1carbon/default.nix +++ b/hosts/x1carbon/default.nix @@ -5,7 +5,11 @@ in mkHost { system = "x86_64-linux"; hostname = "x1carbon"; - username = "hare"; + users = [ + { + username = "hare"; + homeModule = [ ./hare ]; + } + ]; systemModules = [ ./nixos.nix ]; - homeModule = [ ./home-manager.nix ]; } diff --git a/hosts/x1carbon/home-manager.nix b/hosts/x1carbon/hare/default.nix similarity index 77% rename from hosts/x1carbon/home-manager.nix rename to hosts/x1carbon/hare/default.nix index 6305a26..9df1921 100644 --- a/hosts/x1carbon/home-manager.nix +++ b/hosts/x1carbon/hare/default.nix @@ -7,16 +7,16 @@ { home.stateVersion = "25.05"; imports = [ - ../../home-manager/hyprland - ../../home-manager/tofi.nix - ../../home-manager/fnott.nix - ../../home-manager/direnv.nix - ../../home-manager/obs-studio.nix - ../../home-manager/wezterm - ../../home-manager/fish + ../../../home-manager/hyprland + ../../../home-manager/tofi.nix + ../../../home-manager/fnott.nix + ../../../home-manager/direnv.nix + ../../../home-manager/obs-studio.nix + ../../../home-manager/wezterm + ../../../home-manager/fish ]; hare.hyprland = { - style = import ../../home-manager/hyprland/styles/thin.nix { inherit lib; }; + style = import ../../../home-manager/hyprland/styles/thin.nix { inherit lib; }; input.sensitivity = -0.6; wallpaperCommand = "swww img /usr/share/wallpaper/"; }; From 18cba8e35f80ee4094b59b322560096224307b8a Mon Sep 17 00:00:00 2001 From: Hare Date: Sat, 28 Feb 2026 21:26:07 +0900 Subject: [PATCH 24/28] feat: user nixos --- README.md | 2 +- hosts/arcadia/default.nix | 3 +- .../hare/{default.nix => home-manager.nix} | 0 hosts/arcadia/hare/nixos.nix | 14 +++++++ hosts/arcadia/nixos.nix | 20 +--------- hosts/fungus/default.nix | 3 +- .../hare/{default.nix => home-manager.nix} | 0 hosts/fungus/hare/nixos.nix | 11 ++++++ hosts/fungus/nixos.nix | 17 +-------- hosts/mkHost.nix | 37 +++++++++++-------- hosts/x1carbon/default.nix | 3 +- .../hare/{default.nix => home-manager.nix} | 0 hosts/x1carbon/hare/nixos.nix | 11 ++++++ hosts/x1carbon/nixos.nix | 16 +------- 14 files changed, 67 insertions(+), 70 deletions(-) rename hosts/arcadia/hare/{default.nix => home-manager.nix} (100%) create mode 100644 hosts/arcadia/hare/nixos.nix rename hosts/fungus/hare/{default.nix => home-manager.nix} (100%) create mode 100644 hosts/fungus/hare/nixos.nix rename hosts/x1carbon/hare/{default.nix => home-manager.nix} (100%) create mode 100644 hosts/x1carbon/hare/nixos.nix diff --git a/README.md b/README.md index 243febb..c39ae72 100644 --- a/README.md +++ b/README.md @@ -3,5 +3,5 @@ ``` sudo nixos-rebuild switch --flake .# -nix run .#home-manager -- switch --flake .# +nix run .#home-manager -- switch --flake .#@ ``` diff --git a/hosts/arcadia/default.nix b/hosts/arcadia/default.nix index 3a96f57..dc271d6 100644 --- a/hosts/arcadia/default.nix +++ b/hosts/arcadia/default.nix @@ -8,7 +8,8 @@ mkHost { users = [ { username = "hare"; - homeModule = [ ./hare ]; + homeModule = [ ./hare/home-manager.nix ]; + userNixos = ./hare/nixos.nix; } ]; systemModules = [ ./nixos.nix ]; diff --git a/hosts/arcadia/hare/default.nix b/hosts/arcadia/hare/home-manager.nix similarity index 100% rename from hosts/arcadia/hare/default.nix rename to hosts/arcadia/hare/home-manager.nix diff --git a/hosts/arcadia/hare/nixos.nix b/hosts/arcadia/hare/nixos.nix new file mode 100644 index 0000000..6cf7c57 --- /dev/null +++ b/hosts/arcadia/hare/nixos.nix @@ -0,0 +1,14 @@ +{ pkgs, ... }: +{ + extraGroups = [ + "adbusers" + "docker" + ]; + shell = pkgs.fish; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIfql/a6ZtxOPgBhFzOfgTO6HGcy0Se9mgMLmOa40vMF" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIW2Yrqwi4YjIrdI8mygX5pTHDPmrUgbmpZ4WxoTqORi keihi@Vostro-LapTop" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICi8Cciepfs1ikPdfyHjc9qJX5z2QLFF9jBszsyEvCMA nix-on-droid@localhost" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID8Eo/QDJtXqluvjNx5ZpeIt0c/yf/Mgr7dKhNWAICZX hare@x1carbon" + ]; +} diff --git a/hosts/arcadia/nixos.nix b/hosts/arcadia/nixos.nix index bfbf60e..583a497 100644 --- a/hosts/arcadia/nixos.nix +++ b/hosts/arcadia/nixos.nix @@ -1,8 +1,4 @@ -{ - pkgs, - username, - ... -}: +{ pkgs, ... }: let config.boot.kernelPackages = pkgs.linuxPackages_latest; in @@ -55,19 +51,6 @@ in ]; environment.sessionVariables.NIXOS_OZONE_WL = "1"; - users.users.${username} = { - extraGroups = [ - "adbusers" - "docker" - ]; - shell = pkgs.fish; - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIfql/a6ZtxOPgBhFzOfgTO6HGcy0Se9mgMLmOa40vMF" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIW2Yrqwi4YjIrdI8mygX5pTHDPmrUgbmpZ4WxoTqORi keihi@Vostro-LapTop" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICi8Cciepfs1ikPdfyHjc9qJX5z2QLFF9jBszsyEvCMA nix-on-droid@localhost" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID8Eo/QDJtXqluvjNx5ZpeIt0c/yf/Mgr7dKhNWAICZX hare@x1carbon" - ]; - }; programs.nix-ld.enable = true; services.openssh.enable = true; @@ -122,5 +105,4 @@ in boot.loader.efi.canTouchEfiVariables = true; boot.initrd.kernelModules = [ "amdgpu" ]; - } diff --git a/hosts/fungus/default.nix b/hosts/fungus/default.nix index 8457138..e426a10 100644 --- a/hosts/fungus/default.nix +++ b/hosts/fungus/default.nix @@ -8,7 +8,8 @@ mkHost { users = [ { username = "hare"; - homeModule = [ ./hare ]; + homeModule = [ ./hare/home-manager.nix ]; + userNixos = ./hare/nixos.nix; } ]; systemModules = [ ./nixos.nix ]; diff --git a/hosts/fungus/hare/default.nix b/hosts/fungus/hare/home-manager.nix similarity index 100% rename from hosts/fungus/hare/default.nix rename to hosts/fungus/hare/home-manager.nix diff --git a/hosts/fungus/hare/nixos.nix b/hosts/fungus/hare/nixos.nix new file mode 100644 index 0000000..39bce37 --- /dev/null +++ b/hosts/fungus/hare/nixos.nix @@ -0,0 +1,11 @@ +{ pkgs, ... }: +{ + extraGroups = [ + "docker" + ]; + shell = pkgs.fish; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBd45JtvgM44KUqhp3Xl2Wtt6rmxU13c/84YLyGKigkG hare@nixos" + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDZTkjrLwH+jsSHF/LI23+WPQ9rff9vWBH1VaxSjNADIIKDY7vGkWWRUCImt8QTzied3mNFv+EyZ8igiJdm5tEO1KkrWUqTZk5Ut79LTQftB23SDNC8XzuHKxwaKHdwZIP065biRFUqNYHu8h0EHKbQ3Djj6cZYBcEL1JOc0wtm4jmuW6Fp3rCn/ZCo0g3Kg7SfY4cpf4fJTB97bIjPJzG7JSSOuTkJcDQzFrySUPOpgrt5+iSqKJ/tQtfxLHcNq8AMrh1fH6sUzaJLmMs/7V9LTbsbILTY4YQj5FF07dBqEJBwvZ9sRTPPzl/HSdVmp9OlCZnryPbjTKJmK1Nxx+tOZfh4IY3mWWnEegvDNCYwKJu+d+zeqDaSUMx0kpAnK9PLSI0By8FtboRVvSFSce6FouiUhEzJyKXAr3E1JCgQXdLcTTb66rbBcauuqhuieKDGPpz45EbFi83uHNeDodi5b75h5r1Nn+oJmzagwUAoyw4gCCbiYwTAe3GA79LK7kE= hare@hr-r620" + ]; +} diff --git a/hosts/fungus/nixos.nix b/hosts/fungus/nixos.nix index 51effa5..460eb96 100644 --- a/hosts/fungus/nixos.nix +++ b/hosts/fungus/nixos.nix @@ -1,9 +1,4 @@ -{ - config, - pkgs, - username, - ... -}: +{ pkgs, ... }: { system.stateVersion = "25.05"; @@ -24,16 +19,6 @@ boot.loader.grub.useOSProber = true; boot.loader.efi.canTouchEfiVariables = true; - users.users.${username} = { - extraGroups = [ - "docker" - ]; - shell = pkgs.fish; - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBd45JtvgM44KUqhp3Xl2Wtt6rmxU13c/84YLyGKigkG hare@nixos" - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDZTkjrLwH+jsSHF/LI23+WPQ9rff9vWBH1VaxSjNADIIKDY7vGkWWRUCImt8QTzied3mNFv+EyZ8igiJdm5tEO1KkrWUqTZk5Ut79LTQftB23SDNC8XzuHKxwaKHdwZIP065biRFUqNYHu8h0EHKbQ3Djj6cZYBcEL1JOc0wtm4jmuW6Fp3rCn/ZCo0g3Kg7SfY4cpf4fJTB97bIjPJzG7JSSOuTkJcDQzFrySUPOpgrt5+iSqKJ/tQtfxLHcNq8AMrh1fH6sUzaJLmMs/7V9LTbsbILTY4YQj5FF07dBqEJBwvZ9sRTPPzl/HSdVmp9OlCZnryPbjTKJmK1Nxx+tOZfh4IY3mWWnEegvDNCYwKJu+d+zeqDaSUMx0kpAnK9PLSI0By8FtboRVvSFSce6FouiUhEzJyKXAr3E1JCgQXdLcTTb66rbBcauuqhuieKDGPpz45EbFi83uHNeDodi5b75h5r1Nn+oJmzagwUAoyw4gCCbiYwTAe3GA79LK7kE= hare@hr-r620" - ]; - }; programs.nix-ld.enable = true; services.openssh.enable = true; diff --git a/hosts/mkHost.nix b/hosts/mkHost.nix index 5a7a314..9c9047a 100644 --- a/hosts/mkHost.nix +++ b/hosts/mkHost.nix @@ -13,25 +13,30 @@ let in { nixos = inputs.nixpkgs.lib.nixosSystem { - modules = systemModules ++ [ - { - users.users = builtins.listToAttrs (map (u: { - name = u.username; - value = { - isNormalUser = true; - description = ""; - extraGroups = [ - "networkmanager" - "wheel" - ]; - }; - }) users); - } - ]; + 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; - username = (builtins.head users).username; + users = map (u: u.username) users; }; }; home-manager = builtins.listToAttrs (map (u: { diff --git a/hosts/x1carbon/default.nix b/hosts/x1carbon/default.nix index 5f3249f..408cc54 100644 --- a/hosts/x1carbon/default.nix +++ b/hosts/x1carbon/default.nix @@ -8,7 +8,8 @@ mkHost { users = [ { username = "hare"; - homeModule = [ ./hare ]; + homeModule = [ ./hare/home-manager.nix ]; + userNixos = ./hare/nixos.nix; } ]; systemModules = [ ./nixos.nix ]; diff --git a/hosts/x1carbon/hare/default.nix b/hosts/x1carbon/hare/home-manager.nix similarity index 100% rename from hosts/x1carbon/hare/default.nix rename to hosts/x1carbon/hare/home-manager.nix diff --git a/hosts/x1carbon/hare/nixos.nix b/hosts/x1carbon/hare/nixos.nix new file mode 100644 index 0000000..ee983de --- /dev/null +++ b/hosts/x1carbon/hare/nixos.nix @@ -0,0 +1,11 @@ +{ pkgs, ... }: +{ + extraGroups = [ + "docker" + ]; + shell = pkgs.fish; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIfql/a6ZtxOPgBhFzOfgTO6HGcy0Se9mgMLmOa40vMF" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIW2Yrqwi4YjIrdI8mygX5pTHDPmrUgbmpZ4WxoTqORi keihi@Vostro-LapTop" + ]; +} diff --git a/hosts/x1carbon/nixos.nix b/hosts/x1carbon/nixos.nix index 7013324..d052e55 100644 --- a/hosts/x1carbon/nixos.nix +++ b/hosts/x1carbon/nixos.nix @@ -1,8 +1,4 @@ -{ - pkgs, - username, - ... -}: +{ pkgs, ... }: let config.boot.kernelPackages = pkgs.linuxPackages_latest; in @@ -36,16 +32,6 @@ in ]; environment.sessionVariables.NIXOS_OZONE_WL = "1"; - users.users.${username} = { - extraGroups = [ - "docker" - ]; - shell = pkgs.fish; - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIfql/a6ZtxOPgBhFzOfgTO6HGcy0Se9mgMLmOa40vMF" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIW2Yrqwi4YjIrdI8mygX5pTHDPmrUgbmpZ4WxoTqORi keihi@Vostro-LapTop" - ]; - }; programs.nix-ld.enable = true; programs.light.enable = true; From 61fb43ab7521941b89b5412a02212726f06179cd Mon Sep 17 00:00:00 2001 From: Hare Date: Sat, 28 Feb 2026 22:23:37 +0900 Subject: [PATCH 25/28] update: change mkHost field name --- hosts/arcadia/default.nix | 4 ++-- hosts/arcadia/hare/home-manager.nix | 8 +------- hosts/fungus/default.nix | 4 ++-- hosts/mkHost.nix | 7 ++++--- hosts/x1carbon/default.nix | 4 ++-- 5 files changed, 11 insertions(+), 16 deletions(-) diff --git a/hosts/arcadia/default.nix b/hosts/arcadia/default.nix index dc271d6..f97c99b 100644 --- a/hosts/arcadia/default.nix +++ b/hosts/arcadia/default.nix @@ -8,8 +8,8 @@ mkHost { users = [ { username = "hare"; - homeModule = [ ./hare/home-manager.nix ]; - userNixos = ./hare/nixos.nix; + home = ./hare/home-manager.nix; + nixos = ./hare/nixos.nix; } ]; systemModules = [ ./nixos.nix ]; diff --git a/hosts/arcadia/hare/home-manager.nix b/hosts/arcadia/hare/home-manager.nix index b906d1e..22d5224 100644 --- a/hosts/arcadia/hare/home-manager.nix +++ b/hosts/arcadia/hare/home-manager.nix @@ -53,15 +53,9 @@ unityhub nixd rust-analyzer - beeper - # aseprite + aseprite bambu-studio orca-slicer - - vinegar - - antigravity - davinci-resolve ]; services.easyeffects = { diff --git a/hosts/fungus/default.nix b/hosts/fungus/default.nix index e426a10..e5990a5 100644 --- a/hosts/fungus/default.nix +++ b/hosts/fungus/default.nix @@ -8,8 +8,8 @@ mkHost { users = [ { username = "hare"; - homeModule = [ ./hare/home-manager.nix ]; - userNixos = ./hare/nixos.nix; + home = ./hare/home-manager.nix; + nixos = ./hare/nixos.nix; } ]; systemModules = [ ./nixos.nix ]; diff --git a/hosts/mkHost.nix b/hosts/mkHost.nix index 9c9047a..f325f43 100644 --- a/hosts/mkHost.nix +++ b/hosts/mkHost.nix @@ -16,8 +16,8 @@ in modules = systemModules ++ (map (u: { pkgs, ... }: { - users.users.${u.username} = import u.userNixos { inherit pkgs; }; - }) (builtins.filter (u: u ? userNixos) users)) + users.users.${u.username} = import u.nixos { inherit pkgs; }; + }) (builtins.filter (u: u ? nixos) users)) ++ [ { users.users = builtins.listToAttrs (map (u: { @@ -56,7 +56,8 @@ in programs.home-manager.enable = true; } (import ../system/home-manager) - ] ++ u.homeModule; + u.home + ]; }; }) users); } diff --git a/hosts/x1carbon/default.nix b/hosts/x1carbon/default.nix index 408cc54..d3a2bc0 100644 --- a/hosts/x1carbon/default.nix +++ b/hosts/x1carbon/default.nix @@ -8,8 +8,8 @@ mkHost { users = [ { username = "hare"; - homeModule = [ ./hare/home-manager.nix ]; - userNixos = ./hare/nixos.nix; + home = ./hare/home-manager.nix; + nixos = ./hare/nixos.nix; } ]; systemModules = [ ./nixos.nix ]; From d9039467b264539245031c20af521b5d2fa5796a Mon Sep 17 00:00:00 2001 From: Hare Date: Sat, 28 Feb 2026 23:19:42 +0900 Subject: [PATCH 26/28] Update flake.lock --- flake.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/flake.lock b/flake.lock index a908112..c2738b4 100644 --- a/flake.lock +++ b/flake.lock @@ -25,11 +25,11 @@ ] }, "locked": { - "lastModified": 1770318660, - "narHash": "sha256-yFVde8QZK7Dc0Xa8eQDsmxLX4NJNfL1NKfctSyiQgMY=", + "lastModified": 1772218752, + "narHash": "sha256-G8nArvOTZXU8DRvrzAdz3Elcj6kA/vMtvY9mrGLATtA=", "owner": "nix-community", "repo": "home-manager", - "rev": "471e6a065f9efed51488d7c51a9abbd387df91b8", + "rev": "f3a30376bb9eb2f6f61816be7d6ed954b6d2a3b9", "type": "github" }, "original": { @@ -45,11 +45,11 @@ ] }, "locked": { - "lastModified": 1771130777, - "narHash": "sha256-UIKOwG0D9XVIJfNWg6+gENAvQP+7LO46eO0Jpe+ItJ0=", + "lastModified": 1771734689, + "narHash": "sha256-/phvMgr1yutyAMjKnZlxkVplzxHiz60i4rc+gKzpwhg=", "owner": "Mic92", "repo": "nix-index-database", - "rev": "efec7aaad8d43f8e5194df46a007456093c40f88", + "rev": "8f590b832326ab9699444f3a48240595954a4b10", "type": "github" }, "original": { @@ -60,11 +60,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1769302137, - "narHash": "sha256-QEDtctEkOsbx8nlFh4yqPEOtr4tif6KTqWwJ37IM2ds=", + "lastModified": 1771969195, + "narHash": "sha256-qwcDBtrRvJbrrnv1lf/pREQi8t2hWZxVAyeMo7/E9sw=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "a351494b0e35fd7c0b7a1aae82f0afddf4907aa8", + "rev": "41c6b421bdc301b2624486e11905c9af7b8ec68e", "type": "github" }, "original": { @@ -75,11 +75,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1770197578, - "narHash": "sha256-AYqlWrX09+HvGs8zM6ebZ1pwUqjkfpnv8mewYwAo+iM=", + "lastModified": 1771848320, + "narHash": "sha256-0MAd+0mun3K/Ns8JATeHT1sX28faLII5hVLq0L3BdZU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "00c21e4c93d963c50d4c0c89bfa84ed6e0694df2", + "rev": "2fc6539b481e1d2569f25f8799236694180c0993", "type": "github" }, "original": { From b65beb218da6b2f2f699e0409eed8a6397b2ddbb Mon Sep 17 00:00:00 2001 From: Hare Date: Sat, 28 Feb 2026 23:52:23 +0900 Subject: [PATCH 27/28] Update greeter.nix --- system/core/greeter.nix | 77 ++++++++++++++++++++++------------------- 1 file changed, 41 insertions(+), 36 deletions(-) diff --git a/system/core/greeter.nix b/system/core/greeter.nix index 588b4ca..8cba2ad 100644 --- a/system/core/greeter.nix +++ b/system/core/greeter.nix @@ -1,19 +1,16 @@ -{ config, pkgs, ... }: +{ 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" '' - monitor = DP-1, 5120x2880@60, 0x0, 2 - - monitor = DP-2, disable - monitor = DP-3, disable - + ${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" + env = XDG_SESSION_DESKTOP,Hyprland general { border_size = 0 @@ -33,39 +30,47 @@ let ''; in { - services.greetd.enable = true; - services.greetd.settings.default_session = { - command = "${pkgs.hyprland}/bin/start-hyprland -- -c ${hyprGreetConf}"; - user = "greeter"; + options.cornflake.greeter.monitors = lib.mkOption { + type = lib.types.listOf lib.types.str; + default = [ ]; + description = "greetd セッション用 Hyprland の monitor 設定"; }; - environment.systemPackages = [ - rosePineHyprcursor - ]; + config = { + services.greetd.enable = true; + services.greetd.settings.default_session = { + command = "${pkgs.hyprland}/bin/start-hyprland -- -c ${hyprGreetConf}"; + user = "greeter"; + }; - 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; + 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"; }; - }; - GTK = { - application_prefer_dark_theme = true; - }; - background = { - path = "/usr/share/wallpaper/arknights-image-01.png"; }; }; }; From 9f22a82d4aec27bcb002d69559b6996440971cd1 Mon Sep 17 00:00:00 2001 From: Hare Date: Sun, 1 Mar 2026 00:07:03 +0900 Subject: [PATCH 28/28] update monitor settings --- flake.nix | 3 +++ hosts/arcadia/nixos.nix | 8 +++++++- programs/utility.nix | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index fc42b0b..f8ad23a 100644 --- a/flake.nix +++ b/flake.nix @@ -34,6 +34,9 @@ apps.home-manager = { type = "app"; program = "${hm}/bin/home-manager"; + meta = { + description = "Home Manager for Nix"; + }; }; } )); diff --git a/hosts/arcadia/nixos.nix b/hosts/arcadia/nixos.nix index 583a497..fa44d0d 100644 --- a/hosts/arcadia/nixos.nix +++ b/hosts/arcadia/nixos.nix @@ -5,6 +5,12 @@ in { system.stateVersion = "25.11"; + cornflake.greeter.monitors = [ + "DP-1, 5120x2880@60, 0x0, 2" + "DP-2, disable" + "DP-3, disable" + ]; + imports = [ ./hardware-configuration.nix @@ -39,7 +45,7 @@ in "$@" '') - wineWowPackages.waylandFull + wineWow64Packages.waylandFull winetricks bluez diff --git a/programs/utility.nix b/programs/utility.nix index ed3ebe8..0fe76b5 100644 --- a/programs/utility.nix +++ b/programs/utility.nix @@ -10,6 +10,6 @@ bat wezterm libsixel - nixfmt-rfc-style + nixfmt ]; }