mirror of
https://github.com/szymon-jozef/amazing-dotfiles.git
synced 2026-10-27 19:20:43 +01:00
move host names to flakes
This commit is contained in:
67
flake.nix
67
flake.nix
@@ -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
|
||||||
];
|
];
|
||||||
|
|
||||||
|
mkHomeConfig =
|
||||||
|
{
|
||||||
|
isNixOS,
|
||||||
|
overrides ? { },
|
||||||
|
hostName,
|
||||||
|
}:
|
||||||
|
home-manager.lib.homeManagerConfiguration {
|
||||||
|
pkgs = general_import;
|
||||||
|
|
||||||
|
extraSpecialArgs = {
|
||||||
|
inherit inputs isNixOS hostName;
|
||||||
|
userConfig = baseUserConfig // overrides;
|
||||||
|
};
|
||||||
|
|
||||||
|
modules = general_module_import;
|
||||||
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
homeConfigurations = {
|
homeConfigurations = {
|
||||||
"arch" = home-manager.lib.homeManagerConfiguration {
|
"arch" = mkHomeConfig {
|
||||||
pkgs = general_import;
|
|
||||||
|
|
||||||
extraSpecialArgs = general_special_args // {
|
|
||||||
isNixOS = false;
|
isNixOS = false;
|
||||||
|
hostName = "arch";
|
||||||
};
|
};
|
||||||
|
|
||||||
modules = general_module_import;
|
"nixos" = mkHomeConfig {
|
||||||
};
|
|
||||||
|
|
||||||
"nixos" = home-manager.lib.homeManagerConfiguration {
|
|
||||||
pkgs = general_import;
|
|
||||||
|
|
||||||
extraSpecialArgs = general_special_args // {
|
|
||||||
isNixOS = true;
|
isNixOS = true;
|
||||||
|
hostName = "nixos";
|
||||||
};
|
};
|
||||||
|
|
||||||
modules = general_module_import;
|
"pitagoras" = mkHomeConfig {
|
||||||
|
isNixOS = true;
|
||||||
|
overrides = {
|
||||||
|
mainMonitor = "eDP-1";
|
||||||
|
};
|
||||||
|
hostName = "pitagoras";
|
||||||
|
};
|
||||||
|
|
||||||
|
"pilecki" = mkHomeConfig {
|
||||||
|
isNixOS = true;
|
||||||
|
overrides = {
|
||||||
|
mainMonitor = "LVDS-1";
|
||||||
|
};
|
||||||
|
hostName = "pilecki";
|
||||||
|
};
|
||||||
|
|
||||||
|
"paderewski" = mkHomeConfig {
|
||||||
|
isNixOS = false;
|
||||||
|
overrides = {
|
||||||
|
mainMonitor = "DP-1";
|
||||||
|
};
|
||||||
|
hostName = "paderewski";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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 = {
|
||||||
|
|||||||
Reference in New Issue
Block a user