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. 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? # 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 ```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… 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, catppuccin,
... ...
}: }:
let
user = "szymon";
# for git
email = "szymon_jozef@proton.me";
full_name = "Szymon P";
in
{ {
homeConfigurations = {
homeConfigurations."szymon" = home-manager.lib.homeManagerConfiguration { "arch" = home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs { pkgs = import nixpkgs { system = "x86_64-linux"; };
system = "x86_64-linux"; extraSpecialArgs = {
isNixOS = false;
username = user;
email = email;
full_name = full_name;
}; };
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 = [ modules = [
./home.nix ./home.nix
catppuccin.homeModules.catppuccin 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 # Home Manager needs a bit of information about you and the paths it should
# manage. # manage.
home.username = "szymon"; home.username = username;
home.homeDirectory = "/home/szymon"; home.homeDirectory = "/home/${username}";
home.file."test-os.txt".text = if isNixOS then "this is nixos" else "this is arch";
nix = { nix = {
package = pkgs.nix; package = pkgs.nix;
@@ -60,10 +67,6 @@
VISUAL = "nvim"; VISUAL = "nvim";
}; };
home.sessionPath = [
"/home/szymon/.lmstudio/bin"
];
# Let Home Manager install and manage itself. # Let Home Manager install and manage itself.
programs.home-manager.enable = true; programs.home-manager.enable = true;
} }

View File

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

View File

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

View File

@@ -1,4 +1,4 @@
{ pkgs, ... }: { isNixOS, ... }:
{ {
programs.fish = { programs.fish = {
@@ -42,7 +42,9 @@
set -l rel_file (realpath --relative-to=$config_dir $file) 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 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"

View File

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

View File

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

View File

@@ -1,15 +1,20 @@
{ ... }: {
lib,
isNixOS,
username,
...
}:
{ {
programs.satty = { programs.satty = {
enable = true; enable = true;
package = null; package = lib.mkIf (!isNixOS) null;
settings = { settings = {
general = { general = {
fullscreen = true; fullscreen = true;
early-exit = true; early-exit = true;
initial-tool = "crop"; 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; save-after-copy = true;
disable-notifications = false; disable-notifications = false;
actions-on-escape = [ "exit" ]; actions-on-escape = [ "exit" ];

View File

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

View File

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