move host names to flakes

This commit is contained in:
2026-02-27 21:14:37 +01:00
parent cbc68e2b5a
commit 997e669803
2 changed files with 48 additions and 23 deletions

View File

@@ -32,7 +32,7 @@
}@inputs: }@inputs:
let let
userConfig = { baseUserConfig = {
username = "szymon"; username = "szymon";
# for git # for git
email = "szymon_jozef@proton.me"; email = "szymon_jozef@proton.me";
@@ -40,7 +40,7 @@
# your public ssh key # your public ssh key
signingKey = "~/.ssh/github.pub"; signingKey = "~/.ssh/github.pub";
mainMonitor = "eDP-1"; # only for some applications: you still need to set hyprland monitors yourself! mainMonitor = "DP-1"; # only for some applications: you still need to set hyprland monitors yourself!
statusBar = "ashell"; # available: ashell|waybar statusBar = "ashell"; # available: ashell|waybar
pathConfig = { pathConfig = {
@@ -51,45 +51,70 @@
}; };
system = "x86_64-linux"; system = "x86_64-linux";
general_import = import nixpkgs { general_import = import nixpkgs {
inherit system; inherit system;
config.allowUnfree = true; config.allowUnfree = true;
}; };
general_special_args = {
inherit
inputs
userConfig
;
};
general_module_import = [ general_module_import = [
./home.nix ./home.nix
catppuccin.homeModules.catppuccin catppuccin.homeModules.catppuccin
nixvim.homeModules.nixvim nixvim.homeModules.nixvim
]; ];
in mkHomeConfig =
{ {
homeConfigurations = { isNixOS,
"arch" = home-manager.lib.homeManagerConfiguration { overrides ? { },
hostName,
}:
home-manager.lib.homeManagerConfiguration {
pkgs = general_import; pkgs = general_import;
extraSpecialArgs = general_special_args // { extraSpecialArgs = {
isNixOS = false; inherit inputs isNixOS hostName;
userConfig = baseUserConfig // overrides;
}; };
modules = general_module_import; modules = general_module_import;
}; };
"nixos" = home-manager.lib.homeManagerConfiguration { in
pkgs = general_import; {
homeConfigurations = {
"arch" = mkHomeConfig {
isNixOS = false;
hostName = "arch";
};
extraSpecialArgs = general_special_args // { "nixos" = mkHomeConfig {
isNixOS = true; isNixOS = true;
hostName = "nixos";
};
"pitagoras" = mkHomeConfig {
isNixOS = true;
overrides = {
mainMonitor = "eDP-1";
}; };
hostName = "pitagoras";
};
modules = general_module_import; "pilecki" = mkHomeConfig {
isNixOS = true;
overrides = {
mainMonitor = "LVDS-1";
};
hostName = "pilecki";
};
"paderewski" = mkHomeConfig {
isNixOS = false;
overrides = {
mainMonitor = "DP-1";
};
hostName = "paderewski";
}; };
}; };
}; };

View File

@@ -1,4 +1,4 @@
{ isNixOS, ... }: { isNixOS, hostName, ... }:
{ {
programs.fish = { programs.fish = {
@@ -45,7 +45,7 @@
set -l rel_file (realpath --relative-to=$config_dir $file) set -l rel_file (realpath --relative-to=$config_dir $file)
if nh home switch $config_dir -c ${if isNixOS then "nixos" else "arch"} if nh home switch $config_dir -c ${hostName}
git add -A git add -A
set commit_msg "update: $rel_file" set commit_msg "update: $rel_file"
git commit -m "$commit_msg" git commit -m "$commit_msg"
@@ -61,7 +61,7 @@
reload_dotfiles = { reload_dotfiles = {
body = # fish body = # fish
"nh home switch ~/.config/home-manager -c ${if isNixOS then "nixos" else "arch"}"; "nh home switch ~/.config/home-manager -c ${hostName}";
}; };
ls = { ls = {