Compare commits

..

2 Commits

Author SHA1 Message Date
35623910b0 feat: multiple user 2026-02-28 19:42:36 +09:00
2acc8a1e67 Update structure 2026-02-28 19:06:35 +09:00
11 changed files with 141 additions and 122 deletions

View File

@ -4,6 +4,7 @@
enable = true; enable = true;
interactiveShellInit = '' interactiveShellInit = ''
set -g fish_greeting "" set -g fish_greeting ""
set -gx SSH_AUTH_SOCK "$XDG_RUNTIME_DIR/ssh-agent"
''; '';
}; };

15
hosts/arcadia/default.nix Normal file
View File

@ -0,0 +1,15 @@
inputs:
let
mkHost = import ../mkHost.nix inputs;
in
mkHost {
system = "x86_64-linux";
hostname = "Arcadia";
users = [
{
username = "hare";
homeModule = [ ./hare ];
}
];
systemModules = [ ./nixos.nix ];
}

View File

@ -8,19 +8,19 @@
home.stateVersion = "25.05"; home.stateVersion = "25.05";
imports = [ imports = [
inputs.nix-index-database.homeModules.nix-index inputs.nix-index-database.homeModules.nix-index
./display.nix ../display.nix
../../home-manager/tofi.nix ../../../home-manager/tofi.nix
../../home-manager/hyprland ../../../home-manager/hyprland
../../home-manager/fnott.nix ../../../home-manager/fnott.nix
../../home-manager/wezterm ../../../home-manager/wezterm
../../home-manager/fish ../../../home-manager/fish
../../home-manager/vscode.nix ../../../home-manager/vscode.nix
../../home-manager/direnv.nix ../../../home-manager/direnv.nix
../../home-manager/firefox.nix ../../../home-manager/firefox.nix
../../home-manager/obs-studio.nix ../../../home-manager/obs-studio.nix
../../home-manager/zeditor.nix ../../../home-manager/zeditor.nix
../../home-manager/blender.nix ../../../home-manager/blender.nix
../../home-manager/voicevox.nix ../../../home-manager/voicevox.nix
]; ];
hare.hyprland = { hare.hyprland = {
input.sensitivity = -1.0; input.sensitivity = -1.0;
@ -43,7 +43,6 @@
gimp gimp
inkscape inkscape
obsidian obsidian
# davinci-resolve
kdePackages.filelight kdePackages.filelight
inputs.zen-browser.packages."${stdenv.hostPlatform.system}".default inputs.zen-browser.packages."${stdenv.hostPlatform.system}".default
(deno.overrideAttrs (oldAttrs: { (deno.overrideAttrs (oldAttrs: {
@ -62,6 +61,8 @@
vinegar vinegar
antigravity antigravity
davinci-resolve
]; ];
services.easyeffects = { services.easyeffects = {
enable = true; enable = true;

View File

@ -1,96 +1,10 @@
inputs: 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 { rec {
hosts = { hosts = {
arcadia = arcadia = import ./arcadia inputs;
let x1carbon = import ./x1carbon inputs;
inputs.nixpkgs = import inputs.nixpkgs { fungus = import ./fungus inputs;
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
];
};
}; };
nixos = builtins.mapAttrs (_: host: host.nixos) hosts; 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));
} }

15
hosts/fungus/default.nix Normal file
View File

@ -0,0 +1,15 @@
inputs:
let
mkHost = import ../mkHost.nix inputs;
in
mkHost {
system = "x86_64-linux";
hostname = "Fungus";
users = [
{
username = "hare";
homeModule = [ ./hare ];
}
];
systemModules = [ ./nixos.nix ];
}

View File

@ -1,17 +1,16 @@
{ conifg, pkgs, ... }: { pkgs, ... }:
{ {
home.stateVersion = "25.05"; home.stateVersion = "25.05";
imports = [ imports = [
../../home-manager/direnv.nix ../../../home-manager/direnv.nix
../../home-manager/wezterm ../../../home-manager/wezterm
../../home-manager/fish ../../../home-manager/fish
];
home.packages = with pkgs; [
]; ];
home.packages = with pkgs; [ ];
programs.git = { programs.git = {
enable = true; enable = true;
userName = "Hare"; settings.user.name = "Hare";
userEmail = "kei.hiracchi.0928@gmail.com"; settings.user.email = "kei.hiracchi.0928@gmail.com";
}; };
fonts = { fonts = {

57
hosts/mkHost.nix Normal file
View File

@ -0,0 +1,57 @@
inputs:
{
system,
hostname,
users,
systemModules,
}:
let
pkgs = import inputs.nixpkgs {
inherit system;
config.allowUnfree = true;
};
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);
}
];
inherit system;
specialArgs = {
inherit inputs hostname;
username = (builtins.head users).username;
};
};
home-manager = builtins.listToAttrs (map (u: {
name = "${u.username}@${hostname}";
value = inputs.home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = {
inherit inputs hostname;
username = u.username;
};
modules = [
{
home = {
username = u.username;
homeDirectory = "/home/${u.username}";
};
programs.home-manager.enable = true;
}
(import ../system/home-manager)
] ++ u.homeModule;
};
}) users);
}

View File

@ -0,0 +1,15 @@
inputs:
let
mkHost = import ../mkHost.nix inputs;
in
mkHost {
system = "x86_64-linux";
hostname = "x1carbon";
users = [
{
username = "hare";
homeModule = [ ./hare ];
}
];
systemModules = [ ./nixos.nix ];
}

View File

@ -7,16 +7,16 @@
{ {
home.stateVersion = "25.05"; home.stateVersion = "25.05";
imports = [ imports = [
../../home-manager/hyprland ../../../home-manager/hyprland
../../home-manager/tofi.nix ../../../home-manager/tofi.nix
../../home-manager/fnott.nix ../../../home-manager/fnott.nix
../../home-manager/direnv.nix ../../../home-manager/direnv.nix
../../home-manager/obs-studio.nix ../../../home-manager/obs-studio.nix
../../home-manager/wezterm ../../../home-manager/wezterm
../../home-manager/fish ../../../home-manager/fish
]; ];
hare.hyprland = { 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; input.sensitivity = -0.6;
wallpaperCommand = "swww img /usr/share/wallpaper/"; wallpaperCommand = "swww img /usr/share/wallpaper/";
}; };

View File

@ -31,12 +31,13 @@ in
fzf fzf
ghq ghq
android-tools
]; ];
environment.sessionVariables.NIXOS_OZONE_WL = "1"; environment.sessionVariables.NIXOS_OZONE_WL = "1";
users.users.${username} = { users.users.${username} = {
extraGroups = [ extraGroups = [
"adbusers"
"docker" "docker"
]; ];
shell = pkgs.fish; shell = pkgs.fish;
@ -45,7 +46,6 @@ in
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIW2Yrqwi4YjIrdI8mygX5pTHDPmrUgbmpZ4WxoTqORi keihi@Vostro-LapTop" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIW2Yrqwi4YjIrdI8mygX5pTHDPmrUgbmpZ4WxoTqORi keihi@Vostro-LapTop"
]; ];
}; };
programs.adb.enable = true;
programs.nix-ld.enable = true; programs.nix-ld.enable = true;
programs.light.enable = true; programs.light.enable = true;

View File

@ -1,4 +1,6 @@
{ {
programs.ssh.startAgent = true;
services.openssh = { services.openssh = {
enable = true; enable = true;
ports = [ 22 ]; ports = [ 22 ];