some flake magic or something

This commit is contained in:
2026-02-21 21:02:47 +01:00
parent 3741241dbb
commit c240678e80
11 changed files with 81 additions and 37 deletions

View File

@@ -23,11 +23,15 @@ Then I created [superior dotfiles](https://github.com/szymon-jozef/superior_dotf
As of today I'm using this repo with home manager. I'm still trying stuff out, but it looks pretty good right now.
# How to try this out?
I guess you should [install home manager](https://nix-community.github.io/home-manager/index.xhtml#sec-install-standalone). You can do it on *any* distro! Then you just copy this repo to `~/.config/home-manager` and run
I guess you should [install home manager](https://nix-community.github.io/home-manager/index.xhtml#sec-install-standalone). You can do it on *any* distro, but I only use Arch, so I don't guarantee it will work elsewhere. To try it out just copy this repo to `~/.config/home-manager`, cd there and then run:
## On NixOS
```bash
home-manager switch -b backup
home-manager switch --flake .#nixos -b backup
```
## On Arch
```bash
home-manager switch --flake .#arch -b backup
```
---
I hope you'll enjoy it, if you for whatever reason want to try this random ass dotfiles found on the internet…

View File

@@ -18,17 +18,42 @@
catppuccin,
...
}:
let
user = "szymon";
# for git
email = "szymon_jozef@proton.me";
full_name = "Szymon P";
in
{
homeConfigurations = {
"arch" = home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs { system = "x86_64-linux"; };
extraSpecialArgs = {
isNixOS = false;
username = user;
email = email;
full_name = full_name;
};
modules = [
./home.nix
catppuccin.homeModules.catppuccin
];
homeConfigurations."szymon" = home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs {
system = "x86_64-linux";
};
modules = [
./home.nix
catppuccin.homeModules.catppuccin
];
"nixos" = home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs { system = "x86_64-linux"; };
extraSpecialArgs = {
isNixOS = true;
username = user;
email = email;
full_name = full_name;
};
modules = [
./home.nix
catppuccin.homeModules.catppuccin
];
};
};
};
}

View File

@@ -1,10 +1,17 @@
{ config, pkgs, ... }:
{
pkgs,
isNixOS,
username,
...
}:
{
# Home Manager needs a bit of information about you and the paths it should
# manage.
home.username = "szymon";
home.homeDirectory = "/home/szymon";
home.username = username;
home.homeDirectory = "/home/${username}";
home.file."test-os.txt".text = if isNixOS then "this is nixos" else "this is arch";
nix = {
package = pkgs.nix;
@@ -60,10 +67,6 @@
VISUAL = "nvim";
};
home.sessionPath = [
"/home/szymon/.lmstudio/bin"
];
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
}

View File

@@ -1,9 +1,9 @@
{ ... }:
{ lib, isNixOS, ... }:
{
programs.ashell = {
enable = true;
package = null;
package = lib.mkIf (!isNixOS) null;
settings = {
outputs = {
Targets = [ "DP-1" ];

View File

@@ -1,4 +1,4 @@
{ pgks, ... }:
{ ... }:
{
programs.atuin = {

View File

@@ -1,4 +1,4 @@
{ pkgs, ... }:
{ isNixOS, ... }:
{
programs.fish = {
@@ -42,7 +42,9 @@
set -l rel_file (realpath --relative-to=$config_dir $file)
if home-manager switch -b backup
if home-manager switch --flake "$config_dir#${
if isNixOS then "nixos" else "arch"
}" -b backup
git add -A
set commit_msg "update: $rel_file"
git commit -m "$commit_msg"

View File

@@ -1,4 +1,9 @@
{ pkgs, ... }:
{
pkgs,
full_name,
email,
...
}:
{
home.packages = with pkgs; [
@@ -9,8 +14,8 @@
enable = true;
settings = {
user = {
name = "Szymon P";
email = "szymon_jozef@proton.me";
name = full_name;
email = email;
};
init.defaultBranch = "master";
push.autoSetupRemote = true;
@@ -18,7 +23,7 @@
};
signing = {
key = "szymon_jozef@proton.me";
key = email;
signByDefault = true;
};

View File

@@ -1,9 +1,9 @@
{ lib, ... }:
{ lib, isNixOS, ... }:
{
programs.kitty = lib.mkForce {
programs.kitty = {
enable = true;
package = null;
package = lib.mkIf (!isNixOS) null;
settings = {
confirm_os_window_close = 0;
dynamic_background_opacity = true;

View File

@@ -1,15 +1,20 @@
{ ... }:
{
lib,
isNixOS,
username,
...
}:
{
programs.satty = {
enable = true;
package = null;
package = lib.mkIf (!isNixOS) null;
settings = {
general = {
fullscreen = true;
early-exit = true;
initial-tool = "crop";
output-filename = "/home/szymon/Obrazy/zrzuty/%d-%m-%Y_%H:%M:%S.png";
output-filename = "/home/${username}/Obrazy/zrzuty/%d-%m-%Y_%H:%M:%S.png";
save-after-copy = true;
disable-notifications = false;
actions-on-escape = [ "exit" ];

View File

@@ -1,4 +1,4 @@
{ args, ... }:
{ username, ... }:
{
services.ssh-agent.enable = true;
@@ -10,13 +10,13 @@
matchBlocks = {
"dmowski" = {
hostname = "192.168.0.30";
user = "szymon";
user = username;
port = 22;
identityFile = "~/.ssh/dmowski";
};
"aur.archlinux.org" = {
user = "szymon";
user = username;
identityFile = "~/.ssh/aur";
};

View File

@@ -1,4 +1,4 @@
{ pgks, ... }:
{ ... }:
{
programs.yazi = {