Compare commits

...

3 Commits

Author SHA1 Message Date
ef82b13831 System update 2025-01-03 15:19:10 +01:00
6e5778b4d5 install script update 2025-01-03 15:18:25 +01:00
10a3bb165d cleanup and fixes 2025-01-03 15:18:02 +01:00
13 changed files with 135 additions and 93 deletions

View File

@ -23,7 +23,7 @@
## Build and deploy ## Build and deploy
### Automatic installation ### Automatic installation **Recommended**
- Use this one command on system with NixOS installed - Use this one command on system with NixOS installed
- This will download script with installation commands - This will download script with installation commands
@ -32,28 +32,25 @@
nix-shell -p git --command "nix run --experimental-features 'nix-command flakes' git+https://git.foglar.tech/foglar/dotfiles" nix-shell -p git --command "nix run --experimental-features 'nix-command flakes' git+https://git.foglar.tech/foglar/dotfiles"
``` ```
> [!IMPORTANT]
> Ultimately, I cant gaurantee this will work for anyone other than myself, so use this at your own discretion.
### Manual installation ### Manual installation
- Build and install with ssmple command: - Simple build command using kogami profile
```bash
nix run git+https://git.foglar.tech/foglar/dotfiles.git
```
- simple build command for system using kogami profile
```bash ```bash
git clone https://git.foglar.tech/foglar/dotfiles.git $HOME/.dotfiles git clone https://git.foglar.tech/foglar/dotfiles.git $HOME/.dotfiles
sudo nixos-rebuild switch --flake ~/.dotfiles#kogami --update # To update flake.lock file sudo nixos-rebuild switch --flake ~/.dotfiles#kogami --update # To update flake.lock file
``` ```
- generate a vm of the flake with this command - Generate a vm of the flake with this command
```bash ```bash
nix run github:nix-community/nixos-generators -- -c ./flake.nix --flake '#ginoza' -f vm --disk-size 20480 nix run github:nix-community/nixos-generators -- -c ./flake.nix --flake '#ginoza' -f vm --disk-size 20480
``` ```
- deploy configuration on the new system - Deploy configuration on the new system
```bash ```bash
# Copy my repository # Copy my repository
@ -126,7 +123,7 @@ nix-shell nixpkgs#age -c age-keygen -o ~/.config/sops/age/keys.txt
``` ```
- Secrets are managed in yaml file [secrets.yaml](./nixos/system/packages/sops/secrets/secrets.yaml) - Secrets are managed in yaml file [secrets.yaml](./nixos/system/packages/sops/secrets/secrets.yaml)
- Things that are actually managed in sops configuration: - Things that are managed in sops configuration:
- SSH keys - SSH keys
- Passwords - Passwords
- Yubikey ID - Yubikey ID
@ -186,7 +183,7 @@ nvim /nixos/system/packages/ssh-client.nix
- [EmergentMind's Nix-Config](https://github.com/EmergentMind/nix-config) - explanation of Yubikey setup and declarative configuration of SSH keys - [EmergentMind's Nix-Config](https://github.com/EmergentMind/nix-config) - explanation of Yubikey setup and declarative configuration of SSH keys
- [YT video](https://www.youtube.com/watch?v=3CeXbONjIgE) - [YT video](https://www.youtube.com/watch?v=3CeXbONjIgE)
- [LibrePhoenix's Nix-Config](https://github.com/librephoenix/nixos-config) - if else options and modular control center - [LibrePhoenix's Nix-Config](https://github.com/librephoenix/nixos-config) - if else options, modular control center, one line installation
- [YT video about modular control center](https://www.youtube.com/watch?v=H_Qct7TVB6o) - [YT video about modular control center](https://www.youtube.com/watch?v=H_Qct7TVB6o)
- [YT video about if else options](https://www.youtube.com/watch?v=Qull6TMQm4Q) - [YT video about if else options](https://www.youtube.com/watch?v=Qull6TMQm4Q)
- [YT video about install with one command](https://www.youtube.com/watch?v=20BN4gqHwaQ&t=2025s) - [YT video about install with one command](https://www.youtube.com/watch?v=20BN4gqHwaQ&t=2025s)

View File

@ -22,19 +22,22 @@
- [x] fix wlogout - [x] fix wlogout
- [x] cleanup hyprland subtools (rofi, hyprlock, waybar) - [x] cleanup hyprland subtools (rofi, hyprlock, waybar)
- [x] fix rofi cliboard manager by moving it into separate file managed by nix - [x] fix rofi cliboard manager by moving it into separate file managed by nix
- [x] nix-on-droid
- [x] stylix make in one place and check for each program if it is enabled (tmux)
- [ ] neovim - [ ] neovim
- [ ] librewolf and firefox fix, extensions and bookmarks in librewolf - [ ] librewolf and firefox fix, extensions and bookmarks in librewolf
- [ ] modularize hyprland config into multiple files - [ ] modularize hyprland config into multiple files
- [ ] consider moving nh config helper into module - [ ] consider moving nh config helper into module
- [ ] make static background folder and figure out how to simply manage backgrounds across my devices - [ ] make static background folder and figure out how to simply manage backgrounds across my devices
- [ ] fix plasma manager and extend gnome configuration - [ ] fix plasma manager and extend gnome configuration
- [ ] nix-on-droid
- [ ] ssh public key deployment - [ ] ssh public key deployment
- [ ] consider moving userSettings from flake.nix to each profile - [ ] consider moving userSettings from flake.nix to each profile
- [ ] add grub bootloader to configuration - [ ] add grub bootloader to configuration (and theme)
- [ ] stylix make in one place and check for each program if it is enabled (tmux)
- [ ] distinguish between profiles and decide which version of nixpkgs it should use (my notebook unstable, server stable ...) - [ ] distinguish between profiles and decide which version of nixpkgs it should use (my notebook unstable, server stable ...)
- [ ] check nvtop if nvidia is enabled - [ ] check nvtop if nvidia is enabled
- [ ] add notification management for bluetooth etc...
- [ ] add syncthing configuration
- [ ] qutebrowser configuration
- [ ] update my home page and create new web - [ ] update my home page and create new web
- [ ] fix kde theme in stylix - [ ] fix kde theme in stylix

View File

@ -128,11 +128,11 @@
}, },
"locked": { "locked": {
"dir": "pkgs/firefox-addons", "dir": "pkgs/firefox-addons",
"lastModified": 1735736119, "lastModified": 1735902745,
"narHash": "sha256-LlFTsG0yk8OZ+HjuxnpEzliG0bf+BEWLvKHQZkFtQ+U=", "narHash": "sha256-Jc4QaD2ay04ogn8XND8WLcs4ZsBBlk4j50OK+0AFFJ4=",
"owner": "rycee", "owner": "rycee",
"repo": "nur-expressions", "repo": "nur-expressions",
"rev": "4da6d4129925b1884cf0d1eb79ba6983abfa6933", "rev": "bb5bbc46eb380d3a9bd12e5f7fdd171c65280a8a",
"type": "gitlab" "type": "gitlab"
}, },
"original": { "original": {
@ -284,11 +284,11 @@
"zig": "zig" "zig": "zig"
}, },
"locked": { "locked": {
"lastModified": 1735689283, "lastModified": 1735875799,
"narHash": "sha256-LOZRScnB8Q9ylmlXnt2j2v4Aj1b5JZTdSeKYaFL1RDw=", "narHash": "sha256-EI6C+CRmfHqkjnp0aJxYb/pTImwb5FZOu1HWHnnZsOc=",
"owner": "ghostty-org", "owner": "ghostty-org",
"repo": "ghostty", "repo": "ghostty",
"rev": "60611b8a4a1d5b3c1097cce85eb0311de0696cfa", "rev": "e2f9eb6a6f4dc2108f91293938374c0ed314dcb8",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -343,11 +343,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1735745492, "lastModified": 1735900408,
"narHash": "sha256-Vs2IkQx4uDv2YehZ1sCw9K+kuMrBa3opnkGJJhMPNPo=", "narHash": "sha256-U+oZBQ3f5fF2hHsupKQH4ihgTKLHgcJh6jEmKDg+W10=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "9a9fef316ad191b3086edda465e850af282de4e0", "rev": "1c8d4c8d592e8fab4cff4397db5529ec6f078cf9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -385,11 +385,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1733085484, "lastModified": 1735774425,
"narHash": "sha256-dVmNuUajnU18oHzBQWZm1BQtANCHaqNuxTHZQ+GN0r8=", "narHash": "sha256-C73gLFnEh8ZI0uDijUgCDWCd21T6I6tsaWgIBHcfAXg=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "c1fee8d4a60b89cae12b288ba9dbc608ff298163", "rev": "5f6aa268e419d053c3d5025da740e390b12ac936",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -474,11 +474,11 @@
"xdph": "xdph" "xdph": "xdph"
}, },
"locked": { "locked": {
"lastModified": 1735748884, "lastModified": 1735851503,
"narHash": "sha256-+0Fl1mesL6RJ9Z8jjQtRgdW6R0C4Ptmm89yZJCOyMgM=", "narHash": "sha256-r5FFHhiZZOOlzWsS06oz+7MKpjJydDXsD9N2NcKFSjE=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "Hyprland", "repo": "Hyprland",
"rev": "7f177fa1cf3d8ede2841cdbbbdb7acaf27e40d57", "rev": "f3c49c1295126c2154ee800ceedb48b79451840c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -499,11 +499,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1728345020, "lastModified": 1735734474,
"narHash": "sha256-xGbkc7U/Roe0/Cv3iKlzijIaFBNguasI31ynL2IlEoM=", "narHash": "sha256-9OV4lOqrEJVLdOrpNN/9msNwAhI6FQTu4N7fufilG08=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprland-protocols", "repo": "hyprland-protocols",
"rev": "a7c183800e74f337753de186522b9017a07a8cee", "rev": "271df559dd30e4bc5ec6af02d017ac0aaabd63a7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -650,11 +650,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1735547435, "lastModified": 1735774660,
"narHash": "sha256-Gf6EuiKaxINuVYfDH4NQ8+WJWHovz2SUTa3WaKS0GlI=", "narHash": "sha256-g/9+jzWvu73YPHw9AB/yVCDSld7GdovliAUkfVP7YU0=",
"owner": "Mic92", "owner": "Mic92",
"repo": "nix-ld", "repo": "nix-ld",
"rev": "2cfdb1f527f060d215ba284348e46c8678512b71", "rev": "5f12c696cae384350f95f2af9dffe39ee0e445e5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -789,11 +789,11 @@
}, },
"nixpkgs-stable_3": { "nixpkgs-stable_3": {
"locked": { "locked": {
"lastModified": 1735531152, "lastModified": 1735669367,
"narHash": "sha256-As8I+ebItDKtboWgDXYZSIjGlKeqiLBvjxsQHUmAf1Q=", "narHash": "sha256-tfYRbFhMOnYaM4ippqqid3BaLOXoFNdImrfBfCp4zn0=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "3ffbbdbac0566a0977da3d2657b89cbcfe9a173b", "rev": "edf04b75c13c2ac0e54df5ec5c543e300f76f1c9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -962,11 +962,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1735468296, "lastModified": 1735844895,
"narHash": "sha256-ZjUjbvS06jf4fElOF4ve8EHjbpbRVHHypStoY8HGzk8=", "narHash": "sha256-CIRlqX9tBK2awJkmVu2cKuap/0QziDXStQZ/u/+e8Z4=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "bcb8b65aa596866eb7e5c3e1a6cccbf5d1560b27", "rev": "24d89184adf76d7ccc99e659dc5f3838efb5ee32",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -983,11 +983,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1735704986, "lastModified": 1735877772,
"narHash": "sha256-ExCFptQk7nPPDOopYGo3lTqXb+0Hr+vt1yG158hbCb0=", "narHash": "sha256-6OT4xYCwZTJ9qK28NNM98ibFZinwrJK/sRlg+dDqdJs=",
"owner": "Gerg-L", "owner": "Gerg-L",
"repo": "spicetify-nix", "repo": "spicetify-nix",
"rev": "11f711f1cb90f8b07ea735bd411c50b0abd850e8", "rev": "0227d83d2eb29189b8ed8d180e2442ada633dd0d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1015,11 +1015,11 @@
"tinted-tmux": "tinted-tmux" "tinted-tmux": "tinted-tmux"
}, },
"locked": { "locked": {
"lastModified": 1735664732, "lastModified": 1735864066,
"narHash": "sha256-KoXLDDDT/nMBMl6VtoAGxJ58COvT+SWL5aiR+hUPBUo=", "narHash": "sha256-V1JmPXW3vmxCuvf+IItGlLgBH8rolUahCMFyglxy19s=",
"owner": "danth", "owner": "danth",
"repo": "stylix", "repo": "stylix",
"rev": "f48cab39ba162c5eaef3d975aaac467c20db402b", "rev": "0ce2a52decf36d815065f8cda06586ed59ed3ef7",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -1,26 +1,46 @@
#!/bin/sh #!/bin/sh
echo "Running script"
if [ $# -gt 0 ]; then if [ $# -gt 0 ]; then
SCRIPT_DIR=$1 SCRIPT_DIR=$1
else else
SCRIPT_DIR=~/.dotfiles SCRIPT_DIR=~/.dotfiles
fi fi
if [ -d $SCRIPT_DIR ]; then
gum confirm "The directory $SCRIPT_DIR already exists. Do you want to delete it?" && yes | rm -rv $SCRIPT_DIR
fi
nixos_profile=$(gum choose kogami ginoza tsunemori)
download_wallpapers=$(gum confirm "Do you want to download wallpapers (it may take longer)?" && echo true || echo false)
if [ -d $SCRIPT_DIR ]; then
gum warn "The directory $SCRIPT_DIR already exists. Downloading updates..."
cd $SCRIPT_DIR && git pull
else
nix-shell -p git --command "git clone https://git.foglar.tech/foglar/dotfiles.git $SCRIPT_DIR" nix-shell -p git --command "git clone https://git.foglar.tech/foglar/dotfiles.git $SCRIPT_DIR"
fi
sudo nixos-generate-config --show-hardware-config >$SCRIPT_DIR/kogami/hardware-configuration.nix sudo nixos-generate-config --show-hardware-config >$SCRIPT_DIR/kogami/hardware-configuration.nix
gum log --structured --level info "Creating hardware configuration..." file $SCRIPT_DIR/kogami/hardware-configuration.nix
sudo nixos-generate-config --show-hardware-config >$SCRIPT_DIR/ginoza/hardware-configuration.nix sudo nixos-generate-config --show-hardware-config >$SCRIPT_DIR/ginoza/hardware-configuration.nix
gum log --structured --level info "Creating hardware configuration..." file $SCRIPT_DIR/kogami/hardware-configuration.nix
# Username
sed -i "0,/shinya/s//$(whoami)/" $SCRIPT_DIR/flake.nix sed -i "0,/shinya/s//$(whoami)/" $SCRIPT_DIR/flake.nix
gum log --structured --level info "Setting user name in flake.nix..." file $SCRIPT_DIR/flake.nix
# Set hostname by selected profile
sed -i "0,/kogami/s//$profile/" $SCRIPT_DIR/flake.nix
gum log --structured --level info "Setting hostname in flake.nix..." file $SCRIPT_DIR/flake.nix
# Set dotfiles path as $SCRIPT_DIR path
# Editor
if [ -z $EDITOR ]; then if [ -z $EDITOR ]; then
EDITOR=nano EDITOR=nano
fi fi
gum log --structured --level info "Opening flake.nix in $EDITOR..." file $SCRIPT_DIR/flake.nix
$EDITOR $SCRIPT_DIR/flake.nix $EDITOR $SCRIPT_DIR/flake.nix
profile=$(gum choose kogami ginoza) gum log --structured --level info "Building configuration for $profile..." profile $profile
sudo nixos-rebuild build --flake $SCRIPT_DIR#"${profile}" sudo nixos-rebuild build --flake $SCRIPT_DIR#"${profile}"
gum confirm "Do you want to switch to the new configuration?" && sudo nixos-rebuild switch --flake $SCRIPT_DIR#"${profile}" gum confirm "Do you want to reboot now?" && systemctl reboot || gum log "Please reboot later, to switch to the new configuration"
gum confirm "Do you want to reboot now?" && systemctl reboot || echo "Please reboot later, to switch to the new configuration"

View File

@ -25,6 +25,7 @@
ranger ranger
unzip unzip
fd fd
imagemagick # convert images from formats like jpg, png, etc.
] ]
++ ( ++ (
if pkgs.system == "x86_64-linux" if pkgs.system == "x86_64-linux"

View File

@ -47,25 +47,6 @@
NIXOS_OZONE_WL = "1"; NIXOS_OZONE_WL = "1";
}; };
stylix.iconTheme = {
enable = true;
package = pkgs.papirus-icon-theme;
dark = "Papirus-Dark";
};
stylix.targets = {
dunst.enable = true;
kde.enable = true;
gtk.enable = true;
waybar = {
enable = true;
enableCenterBackColors = false;
enableLeftBackColors = false;
enableRightBackColors = false;
};
};
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
enable = true; enable = true;

View File

@ -56,10 +56,4 @@
btop.enable = lib.mkDefault true; btop.enable = lib.mkDefault true;
fzf.enable = lib.mkDefault true; fzf.enable = lib.mkDefault true;
}; };
home.packages = with pkgs; [
alejandra
nh
nixd
];
} }

View File

@ -23,8 +23,12 @@
./tools/kitty.nix ./tools/kitty.nix
./tools/tmux.nix ./tools/tmux.nix
./tools/zoxide.nix ./tools/zoxide.nix
./style.nix
]; ];
style.enable = true;
sh.bash = { sh.bash = {
enable = enable =
if userSettings.shell == "bash" if userSettings.shell == "bash"
@ -97,16 +101,8 @@
fzf.enable = lib.mkDefault true; fzf.enable = lib.mkDefault true;
}; };
stylix.targets = {
bat.enable = lib.mkDefault true;
btop.enable = lib.mkDefault true;
fzf.enable = lib.mkDefault true;
};
home.packages = with pkgs; [ home.packages = with pkgs; [
alejandra
nh nh
nixd
]; ];
home.file = { home.file = {

View File

@ -161,6 +161,10 @@
programs.vscode.extensions = with pkgs-stable.vscode-extensions; [ programs.vscode.extensions = with pkgs-stable.vscode-extensions; [
jnoortheen.nix-ide jnoortheen.nix-ide
]; ];
home.packages = with pkgs-stable; [
alejandra
nixd
];
}) })
(lib.mkIf config.program.vscode.ide.web.enable { (lib.mkIf config.program.vscode.ide.web.enable {
@ -189,6 +193,10 @@
github.vscode-pull-request-github github.vscode-pull-request-github
github.vscode-github-actions github.vscode-github-actions
]; ];
programs.vscode.userSettings = {
"git.autofetch" = true;
};
}) })
(lib.mkIf config.program.vscode.markdown.enable { (lib.mkIf config.program.vscode.markdown.enable {

View File

@ -14,12 +14,15 @@
enable = true; enable = true;
userName = "${userSettings.username}"; userName = "${userSettings.username}";
userEmail = "kohout.fi.2023@skola.ssps.cz"; userEmail = "kohout.fi.2023@skola.ssps.cz";
lfs.enable = true;
}; };
home.packages = with pkgs; home.packages = with pkgs;
[ [
git git
github-cli github-cli
git-lfs
git-credential-manager
] ]
++ ( ++ (
if pkgs.system == "x86_64-linux" if pkgs.system == "x86_64-linux"

View File

@ -0,0 +1,43 @@
{
lib,
config,
pkgs,
...
}: {
options = {
style.enable = lib.mkEnableOption "style";
};
config = lib.mkIf config.style.enable {
stylix.iconTheme = {
enable = true;
package = pkgs.papirus-icon-theme;
dark = "Papirus-Dark";
};
stylix.targets = {
bat.enable = lib.mkDefault true;
btop.enable = lib.mkDefault true;
fzf.enable = lib.mkDefault true;
tmux.enable =
if config.program.tmux.enable
then lib.mkDefault true
else lib.mkDefault false;
dunst.enable =
if config.desktop.hyprland.enable
then lib.mkDefault true
else lib.mkDefault false;
kde.enable = true;
gtk.enable = true;
waybar = {
enable = true;
enableCenterBackColors = false;
enableLeftBackColors = false;
enableRightBackColors = false;
};
};
};
}

View File

@ -9,8 +9,6 @@
}; };
config = lib.mkIf config.program.tmux.enable { config = lib.mkIf config.program.tmux.enable {
#stylix.targets.tmux.enable = true;
programs.tmux = { programs.tmux = {
enable = true; enable = true;
clock24 = true; clock24 = true;

View File

@ -12,10 +12,8 @@
}; };
sh.zsh = { sh.zsh = {
enable = enable = true;
true; oh-my-posh.enable = true;
oh-my-posh.enable =
true;
}; };
sh.oh-my-posh.enable = true; sh.oh-my-posh.enable = true;