Release v2.2.0

This commit is contained in:
Hadi 2024-08-19 20:32:10 +02:00
parent caaa500232
commit e6f66110f0
22 changed files with 194 additions and 191 deletions

View File

@ -1,8 +1,8 @@
[//]: # (Title: Nixy)
[//]: # (Description: Nixy is a Hyprland NixOS configuration with home-manager, secrets and custom theming all in one place. It's a simple way to manage your system configuration and dotfiles.)
[//]: # (Author: Hadi)
[//]: # (Date: 08/18/24)
[//]: # (Version: v2.0.1)
[//]: # (Date: 08/19/24)
[//]: # (Version: v2.1.0)
<div align="center">
<img src="https://raw.githubusercontent.com/anotherhadi/nixy/main/docs/src/logo.png" width="100px" />
@ -15,7 +15,7 @@
<br>
<div align="center">
<a href="https://github.com/anotherhadi/nixy">
<img src="https://img.shields.io/static/v1.svg?style=for-the-badge&label=Version&message=v2.0.1&colorA=181825&colorB=89b4fa&logo=githubactions&logoColor=89b4fa"/>
<img src="https://img.shields.io/static/v1.svg?style=for-the-badge&label=Version&message=v2.1.0&colorA=181825&colorB=89b4fa&logo=githubactions&logoColor=89b4fa"/>
</a>
<a href="https://github.com/anotherhadi/nixy/stargazers">
<img src="https://img.shields.io/github/stars/anotherhadi/nixy?color=89b4fa&labelColor=181825&style=for-the-badge&logo=starship&logoColor=89b4fa">
@ -54,7 +54,7 @@ It's a simple way to manage your system configuration and dotfiles.
- 🏠 `home` are the dotfiles and configuration files for the users
- 'programs' is a collection of apps configured with home-manager
- 'scripts' is a folder full of bash scripts (see [SCRIPTS.md](docs/SCRIPTS.md))
- 'system' is some desktop environment like configuration
- 'system' is some "desktop environment" configuration
- 'wallpapers' are... wallpapers
- 💻 `hosts` are the system configuration files
- 'laptop' is my configuration for my laptop with Nvidia that you can copy

View File

@ -2,37 +2,37 @@
The list of the keybindings working on Hyprland:
| Description | Keybinding | Command |
| --------------------------- | ---------------------- | ------------------------------------------------------------------ |
| Switch Workspace | SUPER + {Number} | workspace {Number} |
| Move app to Workspace | SUPER SHIFT + {Number} | movetoworkspace {Number} |
| Kitty | SUPER + RETURN | exec \${pkgs.kitty}/bin/kitty |
| Thunar | SUPER + E | exec \${pkgs.xfce.thunar}/bin/thunar |
| Qutebrowser | SUPER + B | exec \${pkgs.qutebrowser}/bin/qutebrowser |
| Bitwarden | SUPER + K | exec \${pkgs.bitwarden}/bin/bitwarden |
| Peaclock | SUPER + C | exec \${pkgs.kitty}/bin/kitty --class peaclock peaclock |
| Lock | SUPER + L | exec \${pkgs.hyprlock}/bin/hyprlock |
| Powermenu | SUPER + X | exec powermenu |
| Launcher | SUPER + SPACE | exec menu |
| Close window | SUPER + Q | killactive |
| Toggle Floating | SUPER + T | togglefloating |
| Toggle Fullscreen | SUPER + F | fullscreen |
| Move focus left | SUPER + left | movefocus l |
| Move focus Right | SUPER + right | movefocus r |
| Move focus Up | SUPER + up | movefocus u |
| Move focus Down | SUPER + down | movefocus d |
| Screenshot window | SUPER + PRINT | exec screenshot window |
| Screenshot monitor | PRINT | exec screenshot monitor |
| Screenshot region | SUPER SHIFT + PRINT | exec screenshot region |
| Screenshot region then edit | ALT PRINT | exec screenshot region swappy |
| Turn off night shift | SUPER + F2 | exec night-shift-off |
| Turn on night shift | SUPER + F3 | exec night-shift-on |
| Choose sound output | SUPER + F5 | exec \${pkgs.kitty}/bin/kitty --class floating zsh -c sound-output |
| Move Window (mouse) | SUPER + mouse:272 | movewindow |
| Resize Window (mouse) | SUPER + R | resizewindow |
| Toggle Mute | XF86AudioMute | exec sound-toggle |
| Lock when closing Lid | switch:Lid Switch | exec \${pkgs.hyprlock}/bin/hyprlock |
| Sound Up | XF86AudioRaiseVolume | exec sound-up |
| Sound Down | XF86AudioLowerVolume | exec sound-down |
| Brightness Up | XF86MonBrightnessUp | exec brightness-up |
| Brightness Down | XF86MonBrightnessDown | exec brightness-down |
| Description | Keybinding |
|-----------------------------|--------------------------|
| Switch Workspace | SUPER + {Number} |
| Move app to Workspace | SHIFT + SUPER + {Number} |
| Kitty | SUPER + RETURN |
| Thunar | SUPER + E |
| Qutebrowser | SUPER + B |
| Bitwarden | SUPER + K |
| Peaclock | SUPER + C |
| Lock | SUPER + L |
| Powermenu | SUPER + X |
| Launcher | SUPER + SPACE |
| Close window | SUPER + Q |
| Toggle Floating | SUPER + T |
| Toggle Fullscreen | SUPER + F |
| Move focus left | SUPER + left |
| Move focus Right | SUPER + right |
| Move focus Up | SUPER + up |
| Move focus Down | SUPER + down |
| Screenshot window | SUPER + PRINT |
| Screenshot monitor | PRINT |
| Screenshot region | SHIFT + SUPER + PRINT |
| Screenshot region then edit | ALT PRINT |
| Turn off night shift | SUPER + F2 |
| Turn on night shift | SUPER + F3 |
| Choose sound output | SUPER + F5 |
| Move Window (mouse) | SUPER + mouse:272 |
| Resize Window (mouse) | SUPER + R |
| Toggle Mute | XF86AudioMute |
| Lock when closing Lid | switch:Lid Switch |
| Sound Up | XF86AudioRaiseVolume |
| Sound Down | XF86AudioLowerVolume |
| Brightness Up | XF86MonBrightnessUp |
| Brightness Down | XF86MonBrightnessDown |

View File

@ -10,21 +10,25 @@ feel free to contribute <3 ([CONTRIBUTING.md](CONTRIBUTING.md))
- [ ] Hyprland
- [ ] Implement Hyprcursor
- [ ] Animations based on app name
- [ ] Wofi: popin
- [ ] Wlogout: fade in
- [ ] Fix screenshots (screenshot region's border shows up in the screenshot)
echo "Compresing png files..."
- [ ] wofi: popin
- [ ] wlogout: fade in
- [ ] Fix screenshots (screenshot region's border shows up in the screenshot, hyprshot jq error?)
- [ ] Hyprlock themes
- [ ] Hypridle fix: suspend not working?
- [ ] Nixvim
- [ ] Keymaps:
- Trouble
- Tagbar
- Tagbar (actually not working)
- [ ] Disable background color for headlines.nvim for titles
## Server
- [ ] Server configuration is actually broken, need to update with the new modules
- [ ] Jackflix V2
- Backup Radarr, Prowlarr, Sonarr config
- [ ] Bitcoin-git
- Take a look into buildarr
- [ ] Bitcoin-git: to test
- [ ] Ntfy auth file
- [ ] Secrets mode 0444: not secure

View File

@ -7,8 +7,12 @@ echo "Current tag: $TAG"
read -rp "Enter the new tag name: " NEW_TAG
echo "Compresing png files..."
bash ./docs/scripts/compress_png.sh
read -rp "Do you want to compress the png files? [y/N]: " COMPRESS_PNG
if [[ "$COMPRESS_PNG" == "y" || "$COMPRESS_PNG" == "Y" ]]; then
echo "Compresing png files..."
bash ./docs/scripts/compress_png.sh
fi
echo "Creating wallpapers preview..."
bash ./docs/scripts/create_preview_wallpapers.sh
echo "Creating README.md..."

View File

@ -549,21 +549,6 @@
"type": "github"
}
},
"nurpkgs": {
"locked": {
"lastModified": 1724012881,
"narHash": "sha256-lqn4UX+tvtwOmBZ2Dxh6euXKNcXGEYqPolEdjtONDVY=",
"owner": "nix-community",
"repo": "NUR",
"rev": "8c7136cb22fd96cde881225863b450df75876ebc",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "NUR",
"type": "github"
}
},
"nuschtosSearch": {
"inputs": {
"flake-utils": "flake-utils_2",
@ -606,7 +591,6 @@
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_3",
"nixvim": "nixvim",
"nurpkgs": "nurpkgs",
"sops-nix": "sops-nix",
"spicetify-nix": "spicetify-nix"
}

View File

@ -25,7 +25,6 @@
inputs.nixpkgs.follows = "nixpkgs";
};
hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
nurpkgs.url = "github:nix-community/NUR"; # TODO: test to remove
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
};
@ -35,19 +34,10 @@
nixy = nixpkgs.lib.nixosSystem { # CHANGEME
system = "x86_64-linux";
modules = [
./hosts/laptop/configuration.nix # CHANGEME
{ _module.args = { inherit inputs; }; }
inputs.nixos-hardware.nixosModules.omen-16-n0280nd # CHANGEME
inputs.home-manager.nixosModules.home-manager
{
nixpkgs.overlays = [ inputs.nurpkgs.overlay ];
_module.args = { inherit inputs; };
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users."hadi" = import ./hosts/laptop/home.nix; # CHANGEME
extraSpecialArgs = { inherit inputs; };
};
}
./hosts/laptop/configuration.nix # CHANGEME
];
};

View File

@ -1,7 +1,6 @@
{ pkgs, ... }:
let
# TODO: Broken - hypshot not working (jq error)
screenshot = pkgs.writeShellScriptBin "screenshot" ''
if [[ $2 == "swappy" ]];then
folder="/tmp"

View File

@ -8,7 +8,7 @@
timeout = 600;
on-timeout = pkgs.hyprlock + "/bin/hyprlock";
}
# FIXME
# {
# timeout = 660;
# on-timeout = "systemctl suspend";

View File

@ -1,110 +1,28 @@
{ pkgs, config, ... }: {
{ config, ... }: {
imports = [
./hardware-configuration.nix
../modules/fonts.nix
../modules/nvidia.nix
# ../modules/prime.nix
../modules/zsh.nix
../modules/tuigreet.nix
../modules/auto-upgrade.nix
../modules/timezone.nix
../modules/usb.nix
../modules/systemd-boot.nix
../modules/users.nix
../modules/audio.nix
../modules/bluetooth.nix
../modules/tailscale.nix
../modules/nix.nix
../modules/network-manager.nix
../modules/home-manager.nix
../modules/utils.nix
./hardware-configuration.nix
./variables.nix
];
networking.networkmanager.enable = true;
networking.hostName = config.var.hostname;
systemd.services.NetworkManager-wait-online.enable = false;
services = {
tailscale.enable = config.var.tailscale;
xserver = {
enable = true;
xkb.layout = config.var.keyboardLayout;
xkb.variant = "";
};
blueman.enable = true;
gnome.gnome-keyring.enable = true;
};
console.keyMap = config.var.keyboardLayout;
programs.zsh = {
enable = true;
loginShellInit = ''
dbus-update-activation-environment --systemd DISPLAY
'';
};
users.defaultUserShell = pkgs.zsh;
environment.variables = {
XDG_DATA_HOME = "$HOME/.local/share";
PASSWORD_STORE_DIR = "$HOME/.local/share/password-store";
EDITOR = "nvim";
};
nix = {
extraOptions = ''
warn-dirty = false
'';
settings = {
auto-optimise-store = true;
experimental-features = [ "nix-command" "flakes" ];
substituters = [ "https://hyprland.cachix.org" ];
trusted-public-keys = [
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
];
};
gc = {
automatic = config.var.autoGarbageCollector;
persistent = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
};
nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [
networkmanagerapplet
fd
bc
gcc
git-ignore
xdg-utils
wget
curl
];
# nixpkgs.config.permittedInsecurePackages =
# [ "electron-25.9.0" ]; # TODO: test to remove
system.autoUpgrade = {
enable = config.var.autoUpgrade;
dates = "04:00";
flake = "${config.var.configDirectory}";
flags = [ "--update-input" "nixpkgs" "--commit-lock-file" ];
allowReboot = false;
};
# xdg.portal = { # TODO: test to remove
# enable = true;
# configPackages = with pkgs; [ xdg-desktop-portal-gtk ];
# };
services.libinput.enable = true;
programs.dconf.enable = true;
# Faster rebuilding
documentation = {
enable = true;
doc.enable = false;
man.enable = true;
dev.enable = false;
};
services.dbus.enable = true;
home-manager.users."${config.var.username}" = import ./home.nix;
# Don't touch this
system.stateVersion = "24.05";

View File

@ -0,0 +1,9 @@
{ config, ... }: {
system.autoUpgrade = {
enable = config.var.autoUpgrade;
dates = "04:00";
flake = "${config.var.configDirectory}";
flags = [ "--update-input" "nixpkgs" "--commit-lock-file" ];
allowReboot = false;
};
}

View File

@ -4,4 +4,6 @@
enable = true;
powerOnBoot = true;
};
services.blueman.enable = true;
}

View File

@ -0,0 +1,7 @@
{ inputs, ... }: {
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = { inherit inputs; };
};
}

View File

@ -0,0 +1,6 @@
{ pkgs, ... }: {
networking.networkmanager.enable = true;
systemd.services.NetworkManager-wait-online.enable = false;
environment.systemPackages = with pkgs; [ networkmanagerapplet ];
}

22
hosts/modules/nix.nix Normal file
View File

@ -0,0 +1,22 @@
{ config, ... }: {
nixpkgs.config.allowUnfree = true;
nix = {
extraOptions = ''
warn-dirty = false
'';
settings = {
auto-optimise-store = true;
experimental-features = [ "nix-command" "flakes" ];
substituters = [ "https://hyprland.cachix.org" ];
trusted-public-keys = [
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
];
};
gc = {
automatic = config.var.autoGarbageCollector;
persistent = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
};
}

View File

@ -0,0 +1 @@
{ config, ... }: { services.tailscale.enable = config.var.tailscale; }

View File

@ -1,7 +1,10 @@
{ config, ... }: {
users.users.${config.var.username} = {
isNormalUser = true;
description = "${config.var.username} account";
extraGroups = [ "networkmanager" "wheel" ];
{ config, pkgs, ... }: {
users = {
defaultUserShell = pkgs.zsh;
users.${config.var.username} = {
isNormalUser = true;
description = "${config.var.username} account";
extraGroups = [ "networkmanager" "wheel" ];
};
};
}

42
hosts/modules/utils.nix Normal file
View File

@ -0,0 +1,42 @@
{ pkgs, config, ... }: {
networking.hostName = config.var.hostname;
services = {
xserver = {
enable = true;
xkb.layout = config.var.keyboardLayout;
xkb.variant = "";
};
gnome.gnome-keyring.enable = true;
};
console.keyMap = config.var.keyboardLayout;
environment.variables = {
XDG_DATA_HOME = "$HOME/.local/share";
PASSWORD_STORE_DIR = "$HOME/.local/share/password-store";
EDITOR = "nvim";
};
services.libinput.enable = true;
programs.dconf.enable = true;
services.dbus.enable = true;
# Faster rebuilding
documentation = {
enable = true;
doc.enable = false;
man.enable = true;
dev.enable = false;
};
environment.systemPackages = with pkgs; [
fd
bc
gcc
git-ignore
xdg-utils
wget
curl
];
}

8
hosts/modules/zsh.nix Normal file
View File

@ -0,0 +1,8 @@
{
programs.zsh = {
enable = true;
loginShellInit = ''
dbus-update-activation-environment --systemd DISPLAY
'';
};
}

View File

@ -1,4 +1,19 @@
{ pkgs, ... }: {
{ pkgs, ... }:
let
bitcoin-price = pkgs.writeShellScriptBin "bitcoin-price" ''
[ ! -d "/home/hadi/btcprice" ] && ${pkgs.git}/bin/git clone git@github.com:anotherhadi/btcprice /home/hadi/btcprice
cd "/home/hadi/btcprice"
price=$(${pkgs.curl}/bin/curl eur.rate.sx/1BTC)
echo "# Bitcoin Price in EURO" >README.md
echo "" >>README.md
echo "1 Bitcoin = $price" >>README.md
echo "" >>README.md
echo "Date: $(date)" >>README.md
${pkgs.git}/bin/git add .
${pkgs.git}/bin/git commit -m "Update price (hadi)"
${pkgs.git}/bin/git push -u origin main
'';
in {
systemd.timers."bitcoin-git" = {
wantedBy = [ "timers.target" ];
timerConfig = {
@ -10,17 +25,7 @@
systemd.services."bitcoin-git" = {
script = ''
[ ! -d "/home/hadi/btcprice" ] && ${pkgs.git}/bin/git clone git@github.com:anotherhadi/btcprice /home/hadi/btcprice
cd "/home/hadi/btcprice"
price=$(${pkgs.curl}/bin/curl eur.rate.sx/1BTC)
echo "# Bitcoin Price in EURO" >README.md
echo "" >>README.md
echo "1 Bitcoin = $price" >>README.md
echo "" >>README.md
echo "Date: $(date)" >>README.md
${pkgs.git}/bin/git add .
${pkgs.git}/bin/git commit -m "Update price (hadi)"
${pkgs.git}/bin/git push -u origin main
${bitcoin-price}
exit 0
'';
serviceConfig = {

View File

@ -17,7 +17,6 @@
# haugene/transmission-openvpn
# '';
# };
# TODO: launch the container at boot
networking.firewall.allowedTCPPorts = [ 9091 ];
}

View File

@ -2,7 +2,7 @@
sops = {
age.keyFile = "/home/hadi/.config/sops/age/keys.txt";
defaultSopsFile = ./server.yaml;
defaultSopsFile = ./secrets.yaml;
defaultSopsFormat = "yaml";
secrets = {
sshconfig = {
@ -14,15 +14,15 @@
owner = "hadi";
};
nextcloud-adminpass = {
mode = "0444"; # FIXME
mode = "0444";
path = "/etc/nextcloud/adminpassFile";
};
cloudflare-apitoken = {
mode = "0444"; # FIXME
mode = "0444";
path = "/etc/cloudflare/apiToken";
};
tailscaled-authKey = {
mode = "0444"; # FIXME
mode = "0444";
path = "/etc/tailscale/authKey";
};
transmission-script = {